A single mutation in rapP induces cheating to prevent cheating in Bacillus subtilis by minimizing public good production

Cooperation is beneficial to group behaviors like multicellularity, but is vulnerable to exploitation by cheaters. Here we analyze mechanisms that protect against exploitation of extracellular surfactin in swarms of Bacillus subtilis. Unexpectedly, the reference strain NCIB 3610 displays inherent resistance to surfactin-non-producing cheaters, while a different wild isolate is susceptible. We trace this interstrain difference down to a single amino acid change in the plasmid-borne regulator RapP, which is necessary and sufficient for cheater mitigation. This allele, prevalent in many Bacillus species, optimizes transcription of the surfactin operon to the minimum needed for full cooperation. When combined with a strain lacking rapP, NCIB 3610 acts as a cheater itself—except it does not harm the population at high proportions since it still produces enough surfactin. This strategy of minimal production is thus a doubly advantageous mechanism to limit exploitation of public goods, and is readily evolved from existing regulatory networks.

C ooperative systems, in which some members of a population help others at their own cost, are ubiquitous in nature yet can be vulnerable to exploitation by noncooperative individuals that partake of the benefit without paying the cost. These exploitative cheaters cannot thrive on their own but can invade a community with a negative frequencydependent fitness advantage over the cooperators that is detrimental to the overall population-two of the hallmarks of cheating. Some of the most studied cheating situations are in microbial species since they exhibit many cooperative behaviors, including secreted molecules like siderophores and surfactants, that are often expressed in multicellular contexts like fruiting body formation, swarms, and biofilms 1,2 .
In this study we took advantage of a different cooperative multicellular system: swarming in Bacillus subtilis, which is absolutely dependent on the secreted molecule surfactin 59 . We previously showed that B. subtilis uses an antagonistic kin discrimination system to prevent this public good from being stolen by unrelated strains 13,60,61 , but this system would not protect against spontaneous cheater mutants that arise from within a kin population. Investigating this scenario, we found that different strains have different responses to the presence of a surfactinnon-producing mutant. We traced this intraspecific difference down to a single mutation in a plasmid-borne gene rapP whose protein product regulates major developmental transcriptional cascades. This mutation results in the minimal production of surfactin needed to swarm, thus maintaining the full benefits of cooperation while lowering its cost and exploitability. RapP also effectively turned cells into cheaters, as the minimal-producers had an advantage over the normal-production strains. This strategy represents a novel mechanism to prevent cheating of publically available goods that is straightforwardly evolvable, and may be found more widely in other species.

