Cell differentiation defines acute and chronic infection cell types in Staphylococcus aureus

A central question to biology is how pathogenic bacteria initiate acute or chronic infections. Here we describe a genetic program for cell-fate decision in the opportunistic human pathogen Staphylococcus aureus, which generates the phenotypic bifurcation of the cells into two genetically identical but different cell types during the course of an infection. Whereas one cell type promotes the formation of biofilms that contribute to chronic infections, the second type is planktonic and produces the toxins that contribute to acute bacteremia. We identified a bimodal switch in the agr quorum sensing system that antagonistically regulates the differentiation of these two physiologically distinct cell types. We found that extracellular signals affect the behavior of the agr bimodal switch and modify the size of the specialized subpopulations in specific colonization niches. For instance, magnesium-enriched colonization niches causes magnesium binding to S. aureusteichoic acids and increases bacterial cell wall rigidity. This signal triggers a genetic program that ultimately downregulates the agr bimodal switch. Colonization niches with different magnesium concentrations influence the bimodal system activity, which defines a distinct ratio between these subpopulations; this in turn leads to distinct infection outcomes in vitro and in an in vivo murine infection model. Cell differentiation generates physiological heterogeneity in clonal bacterial infections and helps to determine the distinct infection types.


Introduction
Nosocomial pathogens often cause a broad range of diseases using diverse virulence factors, such as production of tissue-damaging toxins or production of adhesins during biofilm formation (Bush et al., 2011). Staphylococcus aureus is one such pathogen that is able to cause different types of life-threatening infections in hospital settings, from acute bacteremia to endocarditis, pneumonia and chronic biofilm-associated infections in prosthetic devices (Otto, 2012). The underlying cellular processes that enable S. aureus to provoke these disparate types of infections is likely driven by host-microbe interactions (Casadevall et al., 2011), in which specific, yet-to-be-described extracellular signals play a role to generate distinct, locally defined types of infections (Veening et al., 2008;Ló pez and Kolter, 2010). Determining the cellular processes and the nature of the extracellular signals that define the different infection outcomes is crucial for understanding how difficult-to-treat bacterial infections develop and for improving strategies to overcome antimicrobial resistance.
In S. aureus, infection outcome is controlled by the agr quorum sensing program, which is autoactivated in response to the self-produced extracellular signal AIP (autoinducing peptide) (Recsei et al., 1986). AIP binds to the AgrC histidine kinase membrane receptor and activates its cognate regulator AgrA via phosphorylation ( Figure 1A). AgrA~P induces changes in cellular gene expression that results in rapid bacterial dispersion in the host and acute bacteremia (Thoendel et al., 2011). Dispersion of S. aureus requires upregulation of surfactant phenol-soluble modulins (psma and psmb), which are amphipathic small peptides that contribute to bacteria detachment (Li et al., 2009a;Peschel and Otto, 2013) and destabilize cell membranes, rendering them cytotoxic to host cells. Modulins are usually expressed during acute infections, as well as hemolytic toxins (hla, hlb, hlg) that facilitate tissue disruption during septicemia (Recsei et al., 1986). In contrast, agr activation indirectly downregulates the icaADBC operon genes needed to synthesize the extracellular polysaccharide matrix that protects cells within a biofilm (PNAG or PIA), as well as several adhesion proteins (SpA and other MSCRAMM proteins) responsible for cell aggregation/attachment during biofilm formation (Recsei et al., 1986;Boles and Horswill, 2008;Peng et al., 1988). Biofilms, which are associated with untreatable chronic infections, protect bacteria from antibiotics and host defenses (Lewis, 2008;Lopez et al., 2010;Nadell et al., 2009;Parsek and Singh, 2003). The S. aureus agr quorum sensing system antagonistically regulates the activation of planktonic and biofilm-associated lifestyles (Recsei et al., 1986;Boles and Horswill, 2008;Peng et al., 1988), which contribute to the development of acute and chronic infection outcomes, respectively. A large number of positive and negative regulators controls agr expression. Among those, the agr system is inhibited by the s B sigma factor . Activation of s B occurs during early stationary phase (Senn et al., 2005) in response to distinct types of cellular stresses Kästle et al., 2015). s B triggers a general eLife digest While in hospital, patients can be unwittingly exposed to bacteria that can cause disease. These hospital-associated bacteria can lead to potentially life-threatening infections that may also complicate the treatment of the patients' existing medical conditions. Staphylococcus aureus is one such bacterium, and it can cause several types of infection including pneumonia, blood infections and long-term infections of prosthetic devices.
It is thought that S. aureus is able to cause so many different types of infection because it is capable of colonizing distinct tissues and organs in various parts of the body. Understanding the biological processes that drive the different infections is crucial to improving how these infections are treated.
S. aureus lives either as an independent, free-swimming cell or as part of a community known as a biofilm. These different lifestyles dictate the type of infection the bacterium can cause, with freeswimming cells producing toxins that contribute to intense, usually short-lived, infections and biofilms promoting longer-term infections that are difficult to eradicate. However, it is not clear how a population of S. aureus cells chooses to adopt a particular lifestyle and whether there are any environmental signals that influence this decision.
Here, Garcia-Betancur et al. found that S. aureus populations contain small groups of cells that have already specialized into a particular lifestyle. These groups of cells collectively influence the choice made by other cells in the population. While both lifestyles will be represented in the population, environmental factors influence the numbers of cells that initially adopt each type of lifestyle, which ultimately affects the choice made by the rest of the population. For example, if the bacteria colonize a tissue or organ that contains high levels of magnesium ions, the population is more likely to form biofilms.
In the future, the findings of Garcia-Betancur et al. may help us to predict how an infection may develop in a particular patient, which may help to diagnose the infection more quickly and allow it to be treated more effectively. stress response that affects expression of a number of virulence and stress-response genes and indirectly represses agr (Thoendel et al., 2011). Thus, s B antagonizes the influence of the agr system on virulence factor expression (Senn et al., 2005;Pané-Farré et al., 2006) and biofilm formation Kullik et al., 1998).
This understanding of agr-mediated antagonistic regulation of chronic and acute S. aureus infection outcomes was built on comparative analyses of clinical isolates and characterization of infection Pspa-yfp Ppsmα-mars aureus. AIP binds to the AgrC histidine kinase membrane receptor and activates its cognate regulator AgrA via phosphorylation (AgrA~P). AgrA~P upregulates toxin-coding genes that are also responsible for cell dispersion (hla, hlb, psma and psmb) and it downregulates genes involved in biofilm formation (ica and spa). (B) Quantitative analysis of fluorescence microscopy images of agr-related promoters. The control promoter is the agr-independent dnaA, which has a monomodal expression pattern. We counted 700 random cells from each of three independent microscopic fields from independent experiments (2100 cells total for each strain). (C) Fluorescence microscopy images of double-labeled cells at various times during aggregate formation (24, 72 and 120 hr). Percentages of cells quantified in the fields with positive overlapping signal. Cells were counted as in (A). A signal is considered to overlap when signals are detected in a 3:1-1:3 range, the range in which green and red signals merge to yellow. Top row, double-labeled strains with Pica-yfp, Pspa-yfp (BRcells) and Ppsma-yfp, Ppsmb-yfp (DRcells) promoters. Bottom row, double-labeled strains with antagonistic promoters. Bar = 2 mm. DOI: https://doi.org/10.7554/eLife.28023.003 The following figure supplement is available for figure 1: related mutants. Through this approach, agr-defective isolates are frequently identified from chronic infections as these mutants usually show reduced hemolytic activity and develop robust biofilms (Fischer et al., 2014;Goerke and Wolz, 2010;Grundmeier et al., 2010;Hirschhausen et al., 2013;Savage et al., 2013). In addition, agr dysfunction is frequently correlated with chronic persistent S. aureus infections (Fowler et al., 2004) such as small colony variants (SCV). SCV have exceptionally low agr expression levels (Kahl et al., 2016) and high expression of biofilm-related genes . High s B expression is important for SCV phenotype acquisition (Mitchell et al., 2013), because sigB mutants do not generate SCV (Tuchscherr and Lö ffler, 2016;Tuchscherr et al., 2015). However, whether the capacity of nosocomial pathogens, such as S. aureus, to cause distinct types of infections is restricted to the emergence of genetic variants is still unclear. Staphylococcus aureus cells are exposed to a variety of local environmental signals during the course of an infection that can influence bacterial gene expression and thus, their infective potential in a given infection niche. These signals include, but are not limited to, changes in nutrient availability, temperature, pH, osmolarity or, oxygen concentration. Staphylococcus aureus might be able to respond collectively to these extracellular cues to adapt its behavior in a fluctuating environment (Münzenmayer et al., 2016), allowing staphylococcal communities to generate distinct, locally defined infection types without modification of the bacterial genome (Veening et al., 2008;Ló pez and Kolter, 2010). It has been hypothesized that changes in bacterial virulence potential are a response to local concentrations of tissue-specific signals, which have an important role in determining infection outcome (Cheung et al., 2004). Yet how bacteria prepare for such unpredictable environmental changes is a question that remains unanswered. A fundamental feature of microbial cells is their ability to adapt to diverse environmental conditions by differentiating into specialized cell types (Arnoldini et al., 2014;Ló pez et al., 2009;Veening et al., 2005). In most cases, the extracellular cues are responsible for defining coexisting cell fates in bacterial populations. Cell fates are genetically identical and phenotypically distinct bacterial subpopulations that express heterogeneously different sets of genes and have distinct functions within the microbial community (George et al., 2015). A classical example of this is the bacterial response to antibiotics. Antibiotics kill most S. aureus cells, but it is frequent to observe a small subpopulation of genetically identical but antibiotic-persister cells that can cause recurrent infections in a post-antibiotic period (Bigger, 1944;Lewis and cells, 2007).
The relative simplicity of agr-mediated antagonistic regulation of planktonic and biofilm-associated lifestyles provides a natural model to analyze how S. aureus cells collectively establish acute or chronic infection lifestyles and to identify extracellular factors that influence activation of the cellular program that leads to prevalence of one infection program over the other. Here, we report a bimodal behavior in the agr quorum sensing system that antagonistically regulates the differentiation of two genetically identical but physiologically distinct specialized cell types in S. aureus communities. One cell type contributes to the formation of biofilms responsible for chronic infections, whereas a second was constituted by dispersed cells that produced the toxins that contribute to an acute bacteremia. These subpopulations were present in S. aureus communities at different ratios depending on growth conditions, which contributed to determining the outcome of infection. We found that colonization niches with higher Mg 2+ concentrations, which is inherent in tissues colonized preferentially by S. aureus (Günther, 2011;Jahnen-Dechent and Ketteler, 2012), influenced the bimodal switch and increased the size of the subpopulation of cells specialized in biofilm formation, as Mg 2+ binding to teichoic acids increases cell wall rigidity and triggered a s B stress-induced genetic cascade that downregulates agr. In a mouse model, bacterial cell differentiation occurred during in vivo infections and the Mg 2+ concentration in infected organs influenced collective bacterial behavior in simultaneous progress to a biofilm-associated chronic infection or a disperse bacteremia. This study shows that cell differentiation in S. aureus helps to diversify the types of infections that arise simultaneously from an infection caused by a clonal population of bacteria.