Results
Surfactin cheating in closely related strains. We first tested whether a non-cooperating B. subtilis mutant exhibited phenotypes typical of cheating. Cheating has been observed in the standard lab strain NCIB 3610's biofilm matrix components 57,62,63 and derived lab strains' quorum-sensing molecules in swarms 45,64 . We wanted to verify this and compare NCIB 3610 to the closely related strain PS-216 (ref. 65 ), as we previously found a number of differences in cooperative genes among B. subtilis strains 61 . PS-216, unlike NCIB 3610 but like most other B. subtilis isolates, is a mucoid strain and thus may have different approaches to production of extracellular substances. To assay for cheating behavior, we combined cells harboring a direct deletion of the public good surfactin (ΔsrfAA) with wild-type cells in varying ratios and spotted the mixtures on swarm-inducing media (Fig. 1a). After spreading across the entire plate, swarms were scraped off the agar, OD 600 readings were taken to determine total cellular yields, and final ratios of wild type: ΔsrfAA were measured by flow cytometry. Initial tests verified that OD 600 readings tracked very closely with the more direct but laborious method of measuring cell numbers by plating and counting colonies ( Supplementary Fig. 1A) and is thus a good indicator of reproductive success of the swarm.
In NCIB 3610, increasing the initial percentage of ΔsrfAA cells caused the total yield of the swarms to decrease (Fig. 1b, black bars), as expected of a cheater harming the population by not producing the public good. However, in PS-216 the number of cells actually increased with added ΔsrfAA, to over two-fold in the 67% ΔsrfAA swarms, then decreased somewhat in the 90% ΔsrfAA swarms (though still higher than wild-type alone) (Fig. 1b, gray bars). This was unexpected, and was accompanied by a change in swarm morphology to more resemble non-mucoid strains like NCIB 3610 (Fig. 1a, bottom right). Also, the improved yields of PS-216 + ΔsrfAA brought it to similar levels as NCIB 3610, which consistently produced denser swarms (Fig. 1c) that expanded at a faster rate ( Supplementary Fig. 1B).
When we measured the relative fitness of the mutant in the swarms, we again found a marked difference between strains. This time PS-216 showed the expected cheater phenotype of a negative frequency-dependent fitness advantage of ΔsrfAA over wild type, with low mutant ratios having a fitness over six and high ratios only around two (Fig. 1d, gray triangles). NCIB 3610, though, did not exhibit much of an advantage, peaking at less than two in the 33% ΔsrfAA swarms (Fig. 1d, black circles). The NCIB 3610 strain must therefore have some previously unknown inherent cheater resistance mechanism that limits the fitness advantage non-producers enjoy in other strain backgrounds.
In summary, the PS-216 swarms were helped by the presence of non-producing mutants, but because those mutant cells had a large fitness advantage they would eventually take over the population, leading to loss of the cooperative trait. NCIB 3610, on the other hand, was more sensitive to the addition of non-producers in terms of total swarm yield, but was guarded against their takeover because they have little or no advantage over wild type. So while neither strain showed both of the typical characteristics of being cheated, we consider NCIB 3610 as being cheater-protected because its cooperative swarming should be more evolutionarily stable than PS-216, which we consider cheating-vulnerable. Surfactin is thus an exploitable public good, unlike the surfactant in P. aeruginosa rhamnolipids that are public but guarded from exploitation through tight regulation 21 and Pseudomonas putida putisolvin that is neither public nor exploitable 66 .
Cheater prevention due to a plasmid-borne allele. To see if the difference between the strains was due to the spatial distribution within swarms, which is known to affect cheater phenotypes 47-58 , we examined fluorescently labeled wild type and mutant strains under a stereomicroscope. In both NCIB 3610 and PS-216 we saw even distribution of wild type and ΔsrfAA cells in all areas of the swarms, similar to the wild-type + wild-type control, despite the uneven abundances of each strain (Supplementary Fig. 2A, B). In contrast, Δhag cells that do not produce flagella and thus cannot swarm on their own did not spread out much beyond the initial inoculum spot ( Supplementary Fig. 2C), indicating the lack of cheating of this private good (flagella). Cheater suppression in NCIB 3610 is thus not due to prevention of ΔsrfAA cells from spreading along with wild-type cells.
We then wondered what the mechanism was behind this inherent cheater mitigation in NCIB 3610, and how come it is missing in PS-216. The genomes of PS-216 and NCIB 3610 are very similar, with only 140 single-nucleotide polymorphisms (SNPs) between them, but three large components are missing in PS-216: the ICEBs1 conjugative element, the SPβ prophage, and the plasmid pBS32 (ref. 67 ). Because previous studies have implicated pBS32 genes in developmental regulation [68][69][70][71][72] , we first tested a strain of NCIB 3610 lacking this plasmid (ΔpBS32) in our cheating assay. The phenotype of NCIB 3610 ΔpBS32 resembled PS-216 much more than its parent strain: the swarm yield increased with added ΔsrfAA cells and the mutant had a clear fitness advantage over the wild-type surfactin producer (Fig. 2a). This suggests the cheater protection phenotype is due to gene(s) on this plasmid. Plasmid pBS32 has 84,215 bp, 35% GC (lower than the~42% typical of B. subtilis, suggestive of horizontal transfer), around two copies per cell, and 102 genes 69,72 . There was, however, one obvious candidate operon to test first: rapPphrP. Rap proteins are regulatory phosphatases that typically remove phosphates from signaling proteins, thus inhibiting them and preventing transcriptional activation of regulons that control things like sporulation, competence, and biofilm formation 73 . Secreted Phr peptides inhibit the cognate Rap in a quorum-dependent fashion, thus allowing expression of the regulons at appropriate cell densities 74 . RapP is unusual is this regard, however, as it does not respond to PhrP inhibition due to a mutation of the conserved asparagine 236 (present in other Rap phosphatases) to threonine 70,71 . RapP therefore acts as a constitutive repressor of its targets Spo0F and ComA that are regulators of many genes necessary for swarming, including surfactin synthesis, and as a result a strain with this allele of rapP has a competitive growth advantage in liquid medium 75 .
We therefore tested the effect of deleting just rapP and keeping the rest of the plasmid intact. The resulting NCIB 3610 ΔrapP strain phenocopied the ΔpBS32 strain in both swarm yield and mutant fitness (Fig. 2a), suggesting rapP is the only gene on the plasmid contributing to cheater protection. To confirm this, we performed rescue experiments by inserting the rapPphrP operon into a chromosomal locus of the plasmidless strain, creating  b Total cellular yield, as determined by OD 600 readings of entire swarms, normalized to the value of wild-type alone (0% mutant). Averages of biological replicates (0% and 100% n = 2, others n = 4) ± standard error of the mean (SEM). The values statistically different from wild-type alone are 67%, 90%, and 100% for NCIB 3610 (P = 0.0024, <0.0001, <0.0001) and all for PS-216 (P = 0.0197, <0.0001, <0.0001, 0.0011, <0.0001). c Mean absolute values of wild-type swarm yields of both strains, in OD 600 units. n = 4, error bars = SEM, P = 0.0200. d Relative fitness of the ΔsrfAA mutant in swarms with wild type as determined by flow cytometry; each point is the mean ± SEM (wild-type alone n = 4, others n = 2), some error bars are not visible because they are smaller than the symbol. The wild-type alone values represent the fitness of mixtures of wild-type strains expressing different fluorescent proteins in varying ratios. All PS-216 values were significantly different from wild-type alone (P < 0.0001) except 90% mutant (P = 0.142), no NCIB 3610 ratios had significant fitness differences NCIB 3610 ΔpBS32 + rapP. Adding back rapP completely mitigated cheating, returning the number of cells and fitness back to wild-type NCIB 3610 levels ( Fig. 2b), consistent with RapP being the cause behind the cheater resistance in this strain. We next wanted to see if rapPphrP was sufficient for cheater prevention in addition to being necessary. We thus inserted the operon into the chromosome of PS-216, which is very similar to NCIB 3610 but does contain SNPs in key regulatory genes like oppD, comP, degQ, and sigH 67 , and has not co-evolved its transcriptional regulons with this unusual Rap. Despite these differences, the PS-216 + rapP strain has an almost identical response to the ΔsrfAA mutant as NCIB 3610: lower cellular yield but resistance to the mutant's fitness advantage (Fig. 2b).
As mentioned, RapP is rare among Rap phosphatases in that its N236T mutation confers constitutive repressive activity; otherwise it would behave like any other Rap, of which there are many in every B. subtilis strain 76 . We therefore tested whether adding back a non-constitutive version of RapP with residue 236 mutated back to the canonical Asn would also mitigate cheating. It did not, as NCIB 3610 ΔpBS32+rapP(T236N) was exploited by the ΔsrfAA mutant just like the strains without any rapP, though it showed much more variability (Fig. 2b). All together, these data indicate that cheating can easily be prevented by a single amino acid change in a single gene.
Cheater resistance via RapP regulation of public good genes. Given this protein's known effect on signaling proteins Spo0F and ComA 70,71 , we looked at the expression levels of some of the major targets of these signaling proteins using nanoString nCounter, a probe hybridization-based assay 77 . We examined the transcript levels of 73 genes chosen to represent a cross-section of B. subtilis regulons (see Supplementary Data 1 for list of genes). Though it is not a complete global analysis, this technique requires much less sample input and so allowed us to analyze transcriptional dynamics in early swarm development when cell counts are not high. When we compared the mRNA abundances of the three strains of interest-NCIB 3610, PS-216, and NCIB 3610 ΔpBS32-we found significant differences in 17 genes (Fig. 3a). These differences were almost entirely attributable to NCIB 3610, however, as PS-216 and NCIB 3610 ΔpBS32 had nearly identical gene expression. If we exclude sunA and rapP that are absent in NCIB 3610 ΔpBS32 and/or PS-216, the eight mostdifferent genes are down-regulated in NCIB 3610, and none of Cheater resistance is lost by removing endogenous plasmid pBS32 or the rapP gene on it. a ΔsrfAA cheating assays as in Fig. 1, with strains of NCIB 3610 either missing the plasmid (ΔpBS32) or with the rapP gene interrupted by a transposon insertion (ΔrapP). Total cell yield of each swarm normalized to the value of wild-type alone (0% mutant); averages of four (0% and 100%) or two replicates (all others). Relative fitness of the ΔsrfAA mutant; each point is the mean ± SEM of independent biological replicates (0% n = 4, others n = 2). All yields were significantly different from wild-type alone (P < 0.0001) except ΔrapP 10% and 90% (P = 0.0388 and 0.0950); for fitness measurements, 10% and 33% mutant were statistically significant in both ΔpBS32 (P < 0.0001 and 0.0009) and ΔrapP (P = 0.0019 and 0.0477). b Cheating assays in which rapPphrP or rapP(T236N)phrP has been inserted into the chromosome of PS-216 or NCIB 3610 ΔpBS32. Statistically significant swarm yields included PS-216 + rapP 90% and 100% (P = 0.0003 and <0.0001), ΔpBS32 + rapP 67%, 90%, and 100% (P = 0.0102, <0.0001, <0.0001), and all ΔpBS32 + rapP(T236N) values (10% P = 0.0006, others P < 0.0001). Neither rapP addback had significant fitness values, but all ΔpBS32 + rapP(T236N) were significant (P < 0.0001 for all but 90% P = 0.0004) the genes induced in NCIB 3610 are more than three-fold higher (Supplementary Data 1). These data support the hypothesis that the phenotypic differences between NCIB 3610 and PS-216 seen in Fig. 1 are largely due to the constitutively repressive activity of RapP on plasmid pBS32. RapP is thought to repress Spo0F and ComA, and has previously been shown to affect expression of the extracellular matrix operon eps, the sporulation gene spoIIG, the srfA surfactin synthetase operon, and a different response regulator rapA 70,71 . Of these, we found srfAA, rapA, and the late-sporulation gene sspB were indeed different between strains (Fig. 3a). However, epsA did not show a significant difference with or without pBS32 in our conditions, nor did tasA, sinR, slrR, abrB, sdpA, and skfB that are in the same Spo0F-Spo0A transcriptional network 78 (Supplementary Data 1). This could indicate a different regulatory architecture in swarms than biofilms, or that RapP preferentially interacts with ComA over Spo0F. Consistent with this, all the genes in our dataset from the ComA regulon 79 were lower in NCIB 3610: pel, degQ, rapC, srfAA, and rapA (Fig. 3a).
To verify these results and examine expression at a single cell level, we measured fluorescent transcriptional reporters of several candidate genes by flow cytometry: srfAA, sspB, epsA, tapA, and the flagellum gene hag (which should be highly expressed in swarming cells but was slightly higher in NCIB   3610 in our nanoString data). The promoter of each was placed in front of the yellow fluorescent protein (yfp) gene, and YFP levels in individual swarming cells were compared to a nonfluorescent control to determine the percentage of the population transcribing the promoter. We observed robust expression from promoters of hag, epsA, and tapA, but no difference between strains (Fig. 3b). Expression from the srfAA promoter was extremely high in PS-216 and NCIB 3610 ΔpBS32, with 68% and 65% of cells fluorescing yellow, but much lower in NCIB 3610, where less than 19% of cells definitively expressed YFP (Fig. 3b). This is similar to previous results in B. subtilis biofilms and sliding populations 80,81 , except that we do not see a separate subpopulation of surfactinproducing cells but rather a slight shift of the entire population ( Supplementary Fig. 3A). Expression from P sspB was also significantly higher in PS-216 and NCIB 3610 ΔpBS32 than NCIB 3610, from 0.356 to 12.9% of cells (Fig. 3b), and all clearly were from a separate subpopulation of sporulating cells ( Supplementary Fig. 3C). Since the profiles of the srfAA reporter seemed unimodal compared to the sspB reporter, we also analyzed the median fluorescence levels of P srfAA -yfp strains ( Supplementary Fig. 3D). The results were much the same, with NCIB 3610 only having 1.80× the level of the negative control while PS-216 and NCIB 3610 ΔpBS32 were 6.16 and 5.43 times as bright.
Because the profiles of NCIB 3610 ΔpBS32 so closely matched PS-216, we tested the transcriptional reporters in the rapPphrP addback strains to see whether RapP was the sole cause of the observed phenotype. As expected, adding rapP to PS-216 and NCIB 3610 ΔpBS32 drastically lowered the expression of P srfAA and P sspB , but had no effect on P epsA (Fig. 3c). As with the cheating assay above, this effect was dependent on the N236T mutation, since the Asn reversion exhibited elevated transcription of these two reporters.
We next wanted to verify that the ultimate output of srfAAsurfactant in the swarm-matched the observed transcriptional differences. We thus performed a droplet collapse assay on swarm supernatants ( Supplementary Fig. 4) to approximate the concentration of surfactin in each strain. The results showed a 7-and 15-fold difference in total surfactant between NCIB 3610 and PS-216 or NCIB 3610 ΔpBS32, and 11-and 19-fold when normalized to the number of cells in each swarm (Table 1). This supports the idea that the two cheater-vulnerable strains produce vastly more of the public good relevant to swarming than the resistant strain, which minimizes production.
To more solidly link surfactin production levels to cheater susceptibility, we examined the two phenotypes in a unicellular condition in which cells are not producing public goods: logarithmic growth in liquid LB, a rich complex medium in which having RapP(N236T) can impart a growth advantage 75 . In this context neither NCIB 3610 nor NCIB 3610 ΔpBS32 expressed srfAA much above background levels (Fig. 4a,  Supplementary Fig. 3B). Concordantly, a ΔsrfAA mutant had no fitness advantage at any starting frequency in either strain (Fig. 4b). This further supports a causal link between levels of surfactin produced and the ability of a non-producer to cheat, and also shows that cheating is multicellularity-specific.
The differences seen in srfAA expression between NCIB 3610 and PS-216 sheds light on their different phenotypes when mixed with ΔsrfAA cells. Since expression is so low in NCIB 3610, adding non-producers drops it below some critical threshold for efficient swarming and the total yield decreases. Conversely, a PS-216 swarm with added ΔsrfAA cells mimics NCIB 3610 in that total surfactin production is lowered, which seems to be more efficient since mixed swarms had up to two-fold higher yield (Fig. 1b). Minimizing public good production is thus a better overall use of resources on top of protecting against cheater invasion. Additionally, we think that the protective effect seen from lowering surfactin production is not due to its role as a signaling molecule 80 , as transcription of its downstream target genes epsA and tapA was not different between strains (Fig. 3b).
Cheater prevention by cheater induction. Because RapP reduces srfAA expression so much, most of the cells in an NCIB 3610 swarm are effectively non-producers-phenotypically ΔsrfAA. We therefore reasoned that NCIB 3610 cells should act as cheaters in the presence of NCIB 3610 ΔpBS32 cells that are paying a high production cost, similar to the growth advantage in liquid LB previously reported 75 . Indeed, the ΔpBS32 strain showed signs of being exploited by wild type in both total swarm yield and negative frequency-dependent fitness disadvantage (Fig. 5a, black bars and circles). This was largely abrogated when wild type was instead mixed with ΔpBS32 + rapP (Fig. 5a, gray bars and triangles), indicating the effects are entirely due to the presence of RapP in wild type. The lowest starting percent of wild type did still show some fitness benefit in this last experiment though, which could be due to copy number differences: one rapPphrP on the chromosome versus 2 copies of pBS32 per cell 72 .
We next tested whether inserting rapPphrP into strains was sufficient to turn them into cheaters. In both the PS-216 and NCIB 3610 ΔpBS32 backgrounds, combining with RapPcontaining strains conferred a fitness advantage and increased cell yields, indicative of cheating (Fig. 5b). The phenotypes were not as dramatic as combinations with either a true ΔsrfAA mutant or the wild-type NCIB 3610, which is likely again due to the lower copy number of chromosomally encoded rapP and that 5.05-12.3% of cells still make surfactin.
There are two obvious differences worth pointing out between the experiments in Fig. 5 and the previous assays: (1) here it is the normal wild-type strain that had a fitness advantage, not an engineered mutant and (2) the swarm yields did not go back to zero with higher amounts of cheaters. This is a crucial point, because while the RapP-containing wild-type cells have an advantage and thus could take over a population of no-RapP cells, they are not pure cheaters because they would not collapse the population. NCIB 3610 is thus a nonobligate variation of a facultative cheater, although unlike regulated facultative cheats 45,64,82,83 , its behavior does not change when in the minority versus majority and so does not become cheatable itself.
Prevalence of rapP and N236 mutations. The clear advantage of strains with RapP(N236T) led us to investigate how prevalent this allele is, as we would expect it to spread through a population in a cheater-like way. We started by searching publically available B. subtilis genomes for homologs of rapP and found 16 hits in 112 unique genomes (14.3%, Table 2), including one on a plasmid that is very similar to pBS32, pLS32 (ref. 69 ). Because genome entries do not always contain plasmid sequences or are not fully assembled, this search could easily have missed many genes. We therefore directly checked for rapP by PCR in 83 wild isolates, many of which were isolated on swarm-or biofilm-inducing media 13 , and this time found 27 rapP homologs (32.5%, Table 2). This higher incidence could be due to the incompleteness of genome sequences or the source of the strains (many sequenced genomes are from industrially relevant strains), or that some of our strains were selected on multicellularity-inducing media. Regardless, the two methods together uncovered 43 homologs out of 195 strains (22.1%, listed in Supplementary Data 2), indicating that rapP is not an uncommon gene. Looking closer at the identified rapP genes, we found that only NCIB 3610 contained the N236T mutation. However, there were seven strains that were either missing residue 236 (resulting from an upstream frameshift or deletion of the region) or had a truncation shortly downstream of 236 (Table 2). These could potentially have the same effect as N236T (PhrP insensitivity), but may also disrupt substrate target binding 84,85 . Moreover, there could be additional residues whose mutation would prevent PhrP binding, as the peptide contacts a number of highly conserved side chains 84,85 , so we cannot rule out other cheaterprotective alleles in these strains.
Because Asn236 is highly conserved not just in RapP but in all other Rap proteins 71 , we expanded our search for potential cheater-resistant N236 mutations using a database of 2921 identified Bacillus Rap homologs 76 . Searching through the alignment of all full-length Rap proteins, we found mutations at the equivalent of position 236 in 194 Raps from 166 different strains (Table 3, Supplementary Data 2). Most of these occurred outside the subtilis group of species: in the 83 closest strains only four of the 881 Raps were mutated. Beyond those immediate species, though, N236 mutations are fairly common or even ubiquitous: of the remaining eight species with more than one representative strain, four have at least one N236 mutation in every single strain, and three more have mutations in at least 49% of strains (Table 3). In the only sequenced B. clausii genome, all six distinct Rap homologs have mutations at this position; this species is an outlier however, as only 28 out of the 166 strains have multiple mutant Raps. In total, almost 44% of all sequenced Bacillus strains contain a potentially cheater-preventing rap allele, and over 57% outside the subtilis clade (Table 3). This is likely an underestimate too, since the data only included full-length Rap proteins (excluding potentially interesting truncations), other mutations could produce this effect, and many of the genome accessions searched may not include plasmid sequences, an important source of Rap diversity via horizontal gene transfer (HGT) 76 .
When we looked at all 194 of the mutated Rap proteins phylogenetically, they segregated according to the two main Bacillus clades, subtilis and cereus, with B. clausii as an outlier group ( Supplementary Fig. 5). Even though it is less numerous, the subtilis clade is more diverse, representing six Rap clusters to cereus' two, as defined by the original study 76 . Of the 141 cereus clade proteins with N236 mutations, all but one are mutated to Thr or Ser (Table 3). This could be reflective of extensive HGT among this group of species, or a lack of diversity among sequenced strains. To this point, all 26 mutant Raps in B. anthracis strains have identical amino acid sequences and only one nucleotide difference (Supplementary Data 2). Among subtilis clade Raps, the most common mutation at position 236 is Asp, which appears to have been independently mutated at least twice and is found in several species (Table 3, Supplementary Fig. 5). While this residue is overall very well conserved (Asn in 93.4% of Raps, one of only eight residues with that level of conservation), it has been repeatedly and independently mutated to many different amino acids (all of which are potentially one base-pair away from the parent Asn codon).
Another way to achieve constitutive Rap activity could be loss of the associated phr gene. These orphan Raps are relatively common, especially in the subtilis clade 76 , though due to crosstalk they can sometimes still be inhibited by other Phr peptides 76,84 . If the N236 mutations we have highlighted here abrogate Phr binding like they do in RapP, then we would expect less selection pressure to maintain the downstream phr gene. Of the 194 Raps with Asn mutations, 62 do not have an associated phr gene (32.0%; Table 3, Supplementary Fig. 5, Supplementary Data 2), which is a significant enrichment over wild-type-236 Raps (712/ 2727, 26.1%; P = 0.0011 by nonparametric two-tailed t-test). It could however be the reverse: after a phr gene is lost there is relaxed selection on the N236 residue, as there is a higher incidence of Asn mutants among orphan than non-orphan Raps (10.2% versus 6.21%, P = 0.0011). Both scenarios result in an over-active repressor, which could target regulators other than Spo0F and ComA. Indeed, some of the mutant Raps are homologous to an allele that did not exhibit activity towards either of these targets in a heterologous system 76 , so while

Discussion
In this study we have shown that different B. subtilis strains have different responses to the presence of a surfactin-non-producing cheater in swarms, which is due to a single mutation in a plasmidborne gene that minimizes production of the public good surfactin. Cells with this plasmid gene therefore act similarly to cheaters and could rapidly spread through a population but, importantly, after they take over the cooperative trait is still maintained and in fact more efficient. This strain is thus an optimized cooperator that acts as a nonobligate cheater similar to facultative cheaters 45,64,82,83,[86][87][88] , though this minimalproduction approach differs in that the cells do not change strategies upon becoming the majority and so do not become vulnerable to cheating themselves. The strategy is further beneficial because it mitigates cheater mutants that spontaneously arise from within the population, which complements the B. subtilis kin discrimination system that protects against newlyencountered populations that might steal public goods 13 . One drawback, though, is that because it is already essentially at the minimum level of surfactin needed to swarm, it has a smaller margin for error and is hurt more by introduced cheaters. The mechanism uncovered here is reminiscent of previously observed cheater control strategies based on prudent production of cheatable goods. However, those strategies, all described in P. aeruginosa and many resulting from experimental evolution rather than naturally occurring mechanisms, are either based on stopping production when it is not needed 16,18 or being willing to reduce the benefit gained from cooperation by down-regulating production when it could be needed 17,[19][20][21] , trading off maximal cooperativity for cheater protection. The B. subtilis system does not make such sacrifices because instead of going below the threshold for maximum cooperative gain, it just avoids overproduction. And since NCIB 3610 swarms just as quickly and  OD 600 readings of total swarm yield, normalized to the value of 0% wild type. Relative fitness of the wild-type strain when mixed with ΔpBS32 with or without rapPphrP added in to the chromosome. The only swarm yields significantly different from 0% wild type were from wild type +ΔpBS32 (all P < 0.0001). The wild type + ΔpBS32 fitness measurements of 10% and 33% were statistically significant (P < 0.0001 and 0.0008), as was the wild type + addback 10% (gray triangle) from both ΔpBS32-alone (P < 0.0001) and from wild type + ΔpBS32 10% (black circle, P = 0.0042). b Cheating assays with PS-216 or NCIB 3610 ΔpBS32 combined with increasing proportion of cells containing rapPphrP inserted into the chromosome (+rapP strain). All swarm yields were statistically significant except ΔpBS32 33% (P = 0.507), as were fitness values of PS-216 10% (P = 0.0080) and ΔpBS32 10% and 33% (P < 0.0001 and 0.0009). All points in figure are averages of at least two biological replicates, error bars represent SEM.
makes full use of surfactin's signaling properties (matrix gene expression is unaffected), it appears that nothing is lost by reducing production. There is a side-effect of less sporulation in this strain (Fig. 3), but it is not known how many spores are optimal and thus whether this could also be avoiding overproduction. Division of labor is thought to be one of the key advantages of multicellularity because it is more efficient than every individual performing all functions independently 89 . While the flow cytometry profiles of surfactin gene expression in swarms do not suggest true division of labor, the levels in NCIB 3610 are so low that much of the population are essentially non-producers that depend on other cells to produce more surfactin for the entire group, creating a pseudo-division of labor. This was mimicked in the high-production PS-216 strain when ΔsrfAA cells were added, artificially forcing population heterogeneity and enhancing swarm output, similar to biofilms that were forced into a genetic division of labor 90 or Salmonella virulence heterogeneity during infection 91 . Optimized public good production is thus beneficial not only for efficient allocation of tasks but also as a means of preventing true cheaters from taking over.
Based on our results, the Rap family of regulators seems to be an easy route to achieve minimal production with a single mutation in their Phr binding site-though it means giving up quorum sensing to do so. Given that subtilis group and cereus group strains average 11 and 6 Raps per genome, respectively 76 , it seems possible for cells to have it both ways: maintain Phr binding in most Raps so regulons can be quorum controlled, but also have one copy mutated to prevent cheater infiltration. We cannot know whether all the mutations we found mitigate cheating because the targets for regulation may differ between species, but the principle of minimal production is translatable to other contexts. Even if the targets are not cheatable goods like surfactin, minimizing the transcription of other key genes could impart interesting behaviors like bet hedging or cell differentiation that may have other meaningful consequences on species' evolution. Alternatively, these mutations could protect against crosstalk from other Phr peptides, which are often found in multiple copies presumably to manipulate other cells' altruistic behaviors 64 . Lastly, we note that because minimized expression via Rap proteins economizes production costs, it might not be purely selected for its effect on sociality.
The virtual absence of N236 mutations in B. subtilis strains is surprising (Table 3), and could be a result of other cheater protection mechanisms at work, such as the diversification of surfactants in the subtilis clade 92,93 (though this diversity was shown to affect biofilms more than swarms 94 ). It may also suggest that NCIB 3610, the supposedly wild strain commonly used in lab studies, is likely at least partially domesticated from its original Marburg ancestor 75 based on a recent genomic analysis that found an amount of gene loss similar to that of lab strains 95 . Nevertheless, our results have still uncovered a molecular mechanism by which cheating can be prevented, even if it did not originate in the wild (although surely not all of the 194 Asn mutants in Table 3 are the result of domestication). If the selection for the RapP-N236T mutation in NCIB 3610 was artificial, it could still have been due to its cheater control benefits, as laboratory growth conditions involve larger populations than natural settings and thus more opportunity for cheaters to arise and more pressure on public goods producers. We know that the plasmid carrying this gene was lost upon further domestication in the derived lab strain 168, along with other public good genes and regulators necessary for biofilm formation 68 . This explains why previous papers were able to demonstrate cheating in a lab   Supplementary Fig. 1B, overnight LB cultures were first spun and washed to remove surfactin in the liquid medium, then 10× more cells than normal (OD 600 = 5) were spotted on B medium at 37˚C in order to initiate spreading sooner. For unicellular conditions in Fig. 4, overnight cultures were diluted to OD 600 = 0.001 in 15 ml of LB and grown to OD 600 = 0.5-1.0, approximating the increase in cell number that occurs on swarm plates while still staying in the logarithmic phase.
Cheating assays. Strains constitutively expressing different fluorescent protein combinations (RFP alone or RFP plus GFP) were combined in varying initial proportions and spotted on swarm-inducing plates as above. After overnight incubation, the entire swarm was scraped off the agar surface, suspended in 1 ml phosphate-buffered saline (PBS; 1.7 mM KH 2 PO 4 , 5 mM Na 2 HPO 4 , 150 mM NaCl), vortexed, passed through a 23-gauge needle 10× to break up clumps, sonicated 15× on ice at 20% amplitude, washed once, and resuspended in 1 ml PBS. Swarm yield was determined by OD 600 readings of this suspension on a spectrophotometer, and normalized to the values of wild type alone to reduce day-to-day variation. Final proportions of each strain were measured by flow cytometry, and relative fitness was determined by the following formula: where f is the final proportion and i the initial proportion. Spatial distributions of strains constitutively expressing RFP or YFP were visualized on a fluorescent stereoscope and analyzed by ImageJ software. All experiments were repeated with the fluorescent combinations swapped to control for any effect of the markers on fitness, and wild type + wild-type controls (0% mutant) at all tested ratios were included in every experiment.
Gene expression analysis. Swarms were grown in triplicate as above, except strains were diluted 100× to OD 600 = 0.005 before spotting on swarming plates in order to capture early-development dynamics, scraped into 400 µl RNAlater solution, vortexed, passed through a needle 10×, incubated for 15 min at room temperature, then sonicated 25× with 1 s pulses at 30% amplitude. After washing once in phosphate-buffered saline, cells were incubated in 200 µl of 15 mg/ml lysozyme in 37.5 mM Tris (pH 7.5) plus 2 mM EDTA for 2 h at room temperature. After adding 400 µl RLT buffer (Qiagen) containing 1:100 β-mercaptoethanol, lysates were diluted ten-fold in RLT for hybridization with probeset. Isolation and quantification of RNA by NanoString nCounter SPRINT was done according to the manufacturer's instructions 77 . Abundances of each mRNA were normalized to housekeeping gene counts, averaged among the three biological replicates, and any strain ratios greater than two-fold and t-test >0.05 were considered significant. See Supplementary Data 1 for full results.
Transcriptional reporter assays. Strains containing constructs with different promoters in front of the yfp gene were spotted on swarming plates at OD 600 = 0.005, except P sspB -yfp strains were spotted at the normal concentration since sporulation occurs later. Swarms were grown overnight at 30˚C, scraped into 0.5 ml PBS, vortexed, passed through a needle 10×, fixed in 4% paraformaldehyde at room temperature for 7 min to maintain the expression level in the swarm, washed in 0.5 ml PBS, resuspended in 0.5 ml GTE (50 mM glucose, 20 mM Tris pH 8.0, 10 mM EDTA), and sonicated 15× on ice at 20% amp. Cells were diluted to~OD 600 = 0.3 and run on an LSR-II flow cytometer using FACS Diva software. Tight forward-and side-scatter gates were used to filter out clumps of cells, and controls of single-fluorophore (cheating assays) or no-fluorophore (reporter assays) were used to identify the different fluorescent populations. Histograms in Supplementary Fig. 3A-C were made in FCS Express 6 software, and the % YFP-positive cells shown in Fig. 3 are the percentage of events that remained after subtracting out the no-fluorescence control histograms. Median YFP levels in Supplementary Fig. 3D were calculated before histogram subtraction and divided by the median value of the no-fluorescence control done on the same day.
Surfactant quantification. Fully-developed swarms from three replicates were scraped off of plates and resuspended in 200 µl PBS, OD 600 readings were taken, then cells were pelleted, and supernatants harvested into new tubes. Supernatants were then serially diluted and 5 µl spotted onto parafilm, allowed to settle for 10 min, photographed, and diameters of spots were correlated to dilutions of purchased surfactin (Sigma) to estimate the total concentration of surfactants in the swarms. To normalize by the number of cells in each swarm, OD 600 readings were converted to CFUs using Supplementary Fig. 1A. Total surfactant in the swarms was statistically different between NCIB 3610 and PS-216 (P = 0.0102) and NCIB 3610 ΔpBS32 (P = 9.76 × 10 −4 ), and between PS-216 and NCIB 3610 ΔpBS32 (P = 0.0178); and surfactant levels normalized to cell counts were significantly different between NCIB 3610 and PS-216 (P = 0.0174) and NCIB 3610 ΔpBS32 (P = 0.00107), but not between PS-216 and NCIB 3610 ΔpBS32 (P = 0.0534) by twotailed t-tests.
Statistical analyses. In cheating assays, two-way analyses of variance were performed on both the normalized OD 600 and relative fitness values, comparing each ratio to wild-type alone within each strain using uncorrected Fisher's LSD test. For comparisons between strains (absolute OD 600 , all gene expression assays, and surfactant quantification), two-tailed t-tests were used without assuming consistent standard deviations. All statistical tests were done in Prism v7.0 software.
rapP PCR and BLAST. Primers specific to the N236 region of rapP (Fwd CCATGAATTATGCTCAGCGAGC, Rev CTTCCTGGTTGTTGTGCCGG; 434 bp) were reacted with genomic DNA from our collection of wild strains to detect and sequence potential homologs, using DNA from NCIB 3610 and NCIB 3610 ΔpBS32 as positive and negative controls in each set of reactions. Because only the interior of the ORF was amplified, we cannot know if the homologs all contain the same phrP immediately downstream. For BLASTn searches, full-length rapP gene (GenBank: CP020103.1, nucleotide positions 29607-30770) was used to query Bacillus subtilis (taxid: 1423) nr/nt and WGS databases, requiring >90% identity over >90% of the gene to be considered a homolog. Lab strains, contaminated genome sequences, and duplicate strains between the two approaches were excluded from final numbers. Homologs were confirmed by clustering in a phylogenetic tree with rapP and not the nearest homolog rapI (Supplementary Fig. 6). All strains examined by PCR and all strains with homologs found by BLAST are listed in Supplementary Data 2.
N236 mutant analysis. The alignment of all Raps taken from ref. 76 was manually scanned for substitutions at the position that aligned to 236 of RapP. These non-asparagine mutant sequences were then isolated and re-aligned for phylogenetic analysis in Mega v6.06. The percentage of strains with a mutant Rap was determined by first subtracting out the number of paralogs from the total number of mutated Raps in each species, then dividing by the number of strains examined. Unnamed species and species with a single representative are not listed in Table 3 for simplicity but were included in the totals. Supplementary Data 2 contains every species, strain, Rap ID number, 236 residue, and amino acid sequence of the identified mutant Raps and the Phr immediately downstream (if any).

Data availability
All datasets generated and analyzed in this study are contained in the article and supplementary information files.