Staphylococcus aureus multicellular aggregates differentiate cell types
We explored the role of agr-mediated antagonistic regulation of planktonic and biofilm-associated lifestyles in S. aureus aggregates growing on Mg 2+ -enriched TSB medium (TSBMg), in which most S. aureus clinical isolates develop robust multicellular aggregates . To study biofilm gene expression, we introduced transcriptional fusions of biofilm-associated ica/spa genes. The ica operon is responsible for production of the exopolysaccharide polymeric matrix (PNAG or PIA) that lends consistency to the biofilm. The spa gene encodes a cell wall-anchored adhesion protein, adhesin that is responsible for S. aureus cell aggregation and attachment to surfaces during biofilm formation (Recsei et al., 1986;Boles and Horswill, 2008;Peng et al., 1988). To monitor planktonic gene expression, we generated transcriptional fusions of psma and psmb genes. These genes code for small peptides, the phenol-soluble modulins, whose expression depends directly on agr. Due to their surfactant properties, PSMa and PSMb act as cytolytic toxins that contribute to bacterial dispersion and play an important role in acute staphylococcal infections (Li et al., 2009a;Peschel and Otto, 2013) ( Figure 1A). These reporters were introduced into neutral loci in the S. aureus chromosome to ensure expression of a single reporter copy in each cell ; we monitored their expression at the single-cell level in S. aureus aggregates using quantitative analysis of fluorescence microscopy images ( Figure 1B and Figure 1-figure supplement 1A-B). All reporters showed bimodal expression and indicated the bifurcation of two cell subpopulations in S. aureus aggregates, one with lower and another with higher fluorescence levels. This bimodal expression pattern differed from the unimodal expression of the housekeeping and agr-independent gene dnaA, used as control reporter ( Figure 1B and Monitoring the temporal dynamics of the subpopulations that bifurcated during the development of the microbial aggregates from an initial inoculum in TSBMg revealed larger subpopulations of icaand spa-expressing cells in early developmental stages (~72 hr; Figure 1B), compared to the size of these subpopulation at later growth stages (~120 hr). In contrast, the size of the subpopulations of psma/b-expressing cells increased concomitantly with time, consistent with the reported antagonistic regulation of ica/spa and psma/b by agr (Recsei et al., 1986;Boles and Horswill, 2008;Peng et al., 1988). We generated strains labeled with different pairwise combinations of these reporters, which were both introduced into neutral loci in the S. aureus chromosome; this allowed quantitative analysis of fluorescence microscopy images to examine simultaneous expression in S. aureus microbial communities ( Figure 1C and Figure 1-figure supplement 1D). This approach indicated coexpression of ica with spa and of psma with psmb in two distinct cell subpopulations, showing the bifurcation of two distinct subpopulation of cells specialized in expressing ica, spa and other biofilm-related genes (BRcells) and cells expressing psma/b dispersion-related genes (DRcells).
Differential AgrA~P affinity to P2 and P3 promoters generates the agr positive feedback loop that differentiates BRcells and DRcells The differential expression of agr-related genes in the distinct cell types led us to analyze the molecular mechanism of agr-mediated cell differentiation. The agr system is autoactivated once the extracellular AIP concentration reaches a given threshold (10-14 mM) (MDowell et al., 2001) and is inhibited by s B induction . Following agr activation, AgrA~P directly upregulates psma/b expression (Queck et al., 2008) and binds to the two adjacent divergent promoters P2 and P3, which trigger expression of RNAII and RNAIII transcripts, respectively (Koenig et al., 2004). RNAII upregulates the agrBDCA operon, which encodes the agr signal transduction cascade, including the AIP signal, the AgrC sensor kinase and its AgrA cognate regulator. Therefore, AgrA~P binding to the P2 promoter constitutes a positive feedback loop in which AgrA~P regulator induces expression of the agrBDCA operon, which encodes the entire agr signal transduction cascade (Thoendel et al., 2011;Queck et al., 2008). Bimodal gene expression in microbial populations is usually triggered by a positive feedback loop in which a gene product induces its own expression. We hypothesize that, once a certain AgrA~P threshold is reached in a cell, AgrA~P induces its own expression and these cells maintain high AgrA~P levels. Thus, AgrA~P and AgrA-controlled genes will thus be activated in that cell, including upregulation of RNAIII via activation of the P3 promoter. RNAIII positively regulates a pool of agr-dependent genes that encode the cytotoxic toxins and virulence factors responsible for acute infection (Koenig et al., 2004). Activation of the P3 promoter leads DRcells to specialize in dispersion and virulence. In contrast, cells that do not achieve the AgrA~P expression threshold needed to induce the positive feedback mechanism will not induce P3 promoter expression. In these cells, genes normally repressed by AgrA~P will be upregulated, including biofilm-related genes, which licenses cells to differentiate as biofilm-producing BRcell types.
To determine whether activation of the agr positive feedback loop is sufficient to generate bimodality in a bacterial population, we genetically engineered an orthogonal agr system in B. subtilis in which the agr positive feedback loop was isolated from its native complex regulatory network (Audretsch et al., 2013) and thus exempt from interference from additional staphylococcal regulatory inputs. In this orthogonal system, B. subtilis harbored P psma -yfp or P psmb -yfp reporters and expressed the membrane kinase AgrC and its cognate regulator AgrA under the control of the AgrA-inducible P2 promoter ( Figure 2A). The orthogonal system does not express staphylococcal s B , and s B from B. subtilis did not interfere with the agr system, since we detected similar reporter expression in wild type (WT) and DsigB strains (Figure 2-figure supplement 1A), ensuring the absence of the agr inhibitory input signal. We used this orthogonal system to identify the minimal components necessary for bimodal expression of agr-related genes, using psma/b expression as readout for agr activity ( Figure 2B) (Zhang et al., 2015). Activation of the agr positive feedback loop in the orthogonal system requires addition of purified AIP (10 mM) to B. subtilis cultures (AIP contains a thiolactone ring thus it cannot be synthetically produced). AIP addition activates AgrC sensor kinase, which phosphorylates the AgrA regulator. The AgrA~P active form binds the P2 promoter to express high AgrA~P levels and activate the positive feedback loop; this resulted in bimodal expression of chromosomally integrated P psma -yfp or P psmb -yfp reporters, with a cell subpopulation in which reporter expression increased during a transition in which cells switched from off to on. In contrast, chromosomally integrated P ica -yfp and P spa -yfp reporters, which are not controlled directly by the AgrA~P, did not activate in response to added AIP. In a similar manner, we did not detect fluorescence in control experiments with strains lacking the AgrC-AgrA system, or when no AIP was added ( Figure 2B and Figure 2-figure supplement 1A), demonstrating that stochastic expression of these reporter genes does not account for bifurcation of the cell populations. These results indicate that the minimal agr genetic program harbored in the orthogonal system acts as an autonomous program for cell differentiation in bacterial populations.
Identification of the molecular mechanism that leads agr to act as an autonomous program to define cell fate bifurcation in S. aureus required analysis of the agr-signaling cascade in the presence of AIP. We therefore generated two additional orthogonal systems to monitor P2 (P RNAII -yfp) and P3 (P RNAIII -yfp) activation independently ( Figure 2C). In response to exogenous AIP (10 mM), these systems showed a transition period during which P2 and P3 cells switched on after which subpopulation sizes remained constant. The P2-expressing cell subpopulation differentiated earlier, however, and showed a more intense fluorescence signal in a larger cell subpopulation over time compared to the orthogonal system that differentiated P3-expressing cells. This result suggests that P2 promoter is more sensitive than P3 to agr activation, a characteristic feature of positive feedback loops in bimodal systems (Siebring et al., 2012). Based on these results, we hypothesized that the bimodal behavior of agr and thus, cell differentiation in S. aureus, relies on the differential affinity of AgrA~P for P2 and P3 promoters. P2 thus activates the feedback loop at lower AgrA~P concentrations and only in a subpopulation of cells. These cells contain high AgrA~P levels, which licenses them to trigger the less-sensitive P3 promoter and induce the agr regulon, leading the cells to specialize in dispersion and virulence and become DRcells. Cells that express P2 below the threshold cannot activate the agr feedback loop and are thus unable to induce P3 promoter expression. In this subpopulation, agr-repressed genes are upregulated, including genes involved in biofilm formation, which licenses them to differentiate as BRcells.
We tested this hypothesis by first analyzing the dynamics of the agr positive feedback loop using mathematical modeling coupled to computational simulations (Figure 2-figure supplement 1B-E) (Chong et al., 2014;Golding et al., 2005). The full network dynamics remained constant, since the orthogonal system was similar for all promoters tested. We optimized the promoter-specific rates; K on (association) and K off (dissociation) denote interaction with AgrA~P and K t denotes reporter transcription ( Figure 2. The agr QS system is an autonomous program for cell fate decision-making. (A) Scheme showing the orthogonal system generated in Bacillus subtilis. In this system, the membrane kinase AgrC and its cognate regulator AgrA were expressed under the control of their own P2 promoter. This strain also harbors a Ppsma-yfp or a Ppsmb-yfp reporter, which allows monitoring agr activation. Addition of purified AIP to B. subtilis cultures as input signal activated the agr system and led to bimodal expression of chromosomally integrated Ppsma-or Ppsmb-yfp reporters. (B) Flow cytometry profiles of the orthogonal agr system in B. subtilis showing bimodal expression of the agr-dependent psma/b reporters at different times after AIP induction. Control panels show no expression of these reporters without the AgrCA chimera. The ica/spa promoters were not activated, as they are not regulated directly by AgrA~P (Recsei et al., 1986;Boles and Horswill, 2008;Peng et al., 1988). Cultures were grown in liquid LB medium and incubated (37˚C, 12 hr, 200 rpm agitation). (C) Flow cytometry showed bimodal expression of P2 (up) and P3 (down) promoters after AIP induction. Cultures were grown in liquid LB medium and incubated (37˚C, 12 hr, 200 rpm agitation). (D) Flow cytometry monitoring simultaneous expression of P RNAII or P2 (y-axis) and P RNAIII or P3 (x-axis) in a population of P2-cfp P3-yfp double-labeled cells cultured with AIP (10 mM). Samples were collected at various times and represented in a 2D graph (x axis, CFP signal; y axis, YFP signal). Dual system at various times after AIP induction. Isolines in the graph represent cell populations. The subpopulation that initially expressed the P2-cfp reporter was the same as that which later expressed the P3-yfp reporter. DOI: https://doi.org/10.7554/eLife.28023.005 The following figure supplement is available for figure 2:  , suggesting that DRcells resulted from sequential P2 and P3 promoter activation. We tested this model experimentally in a dual orthogonal system harboring P2 (P RNAII -cfp) and P3 (P RNAIII -yfp) reporters expressed as two adjacent transcriptional units transcribed in opposite directions, similar to the chromosomal organization in the S. aureus genome ( Figure 2D and Figure 2figure supplement 1F). We used flow cytometry analysis with simultaneous detection of CFP and YFP signals to determine quantitatively whether the P2-expressing subpopulation becomes P3expressing cells over time after AIP addition (10 mM). At 4 hr post-AIP induction, we detected a cell subpopulation that expressed P2; a fraction of this subpopulation activated P3 at later times (6 hr). The subpopulation of P3-expressing cells increased over time until it expressed P2 and P3 promoters uniformly. Cells that expressed only the P3 promoter were not detected. This is consistent with our hypothesis that P2-mediated activation of the agr positive feedback loop is necessary to increase AgrA~P levels, which in turn induces expression of the less-sensitive P3 promoter in these cells. The molecular mechanism for bimodal gene expression thus relies on the differential AgrA~P affinity for P2 and P3 promoters. P2 is very sensitive and triggers the agr positive feedback loop, whereas P3 induces expression of virulence genes and is necessary for DRcell specialization. In the following section, we used this information to demonstrate that the self-regulatory activity of AgrA~P via binding to the P2 promoter is essential for triggering S. aureus cell differentiation while other additional cues that feed into the agr switch only modulate the activity of the system. Increase in cell wall rigidity activates s B , repressing the agr positive feedback loop Once the agr switch responsible for BRcell and DRcell differentiation is activated, distinct extracellular cues can arise from the niche to feed into the agr bimodal switch and modulate its activity. For instance, BRcell and DRcell subpopulations are detected at different ratios in TSB and TSBMg cultures. We hypothesized that variations in extracellular input signals would affect agr bimodal behavior and produce distinct outcomes in the bimodal system. This would define a distinct DRcell:BRcell ratio, which could have important clinical implications for the definition of infection outcomes. As the difference between TSB and TSBMg media resides in Mg 2+ supplementation, we tested the effect of extracellular Mg 2+ on the response of the agr-repressor s B , which is activated by environmental stresses. In TSBMg medium, qRT-PCR analysis showed increased expression of the s B -dependent stress gene asp23 (alkaline shock protein) (Gertz et al., 2000) ( Figure 3A) and of staphyloxanthin, the pigment that gives S. aureus its typical yellow color and whose expression is regulated directly by s B (Gertz et al., 2000;Giachino et al., 2001) (Figure 3-figure supplement 1A). TSBMg medium also induced biofilm formation ( Figure 3B). Biofilm formation likely occurred via agr inhibition because the DsigB strain did not form biofilm and the biofilm formation phenotype was partially recovered in a DsigBDagr double mutant ( Figure 3C). Thus, the Mg 2+ signaling cascade acts on agr downregulation via s B activation to increase BRcell subpopulation size. This is consistent with the fact that biofilm-associated S. aureus colonization generally occurs in Mg 2+ -enriched niches such as bone and kidney, in which chronic staphylococcal infections often develop (Günther, 2011;Jahnen-Dechent and Ketteler, 2012;Elin, 2010). By contrast, tissues unintentionally depleted of Mg 2+ are prone to acute staphylococcal infections, as Mg 2+ sequestration from tissues due to tampon use was associated with an outbreak of staphylococcal toxic shock syndrome in women in the USA (Parsonnet et al., 1996;Schlievert, 1985).
We were prompted to analyze the molecular mechanism whereby extracellular Mg 2+ regulates the agr bimodal switch and increases the BRcell subpopulation. Biofilms occur in TSB supplemented with Mg 2+ but not with other cations , which suggested that Mg 2+ is a specific extracellular trigger for BRcell differentiation. Mg 2+ has a function in stabilizing the Gram-positive bacterial cell wall, which is decorated with phosphate-rich teichoic acids (TA) that contribute to membrane integrity (Heptinstall et al., 1970). To alleviate electrostatic repulsive interactions between neighboring phosphates, TA preferentially bind Mg 2+ cations, to form a consolidated network that strengthens cell envelope rigidity (Heckels et al., 1977;Lambert et al., 1975a;Swoboda et al., 2010). We therefore hypothesized that Mg 2+ in TSBMg stabilizes S. aureus TA and increases cell wall rigidity, which cues s B activation. We tested this hypothesis using atomic force microscopy (AFM) to monitor S. aureus cell wall structural rigidity in vivo, comparing single cells grown in TSB and TSBMg media ( Figure 3D

TSB TSBMg
Biofilm formation . Mean surface rigidity was measured using forceindentation curves and Young's modulus. Best fits were produced with a modified Hertz model, assuming conical punch probe geometry. The DdltA mutant serves as positive control, as described (Saar-Dover et al., 2012). In this mutant, D-alanine esterification of TA is absent (Perego et al., 1995). D-alanylation of TA introduces positively charged amines and prevents repulsive interactions between neighboring ribitol phosphates, which increases cell wall rigidity, similar to the effect of Mg 2+ incorporation to the cell wall. Cell wall rigidity was therefore compromised in the Ddlt mutant when grown in TSB medium. (E, F) Quantification of biofilm formation in liquid TSBMg and TSB of S. aureus WT, low-tagB (E) and high-tagB strains (F). All experiments show the mean ±SD for three independent experiments (n = 3). Statistical significance was measured using unpaired Student's t-test for panel (A); for remaining panels, we used one-way ANOVA with Tukey's test for multiple comparisons. *p<0.05, **p<0.01, ***p<0.001; ns, no significant differences. DOI: https://doi.org/10.7554/eLife.28023.007 The following figure supplement is available for figure 3: detects forces acting between a sharp nanoscale cantilever and the bacterial cell wall; after pressure, the cantilever deflects and force can be quantified (Dufrêne, 2014;Formosa-Dague et al., 2016). We detected greater rigidity in cells grown in TSBMg medium than those grown in TSB medium.
The DdltA mutant was used as control, since the DltA-E machinery is responsible for D-alanylation of TA, which introduces positively charged amines and thus prevents repulsive interactions between neighboring TA (Perego et al., 1995), similar to the effect of Mg 2+ incorporation in the cell wall. AFM confirmed that the absence of positive charges reduces cell wall rigidity in the DdltA control in regular TSB, as reported (Saar-Dover et al., 2012). In Mg 2+ -enriched growth conditions, extracellular Mg 2+ binding complemented the cell wall rigidity defect in this mutant, as TA-coordinated Mg 2+ provided cell wall rigidity in the absence of the Dlt machinery. Our AFM measurements showed greater cell wall rigidity in Mg 2+ -enriched growth conditions in the DdltA mutant ( Figure 3D), comparable to the wild type strain. These experiments indicate that extracellular Mg 2+ is incorporated to cell wall TA to increase cell wall rigidity. Staphylococcus aureus cell wall TA are essential for a response to extracellular Mg 2+ , which increases BRcell subpopulation size and thus induces biofilm formation in TSBMg. In these conditions, cells treated with sublethal doses of tunicamycin, which inhibits TarO and thus teichoic acid synthesis at low concentrations (Swoboda et al., 2010;Campbell et al., 2011;Nunomura et al., 2010;Swoboda et al., 2009), did not respond to Mg 2+ and biofilm formation was inhibited ( . Strains with reduced tagB expression did not respond to Mg 2+ and thus did not develop biofilms (low-tagB strain) ( Figure 3E). In contrast, strains with upregulated tagB became hypersensitive to extracellular Mg 2+ and produced more robust biofilms (high-tagB) even with Mg 2+ traces that are present in regular TSB medium ( Figure 3F). We next tested whether the TA-mediated increase in cell wall rigidity downregulates agr bimodal behavior via s B activation.
To study this, we used qRT-PCR analysis to quantify the relative expression of the s B target-gene asp23 and staphyloxanthin quantification to determine s B activation in low-and high-tagB strains ( Figure 3A and Figure 3-figure supplement 1G). The low-tagB strain responded more weakly to extracellular Mg 2+ than the high-tagB strain, with limited s B activation in both TSB and TSBMg conditions. In contrast, the high-tagB strain was hypersensitive to extracellular Mg 2+ , with higher s B activation than the other strains in TSB.
These results are consistent with our hypothesis that extracellular Mg 2+ stabilizes TA, increases cell wall rigidity and triggers the s B inhibitory signal responsible for downregulating the agr bimodal switch. Once the agr switch is activated, variations in the concentration of these types of input signals affect switch activity and modulate the size of the two subpopulations. For instance, Mg 2+ in the colonization niche acts as a downregulatory signal, as it induces s B ; activation of the agr switch becomes more difficult in these conditions and DRcell subpopulation size is reduced ( Figure 4A). However, since this cue neither generates nor abolishes the agr positive feedback loop, but only modulates its activity, its effect would be restricted to varying the BRcell:DRcell ratio.
To substantiate this concept, we used quantitative analysis of fluorescence microscopy images and flow cytometry to monitor S. aureus cell differentiation in the presence of extracellular cues that influence the bimodal switch behavior (AIP excess and s B activation). Purified AIP was added to P psma -yfp or P psmb -yfp reporter strain cultures at various concentrations above threshold concentration of~10 mM usually found in cultures, which caused differentiation of a DRcell subpopulation that increased in parallel with AIP concentration but cell heterogeneity nonetheless remained detectable in cultures ( Figure 4B). When we analyzed downregulation of the bimodal switch, WT cultures in Mg 2+ -enriched growth conditions had a smaller DRcell subpopulation ( Figure 4A), whereas the DsigB mutant in TSB and TSBMg media differentiated a larger DRcell subpopulation than the WT strain ( Figure 4C). Nevertheless, in both cases BRcell and DRcell differentiation was detected in the DsigB mutant. Similarly, the low-and high-tagB strains, which are hypo-and hypersensitive to extracellular Mg 2+ , showed larger and smaller DRcell subpopulations, respectively, in TSBMg ( Figure 4D) although both subpopulations were detected.
According to the information we obtained using the agr orthogonal system and to confirm that the only means by which to lead the system into unimodal gene expression is by disrupting the agr positive feedback loop, we monitored DRcell differentiation in the Dagr strain. In this strain, expression of P psma -yfp or P psmb -yfp labeled reporters was not detected thus cell differentiation was inhibited in both TSB and TSBMg media ( Figure 4E). Results from our orthogonal system pointed that the feedback loop activation mechanism relies on AgrA~P binding to the P2 promoter to turn on positive self-regulation of the agr operon, thus we monitored cell differentiation in a S. aureus strain in which P2 was replaced with a constitutive promoter ( Figure 4F). This strain does not have an active positive feedback loop, as the promoter that activates agr expression is no longer self-inducible. We monitored DRcell differentiation using P psma -yfp or P psmb -yfp reporter strains. In the absence of a functional agr feedback loop, we detected no cell differentiation and reporter expression was homogenous throughout the bacterial population. These results show that the agr positive feedback loop must be active to trigger cell differentiation, and that its activity is regulated by additional input cues that change the ratio of the specialized subpopulations.
BRcells and DRcells organize spatially and are physiologically distinct cell types Given that local Mg 2+ and AIP concentrations modulate agr switch activity, we explored spatial organization of cell types during colony development, as reported for other bacteria (Yarwood et al., 2007). We developed a mathematical model that considers these factors in the context of nutrient availability and bacterial growth, and delineates growth of multicellular aggregates as a non-linear reaction-diffusion equation system ( Figure 5A and , the model predicted that as an aggregate grows and expands, nutrients become limited in the older, central biofilm region, which has higher AIP levels and slow-dividing cells, which increases representation of the DRcell subpopulation. We sectioned mature aggregates into concentric, morphologically distinct regions and analyzed DRcell and BRcell subpopulation size by flow cytometry ( Figure 5B and Figure 5-figure supplement 2A). In accordance with the mathematical predictions, the most peripheral region had a larger proportion of BRcells and a smaller proportion of DRcells. DRcells were enriched in the aggregate center. We combined cryosectioning and confocal microscopy to determine subpopulation size and location within the inner zones of thick biofilms ( Figure 5C and Figure 5-figure supplement 2B). BRcells were highly represented in regions near the aggregate outer edge, where nutrient concentration is high , whereas DRcell representation was more prominent in the biofilm inner region, further from the nutrient source. These experiments showed enrichment of BRcells in newer and of DRcells in older biofilm regions, suggesting that the staphylococcal cells respond differently to local input signal concentrations, and differentiate distinct DRcell:BRcell ratios in different biofilm regions.
To study the potential physiological specialization of BRcell and DRcell types beyond the differential expression of agr-regulated reporters, we determined their transcriptional profiles using Illumina RNA-sequencing after enrichment by fluorescence-activated cell sorting ( Figure 6 and Figure 6figure supplement 1). We grew separate mature aggregates of the strains labeled with the P psmayfp and P ica -yfp reporter fusions to identify the DRcell and BRcell subpopulations, respectively. Fluorescent cells from mature aggregates were sorted from the rest of the cell population; both fluorescent cells (enriched) and whole cell community (non-enriched) were collected simultaneously in separate samples. Genome-wide analysis showed similar genetic landscapes for DRcell and BRcell subpopulations, indicating that cell differentiation is not the result of accumulated mutations (Figure 6-source data 1). RNA was purified from each sample prior to Illumina Hi-seq RNA sequencing. The total number of reads allowed mapping of~96% to the S. aureus genome ( showed marked differences between the enriched subpopulation and its non-enriched counterpart, which suggested that a specific physiological state could be attributed to each particular cell type. BRcells had a large number of upregulated genes, including sigB sigma factor, and of many biofilm-related genes as well as genes related to peptidoglycan turnover, cell division and DNA replication. In addition, 49 tRNAs were upregulated, which indicates the higher metabolic activity of BRcells and their physiological predisposition to proliferation ( Figure 6B and Figure 6-figure supplement 2D). DRcells showed a smaller number of upregulated genes, which we attributed to lower gene expression activity potentially due to the lower physiological activity of this cell type. Among the few upregulated genes detected, we found a notable number related to toxin secretion and host invasion, such as the type-VII secretion system (Burts et al., 2005), as well as genes related to protecting bacterial cells from the immune system, such as the hssRS-htrAB hemin detoxification system (Stauff et al., 2007). We also detected upregulation of multi-drug efflux pumps that confer resistance to diverse antimicrobials, and of regulators such as graR and arsR, which positively control gene-related cell-wall antibiotic resistance and metal ion stress ( Figure 6B and Figure 6-figure supplement 2E). In contrast, the expression of selected housekeeping genes in aggregates growing in TSBMg and TSB showed no differences ( Figure 6-figure supplement 2F), suggesting that extracellular Mg 2+ specifically influences the agr bimodal switch pathway rather than causing a global deregulation of gene expression. These results suggest that the DRcell subpopulation has lower metabolic activity than BRcell and is predisposed to resist different types of antimicrobials.

BR and DR cell fates arise during in vivo infections
An important question arises from the physiological differences detected between BRcells and DRcells in vitro, concerning the role and impact of these cell types during progression of S. aureus infections. We found that extracellular Mg 2+ is an input signal that regulates agr activity and modulates the sizes of specialized cell subpopulations in vitro, and hypothesized that a similar correlation could be found in vivo, that is, that different tissue Mg 2+ concentrations would lead to distinct subpopulation ratios and distinct infection outcomes. To address this question, we developed an infection model  in which mice were intravenously infected with 10 7 colony forming units (CFU) of cells labeled with P ica -yfp (BRcells) or P psma -yfp (DRcells) reporters. Infections were allowed to progress for four days, after which mice were sacrificed and the infected organs collected (Figure 7 and  (Prabhakara et al., 2011). Confocal microscopy analyses showed approximately three-fold more BRcells than DRcells in kidney aggregates ( Figure 7C Figure 7-figure supplement 2), similar to levels detected in in vitro experiments; this was consistent with reports that kidneys are Mg 2+ reservoirs in the body (Günther, 2011;Jahnen-Dechent and Ketteler, 2012), and that 82% of patients with urinary catheterization develop long-term S. aureus infections (Muder et al., 2006).
On the other hand, infected hearts showed a bacterial load of 10 7 CFU/g of tissue (Figure 7-figure supplement 1A), which suggested that S. aureus cells that colonized heart tissues proliferated less actively than those in kidney. Infected hearts had a larger DRcell subpopulation, consistent with the lower metabolic activity, the lower proliferation rate of these cells in vitro and the lower Mg 2+ concentration typically found in heart tissue (Günther, 2011;Jahnen-Dechent and Ketteler, 2012).  Center, spatial distribution of BRcells and DRcells within the aggregate. Bar = 100 mm. Bottom, quantitative estimate of BRcells (ica and spa reporters) and DRcells (Ppsma and Ppsmbreporters) fluorescent area over the total thin section aggregate area in representative images (see Material and methods for quantification details). Statistical significance was measured using one-way ANOVA and Tukey's test for multiple comparisons. *p<0.05, **p<0.01, ***p<0.001; ns, no significant differences. Data shown as mean ±SD of three independent experiments (n = 3). DOI: https://doi.org/10.7554/eLife.28023.010 The following figure supplements are available for figure 5: To further correlate the presence of extracellular Mg 2+ with infection outcome, we performed infection studies using the suite of low-and high-tagB strains ( Figure 8A). Kidneys showed a reduction in bacterial load when infected with the Mg 2+ -hyposensitive low-tagB strain, although this strain colonized heart tissues more efficiently than S. aureus WT. qRT-PCR analyses verified that these differences were associated with upregulation of key genes whose expression is restricted to DRcells (agrA, agrB and psma/b), which suggests that infections with a low-tagB strain had marked representation of DRcells ( Figure 8B-C). In contrast, the Mg 2+ -hypersensitive high-tagB strain was able to infect kidneys more efficiently than the WT strain, concomitant with a reduced infection of heart tissues. qRT-PCR analyses showed higher expression of genes related to BRcells (icaA, icaB and spa), which suggested that the high-tagB strain differentiated a larger subpopulation of BRcells. We generated a new strain derived from the high-tagB strain that also lacks s B . Higher TA content in this strain increases cell wall rigidity in response to Mg 2+ , but the lack of s B should prevent activation of biofilm formation via downregulation of agr. The infection pattern of this DsigB high-tagB strain resembled the low-tagB pattern in all the organs analyzed. Kidneys infected with this strain thus showed a reduction in bacterial load, while heart tissues were colonized more efficiently. qPCR analyses demonstrated higher expression of genes related to DRcells in infected kidneys and heart tissues, pointing to a larger number of DRcells in the infection of these strains. In addition, infected livers, which had a moderate of Mg 2+ concentration (Günther, 2011;Jahnen-Dechent and Ketteler, 2012), also showed comparable bacterial loads between low-tagB, high-tagB and DsigB high-tagB strains.

Discussion
The bimodal behavior of the agr system results in the differentiation of two genetically identical, cell types that specialize in biofilm-or dispersal-associated lifestyles in S. aureus communities. These cell types were detected in in vitro cultures and during in vivo infections. The expression of specific markers by BRcells and DRcells is due to activation of the agr bimodal switch, which requires the production of the activating signal AIP above a certain threshold, similar to other quorum sensing systems, such as the heterogeneous expression of natural competence in cultures of B. subtilis in response ComX signal (Maamar and Dubnau, 2005;Smits et al., 2005) or quorum sensing activation of bioluminescence in a subpopulation of cells in Vibrio harveyi (Anetzberger et al., 2009). A growing number of bimodal switches are being found in QS pathways, and cell differentiation in response to a QS signal is becoming an established concept in microbiology.
The molecular mechanism of agr bimodal behavior is based on a sequential activation of the two adjacent divergent promoters P2 and P3. The P2 promoter triggers positive self-regulation of the agr operon (by activating the agr positive feedback loop) and the P3 promoter induces the agr regulon responsible for activation of virulence genes (P3 promoter activation is necessary for DRcell specialization). The differential affinity of AgrA~P for P2 and P3 promoters is crucial for the sequential promoter activation and thus for agr bimodal switch activation. AgrA~P binds P2 with greater affinity than the P3 promoter. The P2 promoter thus activates and triggers the feedback loop at lower AgrA~P concentrations and only in a given subpopulation (agr-on cells). Activation of this feedback loop produces high AgrA~P levels in this subpopulation, which licenses them to trigger the less-sensitive P3 promoter and induce the agr regulon, leading the agr-on cells to specialize in dispersion and virulence and become DRcells. In contrast, the cell subpopulation that expresses P2 below the    AgrA~P are upregulated, including biofilm-related genes, which licenses them to differentiate as biofilm-producing cells thus to become BRcells. Once the agr bimodal switch is activated and BRcells and DRcells differentiate, subpopulation size is modulated by other extracellular cues that affect bimodal switch activity. We report that extracellular Mg 2+ is incorporated into the bacterial cell wall by binding teichoic acids and increases cell wall rigidity, provoking activation of sigB expression. As s B downregulates the agr bimodal switch, its activation above the threshold becomes more difficult, leading to differentiation of a smaller DRcell and a larger BRcell subpopulation, which in turn facilitates biofilm formation. In contrast, increasing AIP above the threshold concentration facilitates activation of the agr bimodal switch, leading to differentiation of a larger DRcell and a smaller BRcell subpopulation, which in turn facilitates dispersion and acute infection.
The activity of these agr input cues neither generates nor abolishes the agr positive feedback loop; agr bimodal switch activity is only modulated, which regulates the size of the two subpopulations. DRcell and BRcell subpopulations can therefore be detected in the presence of input cues; in our in vitro and in vivo assays, only their ratio differed in the overall bacterial community, thus varying infection outcome in distinct scenarios. In mouse models, we found that in vivo infections developed a larger DRcell subpopulation in tissues with low Mg 2+ levels (cardiac tissue), in which the microbial population became dispersed. In contrast, BRcells were more prevalent in tissues with high Mg 2+ concentrations (bone, kidney) and bacteria organized in microbial aggregates characteristic of biofilm-associated infections. The results recapitulate clinical studies in which a marked number of biofilm-associated persistent infections develop in urinary tract and bone, usually following surgery or catheterization (Muder et al., 2006;Brady et al., 2008;Flores-Mireles et al., 2015;Idelevich et al., 2016). These data help to understand how nosocomial pathogens such as S. aureus can simultaneously cause dissimilar types of infections in distinct organs, and show that cell differentiation in nosocomial pathogens is particularly relevant for adaptation to different host tissues.
The molecular mechanism whereby extracellular Mg 2+ downregulates the agr bimodal switch relies on the capacity of magnesium to bind TA to increase cell wall rigidity (Heptinstall et al., 1970;Hughes et al., 1971), in turn causing agr downregulation via activation of the repressor s B . Staphylococcus aureus cells with reduced cell wall TA adhere poorly, have poor biofilm formation ability (Vergara-Irigaray et al., 2008), and do not colonize nasal (Weidenmaier et al., 2004) or kidney-derived endothelial tissues (Weidenmaier et al., 2005a). An effect similar to that of Mg 2+ incorporation into the cell wall is caused by D-alanine esterification of TA (Lambert et al., 1975a;Lambert et al., 1975b). The Dlt protein machinery decorates TA with D-alanine esters to reduce repulsive interactions between TA negative charges, which also increases cell wall rigidity (Perego et al., 1995). Previous reports showed that Dlt activity is important for biofilm formation in S. aureus (Gross et al., 2001) and for developing biofilm-associated infections in vivo in animal models (Weidenmaier et al., 2005b). Our results are consistent with these findings and suggest that, given the intricacy of agr bimodal switch regulatory control, many extracellular cues probably contribute to the outcome of S. aureus infections. Extracellular Mg 2+ and hence, increased cell wall rigidity are probably important cues for triggering biofilm-associated infections.
Here we show that infections generated by clonal populations of bacteria can bifurcate into distinct, specialized cell types that localize physically in different colonization tissues in the course of an infection. The prevalence of physiologically distinct bacterial cells in different organs could offers bacteria an adaptive strategy that increases their chance of evading the immune system evasion during infection, or provides a bet-hedging strategy that increases the possibility of survival during antimicrobial therapy (Beaumont et al., 2009). Understanding cell differentiation in bacteria is central to designing new anti-infective strategies that target specific cell subpopulations, particularly to pathogens like Staphylococcus aureus, considered endemic in hospitals and which has an approximately 20% mortality rate (Klevens et al., 2007).

Strains, media and culture conditions
A complete list of strains used in this study is shown in Supplementary file 1. The laboratory S. aureus strain RN4220 (Kornblum et al., 1990) was used for cloning purposes. The strain Escherichia coli DH5a was used for propagating plasmids and genetic constructs in laboratory conditions. B. subtilis and E. coli strains were regularly grown in LB medium. When required, selective media were prepared in LB agar using antibiotics at the following final concentrations: ampicillin 100 mg/ml, kanamycin 10 mg/ml, chloramphenicol 5 mg/ml, tetracycline 10 mg/ml, and erythromycin 2 mg/ml. S. aureus strains were routinely propagated in liquid TSB medium incubated with shaking (220 rpm) at 37˚C for 16 hr. When required, selective media were prepared in TSB using antibiotics at the following final concentrations: kanamycin 10 mg/ml, chloramphenicol 10 mg/ml, tetracycline 10 mg/ml, erythromycin 2 mg/ml, neomycin at 75 mg/ml, Spectinomycin at 300 mg/ml and Lincomycin at 25 mg/ ml.
For S. aureus aggregates in TSBMg, 4 ml of an overnight liquid culture was spotted in TSBMg (TSB medium supplemented with MgCl 2 100 mM)  and dried in a sterile culture cabin. Plates were allowed to grow for five days at 37˚C . For S. aureus traditional biofilms in liquid TSBMg and TSB, we followed the protocol proposed by O'Toole and Kolter (O'Toole and Kolter, 1998a). Briefly, an overnight liquid culture was inoculated 1:100 in fresh TSB media and after 6 hr at 37˚C with shaking at 220 rpm, the OD 600 nm was measured and normalized to a final OD 600 0.05. From the normalized cultures, 5 ml was inoculated in 995 ml of TSB or TSBMg in a 24-well microtiter plate (Thermo) (RRID:SCR_008452) and incubated for 24 or 48 hr at 37˚C without shaking. Biofilm formation was measured as follows: media was discarded by aspiration; wells were washed twice with PBS and allowed to dry for 45 min at 65˚C. Then, 500 ml of a solution of Crystal Violet at 0.1% was added and to stain the organic material associated with the well for 5 min. After staining, wells were washed three times with deionized water. For quantitative analyses, Crystal Violet was solubilized using 500 ml of acetic acid at 33%. The solubilized dye was diluted 1:100 in deionized water and transferred to 96-well microtiter plates (Thermo). The absorbance was determined at 595 nm using an InfiniteF200 Pro microtiter plate reader (Tecan). Background was corrected by subtracting the absorbance values of non-bacteria inoculated wells. Specific growth conditions are presented in figure legends.
For the experiments using the synthetic orthogonal agr model generated in B. subtilis wild type and DsigB mutant, cells were incubated in LB medium at 220 rpm at 37˚C until cultures reached an OD 600 nm = 0.5. After incubation, 50 ml of the culture was added to 50 ml of chemically-defined MSgg growing medium (Branda et al., 2001) and allowed to grow for 4 hr at 37˚C at 220 rpm. After incubation, 50 ml of culture was used to inoculate 50 ml of fresh LB and allowed to grow for 12 hr at 37˚C with constant shaking. Addition of AIP to the culture defined the initiation of the experiment (time = 0 hr). Samples were taken at 0 hr, 2 hr, 4 hr, 6 hr, 8 hr, 10 and 12 hr.

Strain generation
To generate the S. aureus strain Newman Dica, Dpsma, Dpsmb and DdltA-E mutants, 500 bp flanking each gene and the respective antibiotic cassettes were PCR amplified and the fragments were subsequently joined together using a long-flanking homology PCR (LFH-PCR). The resulting fragments were cloned into pMAD plasmid (Arnaud et al., 2004) and transformed into the laboratory strain S. aureus RN4220. To transfer the mutations from RN4220 to Newman and to generate the double mutant strains, j11 phage lysates were generated from RN4220 mutants to infect Newman, NewHG and USA300 LAC* (Rudin et al., 1974). Clones resistant to the respective antibiotic were further verified to carry the mutation using PCR. Positive clones were validated to carry the mutation using Sanger sequencing.
To generate the S. aureus strains single-labeled with P ica -yfp, P spa -yfp, P psma -yfp, P psma -mars, P psmb -yfp, P dnaA -yfp and double-labeled with P spa -yfp P ica -mars, P psmb -yfp P psma -mars, P psma -yfp P icamars, P spa -yfp P psma -mars, P ica -yfp P clfA -mars, P ica -yfp P isdA -mars, P spa -yfp P clfA -mars and P spa -yfp P isdA -mars transcriptional fusions, the respective promoter region comprising 200 to 500 bp upstream of the start codon was fused to the yfp reporter-gene using the plasmid pKM003 or to the rfp (mars) reporter-gene using the plasmid pKMmars. These fusions were subcloned into the plasmids pAmy and pLac . The plasmids were integrated into the neutral amy and lac loci of S. aureus chromosome to ensure a uniform and chromosome-equivalent copy number of the reporters in all the cells within the microbial community. The integration of reporters in amy and lac neutral loci occurs in a two-step recombination process, as described in . Briefly, integration of the plasmid into the chromosome of S. aureus occurs via a single recombination event. This first recombination occurs by growing the plasmid-carrying strain overnight at 30˚C, plating serial dilutions onto selective media (erythromycin 2 mg/ml and X-Gal 100 mg/ml) and incubating the plates at 44˚C. This is a temperature-sensitive plasmid, which does not allow plasmid replication at higher temperatures (Arnaud et al., 2004). Therefore, incubation at 44˚C allows only the strains that incorporate the plasmid into the chromosome to grow. The genetic constructs obtained from the first recombination process in the strain RN4220 were transferred to strain Newman by j11 phage transduction (Rudin et al., 1974). Once the constructs were transferred to the recipient strain (Newman and USA300 LAC* strains), we forced a second recombination process to leave only the reporter in the integration locus. To do this, a culture of a light-blue colony was incubated overnight at 30˚C in the absence of erythromycin, plating serial dilutions onto selective (erythromycin and X-Gal) media and then incubating the plates at 44˚C. After 48 hr of incubation at 44˚C, the light-blue colonies still carrying the plasmid in the chromosome were discarded. A four-step process of screening, including fluorescence, antibiotic susceptibility, PCR and Sanger sequencing, was designed to validate whether the white colonies carried the corresponding insertion in the neutral loci. The S. aureus strains tagB-lower (NWMN_0187), tagG-lower (NWMN_1763) and tagH-lower (NWMN_1763) were obtained by phage transduction using as donor strain the respective mutants deposited in the transposon-mapped mutant collection (Bae et al., 2004). Clones were verified using PCR and Sanger sequencing. The S. aureus strain that overexpresses the tagB gene (tagB-higher) (NWMN_0187) or the agrBCDA operon (NWMN_1943 to NWMN_1946) were obtained by cloning the complete ORF into the replicative plasmid pJL74 (Klijn et al., 2006). The sarA P1 promoter and the RBS of sodA guarantee high expression and translation levels in S. aureus.
To construct the agr synthetic orthologous model in B. subtilis DsigB, the two genes agrC and agrA, which are adjacent in the operon agrBDCA, were cloned as a chimeric version agrCA. The gene agrC encodes the histidine kinase and the gene agrA encodes the cognate regulator (Recsei et al., 1986;Boles and Horswill, 2008;Peng et al., 1988). The resultant construct was integrated into the amyE neutral chromosomal locus of B. subtilis DsigB (strain 168). Moreover, the P icayfp, P spa -yfp, P psma -yfp, P psmb -yfp, P RNAII -yfp and P RNAIII -yfp transcriptional fusions were cloned into plasmid pDR183 and integrated into the neutral locus lacA. For transformation via double heterologous recombination, all plasmids were linearized and added to competence-induced liquid cultures of B. subtilis DsigB strain 168 (Hardwood and Cutting, 1990). Resultant colonies were verified that contained the reporter using Sanger sequencing. The synthetic model that recreates the divergent P2 and P3 promoters of S. aureus contains a DNA fragment of the construct of RNAII and RNAIII joined to the cfp and yfp genes divergently transcribed by the P2 (RNAII) and P3 (RNAIII) promoter, respectively. This fragment was cloned into the plasmid pDR183 and integrated into the neutral locus lacA. The integration of the fragment occurs by double heterologous recombination. The plasmids were linearized and added to competence-induced liquid cultures of B. subtilis DsigB strain 168. The resultant colonies were verified to contain the construct using Sanger sequencing.

Staphyloxanthin extraction and quantification
For staphyloxanthin extraction, we used a protocol adapted from Pelz et al. (2005). After 72 hr of growth, cells were harvested, washed once and resuspended in PBS buffer. The cell densities at OD 600 nm were measured and the samples normalized. One ml of cells was centrifuged and the pellet resuspended in 200 ml of methanol and heated at 55˚C for 3 min. Samples were centrifuged to eliminate debris. Then, 200 ml of the supernatant was taken and the methanol extraction repeated. A volume of 180 ml was recovered and added to 820 ml of methanol. Absorption spectra of the methanol extracts were measured using a spectrophotometer at a peak of 465 nm, normalized and reported as relative absorbance to express the total amount of staphyloxanthin pigment.

Atomic force microscopy indentation
Mechanical indentation via atomic force microscopy (AFM) was applied according to previous publications (Dufrêne, 2014;Formosa-Dague et al., 2016). Overnight cultures were diluted into fresh TSB or TSBMg liquid media to a final OD 600 of 0.05. Cells were grown overnight at 37˚C and 220 rpm. One (1) ml of the culture was washed with sterile PBS or PBS supplemented with MgCl 2 final concentration 100 mM (PBSMg), depending on culture conditions and were normalized to a final OD 600 of 0.5 in PBS or PBSMg. Cells were fixed with 4% p-formaldehyde for 6 min and washed twice with 500 ml of PBS. One series of mild sonication was applied to produce a homogenous sample of single cells. Finally, 40 ml of a dilution of 1:5 in deionized water was immobilized on poly-lysine coated microscopy slides. Samples were washed twice with Milli-Q water and allowed to dry. Samples were processed immediately after immobilization, in air and at room temperature, using a CFM conical probe AFM (Nanotec, Spain) with nominal spring constant 3 N/m and resonant frequency 75 kHz. Optical lever calibration and sensitivity was obtained by tapping the probe cantilever onto the glass surface of the slide and measuring the force response to z-piezo extension (z is vertical to the glass surface). For cell indentation, the AFM probe was placed above a cell and repeatedly pressed down onto the surface (and retracted) at 50 nm/s over distances of 100 nm, several times at several positions of the cell surface. Z position and speed of the AFM probe were controlled by a piezoelectric translator. The force response of the cell membrane was measured at three different positions for three individual cells. Young's modulus was obtained by fitting the resulting force-indentation curves for forces <10 nN, resulting in indentations <~20 nm. Best fits were produced with a modified Hertz model assuming a conical punch probe geometry.

Purification of AIP
For purification of AIP1 from S. aureus strain Newman, we used a protocol that is adapted from (MDowell et al., 2001). To obtain an enriched fraction of AIP, a 500 ml culture of each strain was grown for 24 hr in TSB and, after the removal of bacterial cells by centrifugation, the supernatant was filtered through a 0.22 mm membrane filter and mixed 1:1 volumes with binding buffer (2% CH 3 CN and 1% trifluoroacetic acid). The filtered supernatant was loaded into a C18 Sep-Pak cartridge (Waters) previously stabilized with binding buffer. Elution of AIP was achieved with a 60% concentration range of CH 3 CN and subsequently concentrated using a SpeedVac system. Fresh AIP fractions were used in each experiment due to the instability of the preparation.

Extraction and quantification of cell wall peptidoglycan
Peptidoglycan from S. aureus was purified using a protocol adapted from (Bera et al., 2005;Peterson et al., 1978). Cells were grown in 2 L of TSB medium and incubated overnight at 37˚C with vigorous shaking. Bacteria were harvested by centrifugation (5000 Â g, 4˚C, 10 min), washed with cold buffer 1 (20 mM ammonium acetate, pH 4.8) and resuspended in 30 ml of buffer 1. Cell suspension was transferred to a falcon tube, centrifuged and determined the weight of the pellet. Cell pellet was resuspended in 2 ml of buffer and cells were disrupted with a bead beater (Genogrinder, SPEXsamplePrep, USA). After centrifugation, the interphase between glass beads and the foam at the top of the tube was collected and treated with 40 U of DNase, 80 U of RNase and 5 mM of MgSO 4 and were incubated 5 hr at 37˚C. Cell walls were resuspended in 2% SDS in buffer 1 and incubated 1 hr at 65˚C. The material was washed twice with distilled water and resuspended in 30 ml of buffer 1. 5% trichloroacetic acid was added to remove WTA from peptidoglycan and incubated 4 hr at 60˚C. PG was then washed four to six times with cold Milli-Q water, lyophilized, and weighed. Before use, PG was resuspended in PBS buffer and sonicated on ice.
Quantification of peptidoglycan was performed using a protocol adapted from (Nocadello et al., 2016;Zhou et al., 1988). PG pellets were resuspended in 5 ml of cold buffer 1 and diluted 1:50 in a final volume of 2 ml. PG was labeled with Remazol Brilliant Blue (RBB) by incubating the samples with 20 mM RBB in 0.25 M NaOH ON at 37˚C with constant shaking. The labeled samples were neutralized with HCl and pelleted by centrifugation at 14000 rpm for 20 min at room temperature. We performed intense washing using distilled water to eliminate the remaining RBB. After washing, the RBB-PG complexes were diluted 1:50 and the OD 595 nm was determined. OD 595 nm values were normalized to wet weight of each PG-isolated sample.

Stereomicroscopy and fluorescence microscopy
Digital images of the development of S. aureus multicellular aggregates were captured with an Axio-CAm-HR digital camera (Carl Zeiss) using AxioVision AC Release 4.3 software (Carl Zeiss) (RRID: SCR_002677). For fluorescence microscopy, cells from the multicellular communities or from the liquid cultures were washed in PBS and resuspended in 0.5 ml of 4% paraformaldehyde solution and incubated at room temperature for 6 min. After two washing steps with PBS buffer, samples were resuspended in 0.5 ml of PBS buffer and mildly sonicated to guarantee samples of dispersed single cells. Microscopy images were taken on a Leica DMI6000B microscope equipped with a Leica CRT6000 illumination system (Leica). The microscope was equipped with a HCX PL APO oil immersion objective with 100 Â 1.47 magnification and a color camera Leica DFC630FX. Linear image processing was done using Leica Application Suite Advance Fluorescence Software (RRID:SCR_ 013673). The YFP fluorescence signal was detected using an excitation filter 489 nm and an emission filter 508 nm (excitation filter BP 470/40 and suppression filter BP 525/20). The RFP-mars fluorescence signal was detected using an excitation filter 558 nm and an emission filter 582 nm (excitation filter BP 546/12 and suppression filter BP 605/75). Excitation times were 567 and 875 msec, respectively. Transmitted light images were taken with 21 msec of excitation time.
To quantitatively measure cell fluorescence from microscopy images, we adapted an image protocol originally published by McCloy RA et al., using ImageJ64 v1.48s (NIH, USA) (RRID:SCR_ 003070) (McCloy et al., 2014). Briefly, to quantify the number of fluorescent cells and determine their fluorescence level within a microscopy field, the overlapping image of the bright field and fluorescent channels was converted to RGB and inverted it to highlight fluorescent cells. An automatically adjusted threshold generated an image in which only fluorescent cells were represented (image A). Using the same procedure without the inversion step generated an additional image in which only non-fluorescent cells were represented (Image B). The sum between fluorescent and non-fluorescent cells from Images A and B, respectively, represented the total number of cells in the field. Quantification of fluorescence at the single cell level in the microscopy field was determined using the same software using the following commands: from the analyze menu, we selected set measurements, making sure that Area, Min and Max gray values and Mean gray value were selected. Then, we selected analyze particles and set: size in pixel unit from 20 to 200 pixels, circularity from 0.1 to 1.00 and show overlay outlines, making sure that the options display results, summarize and in situ show were selected. It is recommended to run a configuration test to set the analyze particles parameters that correctly cover all cells in the microscopy image. Analysis results were transferred to a Microsoft Excel sheet and to calculate the Total Cell Fluorescent (TCF) as TCF = Area of selected cell X Mean fluorescence. Results were used to generate a histogram that represents the number of particles for each mean fluorescence value. At least three independent images were analyzed for each experiment and the mean values were plotted. In average, each microscopy field comprised 500-765 cells. For analysis of overlapping signals using fluorescence microscopy, we considered signals to overlap when both signals were detected in a 3:1-1:3 range. This is the range in which green and red signals merge to yellow signal in microscopy and thus define green/red fluorescence overlap.
For thin cryosectioning of S. aureus multicellular communities, bright field and fluorescence images were acquired using a TCS SP5 II confocal microscope (Leica). The hardware settings included: Argon laser power at 25% and 496 nm laser intensity at 15%. Bright field images were collected using the PMT-1 Trans scan channel at 512 V with a gain offset of À0.15%. Fluorescent images were collected using the HyD-2 channel with a gain of 10 and an emission bandwidth of 500 nm for excitation and 550 nm for emission (excitation filter BP 470/40 and suppression filter BP 525/ 20). The acquisition mode included a xyz scan mode, with z-stacks in the z-wide mode from 4 to 8 mm. To determine the structural features of the thin sections and localize the fluorescence, a series of horizontal optical sections were collected using a z-step size of 0.3 mm. Width and height format in X and Y was set to 1024 Â 1024 pixels at a scan speed of 200 Hz. Air 1 pinhole was set to automatic detection. A HCX PL APO CS 40.0 Â 1.30 OIL UV objective was used for image acquisition. Digital images were captured using the Leica AF 6000 system software that is provided with the confocal microscope. All parameters were kept identical for the unlabeled control and the different labeled samples. To quantitatively measure fluorescence area from each thin cryosection image, we used ImageJ64 v1.48s and we adapted an image protocol as in (McCloy et al., 2014;Gavet and Pines, 2010;Potapova et al., 2011). Using this software, we quantified the bacterial aggregate area from each image of infected tissue. We quantify the proportion of fluorescent area from the total area occupied by S. aureus cells and referred it in percentage as relative fluorescence signal. We quantified fluorescence of three different thin cryosection samples obtained from three independent multicellular aggregates.
The infected mice organs were aseptically extracted and immersed in a solution 1:1 of PBS and paraformaldehyde 4% and left at 4˚C overnight. 4 mm-thick sections were obtained using a CM 3050 s cryostat set to À20˚C (Leica). These histological sections were placed on SuperFrost plus poly lysine-coated slides (Thermo) and immediately rinsed twice with PBS buffer precooled at 4˚C. Then, fixed-samples where stained with Giemsa staining solution (Sigma) including a dehydration step before the staining and a rehydration step after staining using Xylol and ethanol at 96%, 70% and 50% (Thammavongsa et al., 2009). Slides were immediately mounted with coverslips and processed by confocal microscopy. Histological digital images were obtained using the Diskus software (Hilgers). For fluorescence imaging, a Leica TCS SP5 II confocal microscope equipped with A HCX PL APO CS 100 Â 1.47 OIL objective was used. The hardware settings included: Argon laser power at 25% and 496 nm laser intensity at 10%. Bright field images were collected using the PMT-1 Trans scan channel at 512 V. Fluorescent images were collected using the HyD-2 channel with a gain of 5 and an emission bandwidth of 500 nm for excitation and 550 nm for emission (excitation filter BP 470/40 and suppression filter BP 525/20). The acquisition mode included a xyz scan mode, with z-stacks in the z-wide mode from 4 to 8 mm. To localize fluorescence, a series of horizontal optical sections were collected using a z-step size of 0.2 mm and with an optimized system. Width and height format in X and Y was set to 1024 Â 1024 pixels at a scan speed of 200 Hz. Air one pinhole was set to automatic detection. Digital images were captured using the Leica AF 6000 system software provided with the confocal microscope. All parameters remained constant during the examination of the different labeled samples. To measure fluorescence signal in infected organs, we used ImageJ64 v1.48s and we adapted an image protocol from (McCloy et al., 2014;Gavet and Pines, 2010;Potapova et al., 2011). Using this software, we quantified the bacterial aggregate area that exists in each one of the infected tissue images. From the area that is occupied by S. aureus cells, we used the same software to quantify the proportion of fluorescent area and referred in percentage relative to the total bacterial aggregate area. We quantified fluorescence of three different histological sections obtained from independent organs from three different infected mice.

Flow cytometry
For flow cytometry analysis, cells from the multicellular communities were fixed with a treatment of 4% paraformaldehyde as mentioned above, washed and resuspended in PBS buffer. After fixation, a sonication treatment was required to separate single cells in the sample. In this case, samples were subjected to series of 25 pulses (power output 70% and cycle 0.7 s) and kept on ice. Dilution of samples 1:500 was necessary prior flow cytometry analyses. For YFP fluorescence, a laser excitation of 488 nm coupled with 530/30 and 505LP sequential filter was used. The photomultiplier voltage was set at 777 V.

Fluorescence-activated cell sorting
To obtain samples enriched in BRcells or DRcells, we used single-labeled Staphylococcus aureus multicellular communities between day 4 and 5 of development. These strains were labeled to differentiate cells expressing the extracellular matrix-production reporter (P ica -yfp) or the detachment/ virulence reporter (P psma -yfp). Multicellular communities were scraped from the TSBMg plates and immediately resuspended in RNAlater (Qiagen) in 1.5 ml RNAse-free Eppendorf tubes, in order to fix the cell fluorescence and at the same time preserve the RNA within the cells. Previous reports (Rosenberg et al., 2003) and fluorescence microscopy experiments performed in our laboratory (data not shown) showed that the fixing procedure of these multicellular communities in RNAlater had no effect in the conservation of the fluorescence when compared to cells fixed using 4% paraformaldehyde. Multicellular communities were disrupted in the RNAlater by extensive pipetting, followed by one series of mild sonication as mentioned above, and previously treating the sonicator with RNaseZap RNase Decontamination Solution (Life Technologies) (RRID:SCR_008817). All procedures were performed on ice. After sonication, samples were immediately processed using FACS. Cell fixation and subsequent mild sonication allowed cell separation without affecting cell integrity. For the sorting procedure, 50 ml of the cell suspension was resuspended in 10 ml of filtered and autoclaved PBS buffer prepared in DEPC-treated water. This cell suspension was sonicated, changing cycles from 70% to continuous (100%) and performing 1 round of 20 s. Immediately, cells were FACS-sorted based on their fluorescence intensity in a FACS Aria III (Becton Dickinson) (RRID:SCR_ 008418) using the following parameters: Nozzle size of 70 microns, FITC/Alexa Fluor 488 nm laser, a 530/30 nm filter for data collection and a 502 LP mirror. Flow cytometry parameters were set as: SSC 341 V with a threshold of 500, FSC 308 V with a threshold of 500, FITC 769 V and a variable Flow Rate to guarantee that the number of events per second never exceeded 1500; hence, the Sorting Efficiency never dropped from 97%. These data were analyzed using the BDIS FACS Diva software version 7.0 provided with the FACS Aria III. Sorting was performed in the Precision Mode set to 'Single Cell' in a first round, followed by a second sorting round set to 'Purity'. Using the sorting Precision Mode, we recovered approx. 25 million cells of each subpopulation (fluorescent cells) and their respective non-fluorescent counterparts, based on manually established Target Gates P1 for highly fluorescent cells and P2 for non-fluorescence cells. Once sorted (approximately 5 million cells per 15 ml tube), cells were immediately quick-frozen by immersing the tubes in liquid nitrogen prior to ultra-freezing until sorting was completed.

RNA isolation
For the FACS-sorted bacterial cells, the ultra-frozen samples were thawed using a 37˚C water bath. The volume was poured in a vacuum filter system provided with a 47 mm filter diameter and 0.45 mm pore-size. The equipment was previously sterilized using 75% ethanol in DEPC-treated water, followed by two DEPC-treated water rinses and finally UV light for 180 s and then precooled at À20˚C. Filters containing each of the sorted samples were individually ground using liquid Nitrogen in an RNAse-free, sterile precooled mortar. The powder was carefully scraped out from the mortar and placed in a 2 ml RNAse-free Eppendorf tube and the RNA isolated as described below.
To isolate RNA from S. aureus infected organs, 450 ml of the homogenized organs were incubated for 15 min on ice with 50 ml of RNAlater and 5 ml of Triton X100 briefly vortexing every 5 min to lyse the murine cells. After lysis, RNA was isolated as described below. To isolate RNA from S. aureus infected organs, 450 ml of the homogenized organs were incubated for 15 min on ice with 50 ml of RNAlater and 5 ml of Triton X100 briefly vortexing every 5 min to lyse the murine cells. After lysis, RNA was isolated as described below.
One volume of TE lysis buffer (Tris 20 mM pH 7.5, EDTA 10 mM) prepared in DEPC-prepared water and 25 ml of Lysostaphin (1 mg/ml) were added and taken to a hybridization oven (with rotation), pre-warmed at 37˚C. Samples were incubated for 30 min at 37˚C prior to transferring the whole material to a new tube for mechanical lysis. This was performed using FastPrep Lysing Matrix glass beads in a Fast Prep Shaker (MP Biomedicals) (RRID:SCR_013308) set at 6500 rpm for 50 s. Samples were lysed using 2 cycles of 50 s. The lysate was transferred to a new 2 ml RNAse-free Eppendorf tube and centrifuged for 10 min at 14000 rpm and 4˚C to remove the filter and beads. The supernatant (700 ml) was recovered and used for RNA isolation using the standard hot phenol methodology with some modifications. The sample recovered from was mixed with 60 ml of 10% SDS and incubated at 64˚C for 2 min. 66 ml of sodium acetate 3 M pH 5.2 and 750 ml of phenol Roti-Aqua (Carl Roth) were added and the mixture was incubated at 64˚C for 6 min with mixing every 30 s. The sample was centrifuged for 10 min at 13000 rpm and 4˚C and the upper aqueous layer was transferred to a 2 ml Phase Lock Gel Heavy (PLGH) tube (5Prime). Then, 750 ml of Chloroform was added and the sample was centrifuged for 12 min at 13000 and 15˚C. The aqueous layer was transferred to a new tube and mixed with 2 volumes of a 30:1 ethanol and sodium acetate 3 M pH 6.5 mix. Additionally, 0.5 ml of GlycoBlue co-precipitant (15 mg/ml) (Life Technologies) was added. This mix was left at À20˚C overnight. The following day, the sample was removed from storage at À20˚C, centrifuged for 30 min at 13000 rpm and 4˚C and the pellet was washed with 300 ml of precooled 75% ethanol. After washing, the total RNA was resuspended in 42 ml of RNAse-free water (Qiagen) were added and the sample was incubated at 65˚C at 1000 rpm for 5 min prior storage in ice. To remove any DNA traces, the isolated RNA was treated (one to three times, depending on the sample) with 4 Units of RNase-free DNase I (Thermo), 10 Units of SUPERase In RNase Inhibitor (Life Technologies) and incubated for 45 min at 37˚C. To remove the DNase I, 50 ml of RNAse-free water and 100 ml of Roti-Aqua-P/C/I (Phenol, Chloroform, Isoamyl alcohol 25:24:1 pH 4.5-5) (Carl Roth) were added to the reaction tube, mixed, transferred to a 2 mL PLGH tube and centrifuged for 12 min at 13000 rpm and 15˚C. The sample was mixed with 2.5 volumes of the 30:1 ethanol and sodium acetate with 0.5 ml of GlycoBlueTM, which led to RNA precipitation when stored at À20˚C overnight. On the following day, samples were centrifuged for 30 min at 13000 rpm and 4˚C, washed with 200 ml of 75% ethanol and the pellets were dried and resuspended in 50 ml of DEPCwater. To remove phenol residues, 50 ml of RNAse-free water and 100 ml of Chloroform (Carl Roth) were added to the reaction tube, mixed by inversion for 1 min, transferred to a 2 mL PLGH tube and centrifuged for 12 min at 13000 rpm and 15˚C. The sample was mixed with 2.5 volumes of the 30:1 ethanol and sodium acetate with 0.5 ml of GlycoBlueTM, which led to RNA precipitation when stored at À20˚C overnight. On the following day, samples were centrifuged for 1 hr at 13000 rpm and 4˚C, washed with 200 ml of 75% ethanol and the pellets were dried. This RNA was resuspended in 22 to 44 ml of RNAse-free water and then incubated at 65˚C at 1000 rpm for 5 min. To assess the concentration and purity of the total RNA, OD 260 was measured using a Nanodrop (Thermo) and the OD 260 /OD 280 ratio and the OD 260 /OD 230 ratio determined.

RNA-Seq library construction, sequencing and quantitative-PCR analysis
The cDNA prepared was strictly strand-specific, allowing transcriptome sequencing and expression profiling in both the forward and reverse strands. The combined-length of the flanking sequences was 100 bases. The cDNA is generated and size fractionated by preparative gel electrophoresis or by using the LabChip XT fractionation system from Caliper/PerkinElmer in order to obtain cDNA fractions, optimally suited for the different NGS systems. For this, the RNA samples were poly (A)tailed using a poly(A) polymerase. The 5'-PPP were removed using tobacco acid pyrophosphatase (TAP) followed by the ligation of the RNA adapter to the 5'-monophosphate of the RNA. First-strand cDNA synthesis was performed with an oligo (dT)-adapter primer and the M-MLV reverse transcriptase. The resulting cDNA was PCR-amplified to reach a concentration of 20-30 ng/ml using a high fidelity DNA polymerase. The cDNA was purified using the Agencourt AMPure XP kit (Beckman) (RRID:SCR_008940) and was analyzed by capillary electrophoresis. The primers used for PCR amplification were designed for TruSeq sequencing according to the instructions of Illumina. The following adapter sequences flank the cDNA inserts: TruSeq_Sense: 5'-AATGATACGGCGACCACCGAGATC TACACTCTTTCCCTACACGACGCTCTTCCGAT-T-3' TruSeq-Antisense NNNNNN (NNNNNN = B arcode) 5'-CAAGCAGAAGACGGCAT ACGAGATNNNNNNGTGACTGG-AGTTCAGACGTGTGCTC TTCC-GATC(dT25)À3'.
For quantification of gene expression, total RNA was reverse-transcribed using hexameric random primers followed by quantitative real-time PCR (qRT-PCR) using the SsoAdvanced SYBR Green Supermix (Bio-Rad) (RRID:SCR_013553), following manufacturer's instructions. Primer pairs used are described in the Supplementary file 2. Gene expression was normalized to gyrA/gapA expression and expression fold changes were calculated using the 2 ÀDDCt method. These qRT-PCR experiments were performed following the standard MIQE guidelines for publication of qRT-PCR experiments (Bustin et al., 2009).

Bioinformatics analysis
The pooled sequence reads were de-multiplexed and the adapter sequences were removed. After that, the reads in Fastq format were quality trimmed using fastq_quality_trimmer (from the FastX suite version 0.0.13) (RRID:SCR_005534) with a cut-off Phred score of 20 and converted to Fasta format using Fastq_to_Fasta (also from the FastX suite). The reads were processed, which included poly(A) removal, size filtering (minimum read length of 12 nucleotides after clipping), statistics generation, coverage calculation and normalization, which were performed with the RNA-analysis pipeline READemption version 0.3.3. READemption uses segemehl version 0.1.7 for the read alignment to the reference and DESeq 1.18.0 (Anders and Huber, 2010) (RRID:SCR_000154) for the differential gene expression analysis. The reference genome NC_009641 was taken from the NCBI database for the purpose of alignment and gene-quantification. DESeq calculates statistically significant expression fold change and their log2 values by computing the ratio of normalized read counts of each gene in two libraries. The genes with log2fold value higher than 1.5 and lower than À1.5 were selected as up-and down-regulated gene-sets, respectively. Scatter plots for the visualization of sample correlation were generated using matplotlib 1.4.2. 2. Datasets used for gene ontology for functional classification of genes differentially expressed, hierarchical clustering and the calculation of the hypergeometric probability for genes differentially expressed are presented in Figure 6source data 2 to 4.

Genome-wide analyses to compare BRcells and DRcells
We estimated the difference between the reference genome and the sequences from the libraries (total number of reads in the libraries range from~6-11 million with an average of 100 nucleotides per read). Libraries were analyzed using SAMtools (mpileup command) and variant calling by BCFtools (RRID:SCR_005227). The variants were quantified for the reads mapped to the coding regions of the reference genome using the standard quality score >40 (base call accuracy 99.99%). SAM (Sequence Alignment/Map) tools enables quality checking of reads, and automatic identification of genomic variants (Li et al., 2009b). A high quality score means higher number of sequences showing a particular kind of variation. Quality score is proportional to the number of reads mapped to a gene that account for the variation. The BCFtools were used for the variance calling to identify general variances in each library and compared with each other to determine the existence of library-specific variations (Li, 2011). Using this approach, we detected a minimum of 99.999934% genome similarities at the nucleotide level between distinct cell types.

Statistical analysis
All statistical analyses were performed using the software Prism 6 (version 6.0 f, GraphPad) (RRID: SCR_002798). Graphs represent data from at least three independent experiments with at least three independent technical replicates for experiment. Error bars represent standard deviation (mean ±SD). For the analysis of experiments with two groups, the parametric unpaired two-tailed Student's t-test with Welch's correction was done and, the non-parametric unpaired Mann-Whitney test were done. For the analysis of experiments with three or more groups, the parametric one-way ANOVA test was done. Post hoc analysis included multiple comparisons Tukey's test, Dunnett's test or Dunn's tests, depending on the data set. Differences were considered significant when p value was smaller than 0.05. Statistical significance: ns = not statistically significant, *p<0.05, **p<0.01, ***p<0.001.

Mouse infection studies
All animal studies were approved by the local government of Lower Franconia, Germany (license number 55.2-DMS-2532-2-57 and were performed in strict accordance with the guidelines for animal care and animal experimentation of the German animal protection law and directive 2010/63/EU of the European parliament on the protection of animals used for scientific purposes. Female BALB/c mice (16 to 19 g) were purchased from Charles River (Charles River Laboratories, Erkrath, Germany) (RRID:SCR_003792), housed in polypropylene cages and supplied with food and water ad libitum. The different S. aureus strains used were cultured for 18 hr at 37˚C on BHI medium. Subsequently, cells were collected and washed three times with PBS and diluted to reach an OD 600 nm = 0.05. Viable cell counts were determined by plating dilutions of the inoculum on TSB agar plates. To compare the representation of each cell type of S. aureus in the bacterial communities that colonize the distinct organs, three cohorts of 3 mice for the unlabeled strain and six mice for each labeled strains (P ica -yfp and P psma -yfp) were infected with 150 ml of cultures of S. aureus, containing 1 Â 10 7 cells via tail vein injection. Each strain was used to infect one cohort of mice. Infections were allowed to progress until severe infection signs occurred or to the endpoints of 24 hr, 48 hr, 72 hr and 96 hr after mice challenging. Animals were sacrificed when they met the following criteria: 1) loss of at least 20% of body weight; 2) loss of at least 15% of body weight and ruffled fur; 3) loss of at least 10% of body weight and hunched posture; or 4) 24 hr, 48 hr, 72 hr and 96 hr time points after infection. Infected kidneys and hearts were aseptically harvested and processed for thin sectioning, histology and confocal microscopy, as described above. Organs were also used to calculate bacterial burden calculated as CFU/g of organ, as proposed by Marincola et al. (2012). For this purpose, kidneys and hearts were homogenized in 2 ml of sterile PBS using GentleMACS TM M Tubes (Miltenyi Biotec) (RRID:SCR_008984) and serial dilutions from 10 À2 to 10 À8 of the organ homogenates were immediately plated on TSB plates and incubated at 37˚C for 24 hr, To compare the representation of the S. aureus low-tagB and high-tagB strains colonizing the kidneys, heart and liver, four cohorts of 5 mice each, were infected with 150 ml of cultures of S. aureus and organs were processed as described above. Three days after bacterial challenge all mice were euthanized, organs were aseptically harvested and processed as described above, CFU determined and RNA isolated.

Mathematical modeling of agr bimodal behavior
To study the dynamic processes of the synthetic network, we mathematically described the reactions of the genetic circuitry of the orthologous system. In this circuit, the phosphorylation state is only reached inside the cell after the concentration of AIP is above the threshold. The complex AgrA~P is the transcription factor that upregulates the expression of P2 promoter (also called P RNAII ) responsible for activation of the positive feedback loop. Moreover, AgrA~P upregulates the expression of the rest of the promoters that were used in this work; P3 (Also called P RNAIII ), P psma , P psmb . P ica and P spa promoters are not directly regulated by AgrA~P and were therefore used as negative controls. The reactions that define the former genetic network are the following:

Activation=deactivation :
AgrA P þ P agrA Fast transcription : P a agrA ! k2 P a agrA þ mAgrA (2) Slow transcription : P agrA ! k3 P agrA þ mAgrA (3) Complex formation : AgrA þ P ! k5 AgrA P (5) Fast transcription : P a x ! k8 P a x þ mYFP (8) Slow transcription : P x ! k9 P x þ mYFP (9) Translation : mYFP ! k10 mYFP þ YFP (10) Degradation ðdisappearanceÞ : mAgrA! k11 f (11) Degradation ðdisappearanceÞ : AgrA! k12 f (12) Degradation ðdisappearanceÞ : AgrA P ! k13 f Degradation ðdisappearanceÞ : P! k14 f Degradation ðdisappearanceÞ : mYFP! k15 f Degradation ðdisappearanceÞ : YFP! k16 f where k 1 and k -1 are the binding and unbinding rates of AgrA~P to P2, k 2 is the transcription rate of P2 once AgrA~P binds the promoter, k 3 is the basal transcription rate of P2, k 2 and k 3 produce the mRNA of agrA, k 4 is the translation rate of AgrA protein, k 5 is the phosphorylation rate of AgrA, k 6 is the availability rate of phosphate in the system, k 7 and k -7 are the binding and unbinding rates of AgrA~P to the different promoters (P x ), k 8 is the transcription rate of P x once AgrA~P binds to the promoter (P a x ), k 9 is the basal transcription rate of P x , k 10 is the translation rate of the YFP protein and k 11 to k 16 are the degradation rates of mRNAs and proteins involved in this system. Deterministic modeling using differential equations pointed to a quasi-steady state assumption (Murray, 2002), which we used to identify the elements responsible for the behavior of the system. The resulting equations are: where a 1 = k 3 k -1 k 4 Pt agrA /k 1 k 11 , b 1 = k 2 k 4 Pt agrA /k 11 , g 1 = k -1 /k 1 , d = k 14 /k 5 , a 2 = k 9 k -7 k 10 Pt x /k 7 k 15 , b 2 = k 8 k 10 Pt x /k 15 , g 2 = k -7 /k 7 and Pt i = P i + P a i with i = [agrA, x]. The following values are used to run the Gillespie algorithm of the full model (reactions 1-16). We focused our first set of simulations on the dynamics that affect YFP directly, to further study the behavior of the system when considering variations in AgrA and AgrA~P. The first set of simulations allowed us to find parameters that show a fixed value among all of the experiments independently on the promoter that is under consideration. These parameters are shown here: Consequently, the values of these parameters did not change through the rest of the simulations that aimed to characterize the kinetics of each particular promoter. Initial simulations assumed the high stability of AgrA~P to test the response of the system to saturated levels of AgrA~P. The following simulations assumed unstable AgrA~P. The specific rates to simulate each promoter were defined as follows:

Parameter
Meaning ( The simulations that involved an unstable AgrA~P established values of k 5 = 0.2 Â 10 À4 and k 6 = 5. Using these values, we resolved a 3-mode decision-making model. Further simulations that involved changeable values of k 6 (phosphate availability) revealed that the activation rate of P2 and P3 occurs within a range of 0 and a maximum value of saturation of 40. The values for the rest of the parameters were selected from standard numbers obtained from previously reported studies (Andersen et al., 1998;Balagaddé et al., 2008;Ben-Tabou de-Leon and Davidson, 2009;Dublanche et al., 2006;Goñi-Moreno and Amos, 2012).

Mathematical modeling of multicellular communities development
We used a so-called reaction diffusion system, which not only describes the changes of concentrations and density in time to any type of reaction but also their spread in space. In our case, we used a model with two spatial dimensions. Our system consisted of four equations, describing how the concentrations of nutrients, AIP and the density of replicative and non-replicative bacteria evolved in time. In the following, n x; t ð Þdenotes the nutrient concentration, b x; t ð Þthe density of replicative bacteria, s x; t ð Þthe density of non-replicative bacteria and q x; t ð Þthe concentration of AIP. We assumed that nutrients and AIP underlie diffusion. Diffusion parameters are denoted by d n andd q , respectively. In the case of the replicative bacteria, the diffusion coefficient depends on nutrient concentration and the density of replicative bacteria. It is of the form d b ¼ snbwhere salso contains a stochastic fluctuation of random movement. This form for the diffusion of active bacteria cells was chosen according to the model developed by Kawasaki et al. (1997). We assumed that non-replicative bacteria are not able to diffuse on their own and their diffusion is driven by movement of the replicative cells. The diffusion of non-replicative bacteria depends on the density of replicative bacteria. If there are more replicative bacteria, the non-replicative cells will be pushed in a type of diffusion. This effect is limited. The diffusion coefficient for the non-replicative bacteria is assumed to be of the form: where b s and tare constant. The replicative bacteria proliferate by consuming nutrients. In our system of equations, the consumption rate of the nutrients was given by G 1 f n; b ð Þ and the bacterial growth was described by the term G 2 f n; b ð Þ where G 2 =G 1 was the conversion rate of consumed nutrients to bacterial growth. We assumed f n; b ð Þto be of the form: Here, we chose a Monod growth term (Monod, 1949) to describe the increase in the concentration of replicative bacteria in relation to nutrient consumption. It reproduces the fact that a high nutrient concentration will cause a faster increase in the concentration of replicative bacteria but that these bacteria cannot reproduce infinitely fast. An additional factor accounts for the effect of the quorum sensing signal. If the concentration of active bacteria is already high, a high concentration of AIP slows down the conversion process. We furthermore assumed that there is only a transition from replicative to non-replicative cells. This process is described by a term of the form: This choice is in agreement with (Matsushita et al., 1999). The equation number four described the concentration of AIP. We considered that the diffusion and the increase in the concentration of AIP are related with the concentration of replicative bacteria but we also considered that there is degradation process of AIP. The degradation of AIP is described by q , whereas the production of AIP typically has two levels in a Hill type function (Gustafsson et al., 2004) with Hill coefficient 2 to reflect bistability. This is caused by a positive feedback including nonlinearity in the underlying regulation system. The low production rate of AIP is denoted by p 1 while the increased production rate is denoted byp 2 . The threshold between the low and the increased production is denoted byq thr . For more details see (Müller et al., 2006). With the above-mentioned terms we achieved the following system of equations, which are able to represent the growth dynamics of S. aureus multicellular aggregates: It remains necessary to define the initial and boundary conditions. Since the bacteria grow on an agar plate, we chose no-flux boundary conditions, e.g. qn qx j q ¼ 0; where W denotes the area of the agar plate. The agar has the same concentration of nutrients throughout and therefore we defined the initial condition for the nutrients as constant over the entire domain, e.g. n x; 0 ð Þ ¼ n 0 for x 2 . The replicative bacteria are set on the agar as a drop in the center. At this stage, neither non-replicative bacteria nor AIP exist and thus the initial conditions read b x; 0 ð Þ ¼ b M exp À x 2 þy 2 6:25 with a compact support, s x; 0 ð Þ ¼ 0 and q x; 0 ð Þ ¼ 0. The (non-dimensionalized) parameters chosen for this simulation are given by: a 1 ¼ 2400; a 2 ¼ 120: Our model was able to capture differences in texture on the surfaces of different S. aureus mutants. For the simulation of mutants, we only changed the parameter value, which corresponds to the modified gene and phenotype for the mutant, the other parameter values were maintained from the wild type, as follows: The non-mentioned parameters were maintained at the same value as the wild type strain. In the case of the Dspa mutant, as influencing the biofilm, we modified the biofilm production rate constant G from 7 to 3. The mutants Dpsma and Dpsmb differ from the wild type also by their ability to move on; therefore apart from Galso the parameter s was modified. To obtain the agr mutant not only a simple change in the parameters is needed, but also a combination of different mutant behaviors since the agrsystem influences several components of biofilm production and properties. Especially the ability of the model to produce AIP is lost, expressed by setting p 1 and p 2 to 0.