# The evolution of tit-for-tat in bacteria via the type VI secretion system

William P.J. Smith, Maj Brodmann, Daniel Unterweger, Yohan Davit, Laurie

E. Comstock, Marek Basler, Kevin R. Foster

► To cite this version:

William P.J. Smith, Maj Brodmann, Daniel Unterweger, Yohan Davit, Laurie E. Comstock, et al. The evolution of tit-for-tat in bacteria via the type VI secretion system. Nature Communications, 2020, 11 (5395), pp.0. 10.1038/s41467-020-19017-z. hal-03031837

HAL Id: hal-03031837

https://hal.science/hal-03031837

Submitted on 30 Nov 2020

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>
Open Archive Toulouse Archive Ouverte

OATAO is an open access repository that collects the work of Toulouse researchers and makes it freely available over the web where possible

This is a publisher's version published in: https://oatao.univ-toulouse.fr/26952

Official URL:

https://doi.org/10.1038/s41467-020-19017-z

To cite this version:

Smith, William P.J. and Brodmann, Maj and Unterweger, Daniel and Davit, Yohan and Comstock, Laurie E. and Basler, Marek and Foster, Kevin R. *The evolution of tit-for-tat in bacteria via the type VI secretion system*. (2020) Nature Communications, 11 (5395).

<figure><img src="image_2.png" /></figure>
ARTICLE

https://doi.org/10.1038/s41467-020-19017-z

OPEN

<figure><img src="image_3.png" /></figure>

Check for updates

# The evolution of tit-for-tat in bacteria via the type VI secretion system

William P. J. Smith ID 1,2✉, Maj Brodmann ID 3, Daniel Unterweger4,5, Yohan Davit6, Laurie E. Comstock7, Marek Basler ID 3 & Kevin R. Foster ID 1,2✉

Tit-for-tat is a familiar principle from animal behavior: individuals respond in kind to being helped or harmed by others. Remarkably some bacteria appear to display tit-for-tat behavior, but how this evolved is not understood. Here we combine evolutionary game theory with agent-based modelling of bacterial tit-for-tat, whereby cells stab rivals with poisoned needles (the type VI secretion system) after being stabbed themselves. Our modelling shows tit-for-tat retaliation is a surprisingly poor evolutionary strategy, because tit-for-tat cells lack the first-strike advantage of preemptive attackers. However, if cells retaliate strongly and fire back multiple times, we find that reciprocation is highly effective. We test our predictions by competing *Pseudomonas aeruginosa* (a tit-for-tat species) with *Vibrio cholerae* (random-firing), revealing that *P. aeruginosa* does indeed fire multiple times per incoming attack. Our work suggests bacterial competition has led to a particular form of reciprocation, where the principle is that of strong retaliation, or 'tits-for-tat'.

<footnote n="1">¹Department of Zoology, University of Oxford, Oxford OX1 3SZ, UK. ²Department of Biochemistry, University of Oxford, Oxford OX1 3QU, UK. ³Biozentrum, University of Basel, Klingelbergstrasse 50/70, CH-4056 Basel, Switzerland. ⁴Institute for Experimental Medicine, Kiel University, 24105 Kiel, Germany.</footnote>

<footnote n="5">⁵Max-Planck Institute for Evolutionary Biology, 24306 Plön, Germany. ⁶Institut de Mécanique des Fluides de Toulouse, CNRS and Université de Toulouse, 31400 Toulouse, France. ⁷Division of Infectious Diseases, Brigham and Women's Hospital, Boston, MA 02115, USA. ✉email: william.smith@zoo.ox.ac.uk; kevin.foster@zoo.ox.ac.uk</footnote>
The type VI secretion system (T6SS) is a contact-dependent bacterial weapon that is found in numerous bacterial species¹⁻⁴ and used to inject toxic effector proteins into neighboring cells⁵⁻⁷. Structurally and functionally homologous to a phage's tail⁸, the T6SS consists of a membrane-bound baseplate complex, an effector-tipped needle, and a surrounding sheath whose contraction drives the needle through the membranes of target cells⁹,¹⁰. Used by many notorious plant and animal pathogens, the T6SS is a potent anti-competitor weapon: the T6SS can determine whether a strain can invade, or defend, its niche in both environmental and host-associated microbial communities¹¹⁻¹⁶.

There is remarkable variation in the regulation and use of T6SS weaponry across species. Bacteria activate and deploy the T6SS across a range of environmental contexts¹⁶⁻¹⁹ and against both prokaryotic and eukaryotic targets²⁰⁻²². The specific pattern of firing by cells also varies: whereas placement of T6SS assembly appears to be random in some species, such as *Vibrio cholerae*, *Serratia marcescens*, and *Acinetobacter baylyi*²³⁻²⁵, other bacteria are known to fire from specific locations on their cell membranes. Perhaps, the most striking example of this spatiotemporal control is the retaliatory firing strategy observed in *Pseudomonas aeruginosa*, whose T6SS apparatus (encoded at the HSI-1 locus) is specifically activated in cells that are themselves attacked by T6SS needles²⁶,²⁷.

The regulatory pathway underpinning T6SS retaliation in *P. aeruginosa* is an active topic of study. So far, it has been shown that various stimuli can trigger counterattacks in *P. aeruginosa* strain PAO1, including incoming T6SS attacks from multiple bacterial species²³,²⁷,²⁸, conjugative T4SS pili²⁹, and membrane-disrupting antibiotics like polymyxin B²⁹. There is also evidence that retaliation can be toxin-specific—not all T6SS effectors trigger counterattacks, and in *V. cholerae*, only the lipase effector TseL triggers retaliation³⁰. Across stimuli, *P. aeruginosa* appears to be responding to membrane perturbation, and a putative model is that this response is mediated post-transcriptionally via the TagQRST pathway. This signaling cascade leads to the localized phosphorylation of cytoplasmic Fha1 proteins, and subsequent T6SS activation³¹⁻³³.

Although the molecular regulation of retaliatory T6SS firing has received attention²⁷,²⁸,³⁰,³⁴, its evolution has not—leaving open the question of why such a complex strategy has evolved in bacteria, and only in some species. At a broader level, while the evolution of reciprocation has a long history of study in evolutionary biology³⁵⁻³⁸, past efforts have focused largely on the evolution of reciprocal cooperation, rather than competition. Understanding the evolution of T6SS regulation and retaliation is therefore important, both for understanding bacterial warfare and as a distinct case in evolutionary biology.

To address this, we used an agent-based modeling framework to simulate competition between different T6SS strategists. By combining modeling with game theory, we explore the evolution of T6SS regulation, including tit-for-tat (TFT) firing, across a wide range of conditions. This reveals that TFT has significant limitations as a strategy for T6SS warfare. We found that it rarely wins in direct competition because it fails to fire against unarmed strains and always fires second against armed strains. However, we also found that a strong retaliator, which fires multiple times in response to an attack, is a powerful competitor against randomly firing T6SS attackers. Finally, by studying the retaliatory firing patterns of *P. aeruginosa*, we show that it does indeed fire multiple times in response to an incoming attack. Our work suggests that T6SS reciprocation is most beneficial during combat when performed in an aggressive manner.

## Results

**Agent-based modeling of different T6SS firing strategies.** To study the interactions and evolution of different T6SS firing

strategies, we began with an established agent-based modeling framework (CellModeller)³⁹⁻⁴². The heart of this model is a realistic representation of physically interacting bacteria growing in dense communities. Agent-based models of this sort have proved to be a powerful means to explore cell-cell interactions in bacterial communities, generating a wide range of predictions that have been verified by empirical work (reviewed in ref. ⁴³).

We recently reported a new version of this model⁴⁴, designed specifically for the study of T6SS competition, in which cells can intoxicate neighbors by firing T6SS needles. Here, we extend this model, such that different modes of T6SS firing (Supplementary Table 1) can now be represented and compared: cells can be programmed not to fire, or to fire constantly and in random directions, or to fire in more elaborate patterns. Using this tool, one can then compare the effectiveness of T6SS firing strategies observed across different bacterial species, under tightly controlled conditions, while varying physiological parameters (T6SS firing rate $k_{fire}$, carriage cost $c_{upfront}$, pro rata cost $c$, and hit resilience $N_{hits}$). Further details of our model are provided in the "Methods" section.

**Random T6SS firing is effective against unarmed strains.** First, we used our agent-based model to study competition between bacterial strains with two basic strategies: Random-firing T6SS+ attackers (R) and T6SS-susceptible Unarmed cells (U). We simulated community growth within 2-D patch environments, beginning with a randomly scattered, 1:1 mixture of R and U cells. Each patch simulation begins with a finite, uniform resource quota that is consumed as cells grow (exponentially, at rate $k_{grow}$), and simulations end once a patch becomes depleted of resources (Supplementary Fig. 1A). Would-be weapon users therefore face a trade-off: attacking one's competitors prevents them from using up a patch's resources, but at the costs of both reduced reproductive rate and efficiency. Here and throughout, we assume that T6SS+ strategists are immune to the toxins of their clonemates. We also assume that possessing and expressing T6SS genes is costly, such that the specific growth rate of a T6SS+ strain is reduced in proportion to its firing rate. However, we later show that our key conclusions do not rest upon the assumption that the T6SS is costly.

Figure 1a shows two patch simulations in which bacterial strains with R and U strategies compete, carried out for different starting cell densities. In the left example (at low cell density), T6SS-mediated killing marginally increases the final frequency of R strategists; to the right (high cell density), this competitive advantage is greatly enhanced. Strong density dependence is consistent with previous studies of T6SS competition—higher cell density results in increased (and earlier) contact between R and U cells, increasing overall killing⁴⁵. Another benchmark of the model is that we also observe T6SS activity resulting in increased spatial segregation between competing strains (Fig. 1a and Supplementary Movie 2), compared with T6SS— controls (Supplementary Fig. 1A and Supplementary Movie 1), which is consistent with previous theoretical and empirical work⁴⁶.

To further explore the competitive value of Random T6SS firing, we compared R vs. U competition outcomes for a wide range of input parameters: varying initial cell density, T6SS firing rate, weapon cost, lysis rate, and toxin potency. These analyses confirmed that Random T6SS firing can indeed offer a competitive advantage (evidenced by increased R frequency after competition) under a broad set of conditions. As well as being favored by high cell density (Fig. 1b, Supplementary Figs. 2 and 7, and Supplementary Movie 2), which produces greater contact between R and U cells, natural selection for Random T6SS attackers is increased for low weapon costs (Supplementary Figs. 1C, D and 7), high toxin
<figure><img src="image_4.png" /></figure>

<figure><img src="image_5.png" /></figure>

<figure><img src="image_6.png" /></figure>

<figure><img src="image_7.png" /></figure>

<figure><img src="image_8.png" /><figcaption>**Fig. 1** The evolution of random T6SS firing. **a** Simulation snapshots showing initial and final cell configurations for surficial competition between T6SS– Unarmed strain (U, green) and a Random-firing T6SS+ strain (R, blue). Simulations are carried out for both low and high initial cell densities (left and right columns; initial cell populations 10 vs. 10 and 200 vs. 200 cells, respectively); pie charts (left) indicate the consumption of patch resources. Firing rate $k_{\text{fire,R}} = 50$ firings cell$^{-1}$ h$^{-1}$. **b** Competition outcomes, measured by final R cell proportion, as a function of firing rate $k_{\text{fire,R}}$ for increasing initial cell densities (see legend, right). Circles and lines correspond to data points and their means, respectively. **c** Invasion plots showing outcomes of local and global invasion analyses for R vs. U competition (see “Methods”), as a function of firing rate $k_{\text{fire,R}}$ for high initial cell density (200 vs. 200 cells); additional cases are shown in Supplementary Fig. 3. **d, e** Pairwise invasion plots for competing R-type strategists (R1, R2), showing invasion outcomes for local (d) and global (e) competition scales for intermediate cell density (50 vs. 50 cells). Arrows illustrate progression of evolving firing rates $k_{\text{fire,R}}$, converging on evolutionary stable strategy firing rates (ESS, white circles). Simulation parameters used throughout: $N_{\text{hits}} = 2$, $c = 0.001$; $n = 5$ simulation replicates per case in **b, c** and $n = 10$ per case in **d, e**. Source data are provided as a Source Data file.</figcaption></figure>

potency (Supplementary Figs. 1E and 2), and low victim cell lysis duration (Supplementary Fig. 1E). Similarly, we found that reducing weapon costs generally increases the optimal T6SS firing rate (Supplementary Fig. 7).

Our models confirm the intuition that the T6SS can help a bacterial strain to increase its frequency within a patch. But are Random T6SS attackers also expected to invade an Unarmed population when one also considers the competition between different patches to colonize new sites (global competition)? This question is important because while aggression may allow a strain to defeat a competitor, if this comes at a large personal cost, an aggressive strain may still end up producing very few dispersing cells. If other patches contain only passive strategies that make many dispersing cells, therefore, an aggressive strategy could win locally but lose globally by failing to colonize new patches. To

address this question, we embedded our model in a game-theoretic framework that uses the principles of adaptive dynamics⁴⁷. As detailed in the “Methods” section, this approach considers the fate of an initially rare, novel strategist placed in a metapopulation (large set of patches) dominated by another, resident strategist. If the relative fitness of the novel strategist is greater than that of the resident, we assume that its frequency in the metapopulation will increase until it supplants the resident as the common strategy. We then also check whether the resident can itself re-invade a population of the novel strategist from rarity, and when it cannot, we assume that the novel strategy will permanently replace the resident.

Figure 1c shows the fate of an invading Random T6SS attacker (summarized by an invasion index, $I_{\text{inv}}$) as a function of its attack rate, $k_{\text{fire,R}}$, for when there is purely local competition
("local competition") and when there is both local and global competition ("global competition", see "Methods"). For local competition, Random attackers compete only within patches with the resident Unarmed strain. For global competition, they must also compete with Unarmed cells in neighboring patches where Random attackers are absent. In both scenarios, we find that R can successfully invade U for all non-zero firing rates, assuming a high initial cell density (Fig. 1c, 200:200 cells). For lower cell densities, the range of viable $k_{fire,R}$ values narrows, and is generally smaller for global competition than for local competition (Supplementary Fig. 3). In sum, in this system, we find that local and global competition scenarios give qualitatively similar results.

**An evolutionarily stable rate of random T6SS firing.** Our models predict that Random T6SS attackers will readily invade a population of Unarmed cells, under a range of conditions. As Random attackers become more abundant, they will begin to encounter one another, and so we next consider the outcomes of battles between different R-type strategists. When can one Random attacker invade another's patch? Here we studied competition between pairs of R-type strategists, R1 and R2, each having its own attack rate $k_{fire,R1}$, $k_{fire,R2}$, and each being susceptible to the other's toxins. Figure 1d shows a pairwise invasion plot, commonly used in adaptive dynamics<sup>47</sup>, indicating which of R1 and R2 invades the other as a function of their respective attack rates, for local (within-patch) competition. We find that either competitor can invade the other by firing faster than it (Supplementary Movie 3 shows an example of this), but only up to a point. Beyond the yellow diagonal line, having a higher attack rate than one's competitor makes one vulnerable to invasion, since the increased costs of the higher attack rate outweigh any additional benefits conferred<sup>44</sup>. Figure 1e shows a similar pairwise invasion plot, this time computed for the case of global competition.

What firing rate $k_{fire,R}$ is predicted to evolve during competition between Random T6SS attackers? Here, we compute the evolutionarily stable strategy (ESS) as the value of $k_{fire,R}$, denoted $k_{fire,R}^{ESS}$, for which a resident strategist cannot be invaded by mutants with a higher or lower firing rate. In Fig. 1d, the ESS for local R1 vs. R2 competition is shown as a white circle—if a resident strategist (R1) adopts this firing rate, then a mutant strategist (R2) cannot invade irrespective of its firing rate.

Moreover, one can show that any resident population will evolve towards this strategy. For example, suppose we begin with a resident R1, which possesses the T6SS but does not use it ($k_{fire,R1} = 0$, Fig. 1d). Then suppose a mutant R2 appears in this population with $k_{fire,R2} = \delta$, where $\delta > 0$ represents some small increment in firing rate. Since the local invasion index $I_{inv}^{local}(0, \delta) > 1$, R2 can invade R1, and $k_{fire,R1} = \delta$ becomes the resident strategy. The same outcome occurs with $k_{fire,R2} = 2\delta$, $3\delta$ ... such that successive invasions by incrementally more aggressive mutants increase the firing rate in the resident population (Fig. 1d, black arrows), eventually converging on $k_{fire,R}^{ESS,local}$. Similarly, a resident population with a very high firing rate (e.g., $k_{fire,R1} = 250$ firings cell<sup>-1</sup> h<sup>-1</sup>) will be displaced by mutants with lower firing rates (Fig. 1d, yellow arrows), again converging on $k_{fire,R}^{ESS,local}$. Global competition (Fig. 1e) favors a reduced level of aggression than local competition (i.e., $k_{fire,R}^{ESS,local} > k_{fire,R}^{ESS,global}$), a trend also seen for other strategist pairs at various initial densities (Supplementary Fig. 3). This follows one of the core results of social evolution: between-group selection can select against competition, and for cooperation, because global (between-group) competition makes group productivity important for fitness<sup>48,49</sup>.

**TFT retaliation fails to beat a random attacker.** Our results indicate that Random T6SS firing can often be a successful strategy, both enabling invasion of Unarmed populations and achieving higher cell frequencies against other Random T6SS attackers than Unarmed strategists attain. From this baseline, we can evaluate the evolutionary costs and benefits of the more complex T6SS firing strategy of TFT. Based on published empirical work on *P. aeruginosa*<sup>23,27</sup>, we assume that TFT differs from R in two key respects: (i) TFT does not fire its T6SS continuously, but counterattacks once per incoming attack (retaliatory firing); (ii) TFT does not fire from randomly chosen sites on its cell membrane, but instead from the points where incoming attacks struck (spatial sensing). To provide a fair basis for strategy comparison, we assume TFT to be identical to R in all other respects (toxin potency, lysis delay, weapon costs per T6SS firing, costs of weapon carriage).

Figure 2a shows our implementation of a TFT strategist in the agent-based model. To assess conditions favoring TFT strategists, we competed TFT against R for different initial cell densities, as before (Fig. 2b, c, Supplementary Fig. 2, and Supplementary Movie 4). We were surprised to find that, while TFT generally does better against R than U (cf. Figure 1b), R is nevertheless predicted to outcompete TFT in a wide range of conditions. Specifically, we see that R can always evolve to a firing rate $k_{fire,R}$ that makes it equal or better than TFT (Fig. 2d). We also see that it is at the higher initial cell densities that R performs the best against TFT. This effect is telling: increasing initial cell density simultaneously creates more fronts between competing cell groups and increases the time for which competing strains are in physical contact—both of which favor the strain with the best contact-dependent attack (above, Fig. 1a). Overall, our model suggests that R can invade and displace TFT simply by evolving relatively low $k_{fire,R}$ values, for both local and global competition scales (Fig. 2d and Supplementary Figs. 2 and 3), provided cell density is sufficient.

**Retaliation can evolve by investing in attack and defense.** We found that a wide range of conditions preclude the evolution of TFT retaliatory T6SS firing from a population of Random attackers. Trivially, TFT is also guaranteed to lose against U, since the latter never triggers retaliatory T6SS attacks, and is pared the cost of T6SS carriage<sup>24</sup>. How then could TFT have evolved in *P. aeruginosa* if it is predicted to be typically outcompeted by other less sophisticated strategies?

To resolve this apparent paradox, we considered ways in which the TFT strategist might evolve to improve its competitive ability. This revealed that increasing the number of counterattacks launched by retaliators can pay great dividends. Specifically, we found that a strong retaliator strategist—dubbed 2-tits-for-tat (2TFT)—is highly successful against a Random T6SS attacker (Fig. 2e), outcompeting it for all T6SS firing rates and cell densities studied (Fig. 2f and Supplementary Movie 5). Swapping TFT for 2TFT also reversed the trend in competition outcome with respect to initial cell density, with higher cell densities now favoring 2TFT instead of R (Fig. 2f, cf. Fig. 2c). This again illustrates that high cell density tends to intensify contact-dependent warfare, and thereby favor whichever strain has the best contact-dependent attack (Fig. 1a, last section).

Accordingly, we also found that 2TFT is able to invade a population of R cells for all $k_{fire,R} > 0$ (Fig. 2g), and for all cell densities studied (Supplementary Fig. 3). However, this robust competitive advantage disappeared when we reduced the resilience of both strategists ($N_{hits}$ reduced to 1 from 2), such that a single T6SS hit is sufficient to kill any non-clonemate cell (Supplementary Fig. 3): here, 2TFT performs no better than TFT.
<figure><img src="image_9.png" /><figcaption>b</figcaption></figure>

<figure><img src="image_10.png" /><figcaption>c</figcaption></figure>

<figure><img src="image_11.png" /><figcaption>d</figcaption></figure>

<figure><img src="image_12.png" /><figcaption>e</figcaption></figure>

<figure><img src="image_13.png" /><figcaption>f</figcaption></figure>

<figure><img src="image_14.png" /><figcaption>g</figcaption></figure>

<figure><img src="image_15.png" /></figure>

**Fig. 2** 2-Tits-for-tat (2TFT) outperforms tit-for-tat (TFT) vs. a (R)andom firing strategy. **a** Model representation of retaliatory T6SS firing in response to a random attacker (R, blue). Following R's initial attack ($t_1$), the retaliator cell (TFT, yellow) fires T6SS needles outwards from the points on its surface where initial attacks struck ($t_2$, magnified box). **b** Simulation snapshots showing initial and final cell configurations for competitions between R and TFT strategists ("low" and "high" initial cell populations correspond to 10 vs. 10 and 200 vs. 200 cells as in Fig. 1). **c** Competition outcome, measured by final R cell proportion, as a function of firing rate $k_{\text{fire,R}}$ for increasing initial cell densities (see legend, right). Circles and lines correspond to data points and their means, respectively. **d** Invasion plots showing outcomes of local and global invasion analyses for R vs. TFT competition, as a function of firing rate, $k_{\text{fire,R}}$, for high initial cell density (200 vs. 200 cells). **e–g** Analogous to **b–d**, except with TFT replaced by 2TFT, which counterattacks twice per successful oncoming attack. Simulation parameters: $N_{\text{hits}} = 2$, $c = 0.001$. $n = 5$ simulation replicates per case in **c**, **d**, **f**, and **g**. Source data are provided as a Source Data file.

This suggests that sufficient investment in both defense against T6SS intoxication and attack via increased firing is important for the evolution of retaliation.

While 2TFT is very successful in competition with R cells, it is expected to lose against unarmed (U) strains, just like TFT. This

raises the possibility of rock-paper-scissors dynamics, also suggested in a recent study$^{50}$, where non-transitive interactions between competing bacterial species stabilizes variation in T6SS firing patterns$^{51,52}$. Consistent with this possibility, we found that parameter combinations exist (Supplementary Fig. 5) where
unarmed U strains are beaten by random R attackers (T6SS killing trumps growth advantage), who are beaten by 2TFT (superior killing and growth advantage trumps T6SS aggression), and who can be beaten in turn by unarmed strains (growth advantage trumps unused costly T6SS).

We also tested the robustness of 2TFT's supremacy across a range of additional biological scenarios, including low diversity in T6SS toxins in the population (Supplementary Fig. 8), the potential for cheating strategies that do not use the T6SS but which are immune to some T6SS toxins (Supplementary Figs. 9 and 10), and conditions with high within-patch relatedness (Supplementary Figs. 11 and 12). We discuss the effects of these scenarios in detail in the supplement, but across all conditions, 2TFT was predicted to be equivalent or superior to both TFT and R.

**Retaliation brings both geometric and economic benefits.** We next sought to characterize the origin of 2TFT's advantage over R, in contrast to the standard model of T6SS retaliation (TFT). We identified two key advantages offered by retaliatory T6SS firing, and used our models to compare their relative contributions to 2TFT's fitness in competition with R (Fig. 3). First, the ability to sense *where* incoming attacks are coming from allows T6SS counterattacks to be aimed specifically at attackers. By contrast, Random attackers have no information on where target cells are⁹, and so miss most of the time (Fig. 3a). We confirmed this principle by measuring T6SS hit-miss ratios in fixed, well-mixed configurations of cells, showing that attacks by 2TFT cells were significantly more likely to hit R cells than vice versa (Fig. 3b, see “Methods”).

Second, the ability to sense *when* one is being attacked prevents costly use of the T6SS when it is not needed. Examination of cell growth rates during R vs. 2TFT competitions confirmed that only 2TFT cells that are in contact with competitors pay for T6SS firing—compared with R cells, which pay for constant T6SS firing whether or not competitors are actually in range (Fig. 3c). We found that this resulted in significantly higher specific growth rates for 2TFT cells than for R cells (Fig. 3d).

To determine which of these advantages—improved aim or lower cost—drives 2TFT's success in a given scenario, we created three new retaliator phenotypes with one or both advantages removed (Fig. 3e). To remove the advantage of T6SS aiming through spatial sensing, we configured 2TFT cells to counter-attack from randomly chosen sites on their membranes, instead of from the points at which incoming attacks struck (Fig. 3e, bottom row). To remove the advantage of reduced T6SS cost, we configured 2TFT cells to pay the same growth costs as Random T6SS attackers, for any given attack rate $k_{fire,R}$ (Fig. 3e, right column). Comparing the single knockout cases (loss of aiming or loss of cost saving) against a normal R vs. 2TFT competition, we found that removing cost saving still allowed 2TFT to beat R (albeit by a reduced margin) irrespective of weapon cost factor c, including the limit in which weapon use is cost-free (Fig. 3e, top right). By contrast, eliminating only T6SS aiming (Fig. 3e, bottom left) allowed R to beat 2TFT, except where weapon costs were very high. Similar results were seen when cell density was varied instead of weapon costs (Supplementary Fig. 4). In sum, a 2TFT strategist can accrue benefits from both advantages, but it is improved aim that appears most critical to their success.

**Pseudomonas aeruginosa launches multiple counterattacks.**
Our model suggests that the evolution of retaliation via the T6SS rests upon at least three specific characteristics of a retaliating cell: (1) intrinsic resistance to T6SS attack such that a cell can survive more than one hit (Supplementary Fig. 3), (2) the ability to reciprocate with multiple counterattacks (Fig. 2), and (3) the

ability to aim counterattacks towards aggressors (Fig. 3). Predictions 1 and 3 are already supported by published work. An opportunistic pathogen found in a wide variety of environments, *P. aeruginosa* is a notably resilient species with a high natural tolerance to many antibiotics and other toxins⁵³. More specifically, *P. aeruginosa* cells are known to regularly tolerate multiple hits from the T6SSs of other species, including the human pathogen *V. cholerae*²⁷. In addition, the firing behavior of *P. aeruginosa* in response to an incoming hit is visibly non-random, occurring reliably on the same side of the cell as the incoming hit²³. However, prediction 2 has not been examined empirically, offering us an opportunity to test our model against an unknown aspect of T6SS biology.

We therefore analyzed the T6SS counterattacks of *P. aeruginosa* (strain PAO1) cells, in response to random attacks by *V. cholerae* (strain 2740-80) bacteria, as in the original T6SS retaliation study²⁷ and subsequent work²⁹,⁵⁴⁻⁵⁶. In our experiments, both cell types express functional T6SS apparatus, the sheaths of which (TssB subunits in the case of *P. aeruginosa* and VipA subunits in the case of *V. cholerae*) carry fluorescent tags (see “Methods”). These tags allow individual T6SS firing events to be tracked using time-lapse fluorescence microscopy, as described in previous studies²⁵,²⁷,⁵⁷. When the two are grown together on agarose pads, *V. cholerae* antagonizes *P. aeruginosa* and causes it to launch counterattacks (Supplementary Fig. 6 and Supplementary Movie 6), such that T6SS dynamics of the two species can be compared directly in the same setting. By contrast, control experiments using a T6SS—*V. cholerae* mutant resulted in no *P. aeruginosa* T6SS activity, reproducing behavior reported in previous studies²⁷⁻²⁹, and confirming the retaliatory nature of *P. aeruginosa* attacks (Supplementary Movie 7).

Figure 4 shows example kymographs, tracking sheath lengths in individual T6SS apparatus imaged in *P. aeruginosa* cells (Fig. 4a) during these co-culture experiments. We observed that, following an incoming attack, *P. aeruginosa* cells fire repeatedly (between 1 and 6 firings over a 5-min time-lapse, with median 2 firings per site; see Fig. 4b and Supplementary Movie 8). As predicted by our model, therefore, we found that retaliatory firing in *P. aeruginosa* is associated with multiple counterattacks from the same T6SS site. Conversely, we could detect no instances of repeated T6SS firing by *V. cholerae* within the same time window (Fig. 4c), confirming that repeated T6SS firing is not simply a universal trait among γ-Proteobacteria.

## Discussion

We found that random constitutive firing of the T6SS can readily evolve in unarmed populations, provided that (i) weapon costs are not excessive and (ii) initial mixing provides enough inter-strain contact. By contrast, retaliatory firing is successful only against other T6SS users, and then only if the retaliator is robust to incoming attack, gains an aiming advantage, and deals more damage than it sustains (strong retaliation). Ultimately, these additional constraints stem from the first-strike advantage possessed by random attackers: having already been struck by at least one T6SS needle, a retaliator always enters combat at a disadvantage, requiring that retaliation be disproportionate to be generally successful.

The additional constraints limiting retaliator evolution may explain why *P. aeruginosa* is, to our knowledge, the only example of a T6SS retaliator found so far—whereas many species appear to use random T6SS firing²³⁻²⁵. It is also clear that *P. aeruginosa* is very well suited for T6SS retaliation. First, *P. aeruginosa* can resist oncoming T6SS attacks from other species like *V. cholerae*²⁷. Second, *P. aeruginosa*'s ability to aim T6SS firing—through spatially resolved, TagQRST-mediated attack sensing—is likely to be
<figure><img src="image_16.png" /><figcaption>b</figcaption></figure>

<figure><img src="image_17.png" /><figcaption>c</figcaption></figure>

<figure><img src="image_18.png" /><figcaption>d</figcaption></figure>

<figure><img src="image_19.png" /><figcaption>e</figcaption></figure>

<figure><img src="image_20.png" /></figure>

With cost saving

<figure><img src="image_21.png" /></figure>

Without cost saving

<figure><img src="image_22.png" /></figure>

<figure><img src="image_23.png" /></figure>

<figure><img src="image_24.png" /></figure>

**Fig. 3 Aiming and cost saving allow 2TFT to beat random attackers.** a Diagram comparing likelihood of successful T6SS attack for random firing (top) and retaliatory firing (bottom). b Measurements of absolute and non-clonemate cell hit probabilities from static, mixed-cell populations, for random (R, blue) and retaliatory (2TFT, yellow) T6SS firing. Statistical test for absolute hit probability comparison: two-sample, two-sided *t* test, no adjustment for multiple comparisons, *t* = -125.0560, effect size (Cohen's *d*) = 17.676539, *p* = 2.2803e-190. For comparison of non-clonemate cell hit probabilities, we use the same test; here *t* = -160.6783, effect size 22.6885, *p* = 1.0388e-211. In both cases, *n* = 100 firing events taken from same sample, giving 198 degrees of freedom. Whiskers, boxes, and centerlines denote ranges, interquartile ranges, and median values, respectively. c Visual comparison of R and 2TFT cell growth rates during competition. Cell configuration and magnified sections are colored by cell type (left) or by growth rate (right). Magenta arrow highlights a single TFT cell whose growth rate is reduced by active firing; dead cells are outlined in red in the right-hand panel. d Comparison of R and 2TFT cell population average growth rates, measured at the end of five separate R vs. 2TFT competitions (statistical test as in b; *t* = -207.4396, effect size 131.3978, *p* = 3.2643e-16, growth rate from -10,000 cells across five independent simulations, 8 degrees of freedom). Circle markers indicate population means. e Comparison of R vs. 2TFT competition outcomes, in which 2TFT strategists are modified to remove T6SS aiming (bottom row) and/or cost saving (right column), for increasing weapon costs c (see legend, top left). Circles and lines correspond to data points and their means, respectively. In b, d, ***p* < 0.001. Source data are provided as a Source Data file.

a key contributor to its success as a retaliator (Fig. 3e), because it provides cells with additional information on the location of attackers. This contrasts with other forms of T6SS regulation, where the rate of T6SS firing is increased in response to cellular damage18,24,58, but with T6SS placement occurring apparently at

random. By placing T6SS assemblies at attack sites, *P. aeruginosa* can substantially improve its hit efficiency, compared with a random firer that has no information on the location of its target.

Third, our models predict that *P. aeruginosa* cells can only fully exploit this aiming advantage if they also launch multiple
<figure><img src="image_25.png" /><figcaption>**Fig. 4** Repeated T6SS assemblies in *P. aeruginosa*. **a** Mixture of *P. aeruginosa* PAO1 tssB-mNeonGreen (green) with T6SS+ *V. cholerae* 2740-80 vipA-mCherry2 (black), highlighting retaliatory T6SS contractions within *P. aeruginosa* cells. A merge of phase contrast and GFP channels is shown (left). Field of view, 3.3 × 3.3 µm², is shown; scale bars, 1 µm. White arrows mark axes of assembled T6SSs. Kymograms (right) show fluorescence signal along each T6SS axis (2 s pixel⁻¹, GFP channel), indicating up to six T6SS contractions occurring at the same location over a 5-min period (yellow arrows). Vertical axes correspond to direction of T6SS contraction.
**b** Histogram showing numbers of repeated T6SS contractions of *P. aeruginosa* PAO1 tssB-mNeonGreen cells in contact with *V. cholerae* 2740-80 vipA-mCherry2 (average of repeated firings = 1.992, standard deviation of 0.975, median: 2, *n* = 500, two biological replicates).
**c** Kymograms recorded for *V. cholerae* cells, analogous to *a*, showed no repeated T6SS contractions within the 5 min viewing period (cyan arrows). Scale bars, 1 µm. Source data are provided as a Source Data file.</figcaption></figure>

counterattacks from a given site of impact. Otherwise, they still stand to lose more cells per pairwise T6SS battle than their competitors, such that the latter can still win overall if the two strains are sufficiently well mixed. Our experiments confirmed that *P. aeruginosa* does indeed fire repeatedly from T6SS assemblies placed at hit sites, a pattern not observed in random-firing *V. cholerae*. In light of this observation, *P. aeruginosa*'s retaliatory firing appears better characterised as a *tits-for-tat* strategy than a *tit-for-tat* one³⁶.

## Methods

**Agent-based model.** As in previous studies³⁹⁻⁴¹, we model bacterial communities as collections of 3-D rod-shaped cells, growing in independent patch environments on a flat surface (Supplementary Fig. 1A). Every cell is an independent agent whose behavior depends on its phenotype, and on its interactions with neighboring cells. Each model simulation tracks cell growth, movement, and death within a single patch. Patches have an allotted quota (*E*₀) of growth-limiting resources, which cells consume until the patch becomes depleted, thereby ending the simulation. Cell phenotypes, model variables, and model parameters are summarized in Supplementary Tables 1–3, respectively.

**Cell growth and division:** Each cell's volume *V*ᵢ increases exponentially through elongation, from initial volume *V*₀, according to the equation *dV*ᵢ/*dt* = *k*ₐgrow,ᵢ*V*ᵢ, where *k*ₐgrow,ᵢ is a (phenotype-dependent) cell growth rate with maximum *k*ₐmax. For simplicity, we assume that all living cells deplete patch resources *E* at a rate proportional to their current volume, and independent of the resources remaining in the patch (i.e., zeroth-order kinetics): *dE*/*dt* = −*k*ₐmax,Σᵢ*V*ᵢ. Cells divide lengthwise into two identical daughter cells once they reach volume 2*V*₀ + *η*ₐdivision, with *η*ₐdivision a uniform random noise term. Each daughter's axis vector **a**ᵢ is perturbed slightly by a noise term with weight *η*ₐorientations, to represent spatial imperfections in the division process. Following the cell growth phase, the cell configuration is returned to a quasi-stationary mechanical equilibrium using an energy minimization algorithm, described previously³⁹. Briefly, cells whose surfaces overlap are identified using a standard contact finding algorithm⁵⁹. Then, sets of impulse vectors **p** satisfying the equation (Aᵀ*A + α**M**)**p** = −**Ad** are calculated, where **A** is a matrix summarizing cell contact geometry, **M** is a matrix of drag coefficients, **d** is a vector of contact distances, and α is a matrix regularization weighting coefficient. The application of these impulses returns cells to mechanical equilibrium while also minimizing cell displacement.

**T6SS firing and costs:** T6SS+ cells can fire toxin-laden needles of length *L*<sub>needle</sub> outwards from points on their surface. Every timestep *dt*, a focal T6SS+ cell *i* may fire *N*<sub>firings,ᵢ</sub> ≥ 0 times. The number and spatial orientations of firings depend on the phenotype of the focal cell (Supplementary Table 1). If the focal cell is a Random-firing (R-type) strategist, *N*<sub>firings,ᵢ</sub> is drawn from a Poisson distribution with mean *k*<sub>fire</sub>; these needles emanate from randomly chosen points on the focal cell's surface (Supplementary Fig. 1B). For retaliatory TFT-type strategists, needles instead emanate from surface points at which the focal cell was struck; *N*<sub>firings,ᵢ</sub> is then the number hits sustained by the focal cell in a given timestep. Similarly, two-tits-for-tat (2TFT-type) strategists fire back twice for every hit they sustain. To reflect the material and energetic costs of T6SS carriage and use, T6SS+ cells reduce their growth rate to *k*ₐgrow,ᵢ = *k*ₐmax(1 − *c*<sub>Total,ᵢ</sub>), where *c*<sub>Total,ᵢ</sub> = *c*<sub>upfront</sub> + *c*(*N*<sub>firings,ᵢ</sub>/*dt*). Here, *c*<sub>upfront</sub> represents the cost of T6SS gene carriage, while the latter term reflects the pro rata running costs of T6SS firing.

**T6SS hit detection:** To determine whether a given firing event is successful, we run a two-step hit detection algorithm to determine (i) whether that needle intersected any other cell in the population, and if so, (ii) where on the target cell the needle struck (Supplementary Fig. 1B). Both checks involve standard methods in computational geometry⁵⁹: (i) involves computing the shortest distance *d*<sub>min</sub> between the needle and cell line segments; *d*<sub>min</sub> < *R* − *L*<sub>penetration</sub> indicates contact between the needle and the cell, where *R* is the cell radius of the victim, and *L*<sub>penetration</sub> a small tolerance factor. Test (ii) involves checking whether a needle vector passes through the cylindrical midsection of the cell, or through spheres of radius *R* placed at its poles; whichever intercept lies closest to the needle's origin is logged as the entry point (Supplementary Fig. 1B, middle, yellow stars). Here, we show an example of a needle (red arrow) that intercepts only the cell midsection, and a second example (magenta arrow) intercepting both the left polar sphere and the midsection.

**T6SS intoxication:** Any cell struck by a T6SS needle fired from a non-clonemate cell becomes intoxicated (cells of the same genotype are assumed mutually immune). Cells respond to T6SS intoxication with a step-like dose response: once a cell's cumulative translocation count reaches threshold *N*<sub>hits</sub>, that cell begins to lyse. *N*<sub>hits</sub> therefore parameterizes both the potency of a given T6SS effector and the capacity of a victim cell to withstand it. Lysing cells die—and are immediately removed from the simulation—after a delay of 1/*k*<sub>lysis</sub>, where *k*<sub>lysis</sub> is the victim cell lysis rate. Lysing cells do not grow or consume patch resources.
**Model parameterization.** The parameters of our model (21 in total) are summarized in Supplementary Table 3. Numerical and mechanical parameters controlling cell mechanical interactions and movement were taken from previous publications<sup>27,39,40</sup>. Where possible, parameters governing T6SS firing and response were estimated directly from previous experimental observations of T6SS competition<sup>25,44</sup>. We used a lower bound of $N_{hits} = 1$ based on a previous study<sup>44</sup>. However, based on the observation that *P. aeruginosa* seems to withstand multiple T6SS hits before being killed<sup>27</sup>, we also considered larger values ($N_{hits} = 2, 3$, and $\infty$ in cases where target cells possess immunity to oncoming T6SS attacks). Throughout the study, we used the parameter values $c = 0.001$, $c_{upfront} = 0.05$; we chose these values because they made the optimal firing rate in R vs. U competitions roughly consistent with the firing rates observed in random-firing bacteria like *V. cholerae* and *A. baylyi* (~50–100 firings cell<sup>-1</sup> h<sup>-1</sup>)<sup>27,44</sup>. Since it was not possible to glean cost parameter values directly from experiments, we instead performed broad parameter sweeps to test the effects of different costs.

**Game theory.** As in previous studies<sup>49,60</sup>, we use the logic of game theory and adaptive dynamics<sup>47</sup> to determine whether a focal strategy (U, R, TFT, or 2TFT) could evolve from a given bacterial metapopulation, subject to different scales of competition. This method uses short-term competition outcomes to infer the evolutionary fate of a rare, novel strategy in a metapopulation where a different “resident” strategy predominates. If the novel strategist can reproduce faster than the resident strategist even when rare, its frequency in the metapopulation will increase, until eventually it supplants the resident. For example, to test whether an R strategist can invade a population of U strategists, we compare their effective fitnesses where one is rare, and the other common. For R to invade U, we require

$$W_{\text{rel}}(\text{rare R|common U}) > 1, \quad W_{\text{rel}}(\text{common R|rare U}) \ge 1, \quad (1)$$

where $W_{rel}(X|Y)$ is the relative fitness of X against Y. The first inequality specifies that R can invade U from rarity; the second checks that R is resistant to re-invasion by U once R becomes common. The definition of relative fitness $W_{rel}$ depends upon the spatial scale of competition within the metapopulation. If competition is localized, then R competes primarily with nearby residents. Here, invasion is predicted simply from the ratio of strategists' fitnesses within a spatial patch: R invades U provided that

$$\frac{\omega_R(\mathbf{R}|\mathbf{U})}{\omega_U(\mathbf{R}|\mathbf{U})} > 1, \quad (2)$$

where $\omega_X(X|Y)$ is the fitness of strategist X in competition with strategist Y, with $\omega_X$ defined as $\omega_X = \log_c(\Sigma X_v(t_{end})/\Sigma X_v(t_{start}))$. Alternatively, competition may occur on much greater spatial scales, such that R must also compete with U strategists in other patches in the metapopulation. Assuming that R is initially rare, its encounters will predominantly be with resident strategists, so its effective fitness is its reproductive capacity when in competition with U. Meanwhile, residents will encounter the novel strategy only rarely, and so will have an effective fitness based on reproduction when in competition with other residents. For R to invade U under these conditions, we require

$$\frac{\omega_R(\mathbf{R}|\mathbf{U})}{\omega_U(\mathbf{U}|\mathbf{U})} > 1, \quad \frac{\omega_R(\mathbf{R}|\mathbf{R})}{\omega_U(\mathbf{R}|\mathbf{U})} \ge 1. \quad (3)$$

We refer to these two sets of inequalities as local and global invasion constraints, respectively. To create the 1-D invasion plots shown in Fig. 1c, we computed mean values of $\omega_R(\mathbf{R}|\mathbf{R})$, $\omega_U(\mathbf{U}|\mathbf{U})$, $\omega_R(\mathbf{R}|\mathbf{U})$, and $\omega_U(\mathbf{R}|\mathbf{U})$ for the R-strategist firing rates $k_{fire}$ shown in Fig. 1b, linearly interpolating one additional value between each pair of adjacent data points. We then classified each firing rate according to which of the local and global invasion constraints held true. We used the same methodology for other pairs of strategists (replacing U with TFT, 2TFT or a second R strategist; cf. Supplementary Fig. 3). For global invasion analyses of R1 vs. R2 competition (Fig. 1e), we have the special case that the two global invasion constraints are equivalent (i.e., R1 invading R2 precludes R2 invading R1). Here, both strategists are characterized by their own independent firing rates $k_{fire,R1}, k_{fire,R2}$, and so invasion outcome is summarized by the 2-D color map,

$$I_{\text{inv}}^{\text{global}}(k_{\text{fire,R1}}, k_{\text{fire,R2}}) = \omega_{\text{R2}}(\text{R2}|\text{R1})/\omega_{\text{R1}}(\text{R1}|\text{R1}). \quad (4)$$

The corresponding invasion index for local competition scales (Fig. 1d) is

$$I_{\text{inv}}^{\text{local}}(k_{\text{fire,R1}}, k_{\text{fire,R2}}) = \omega_{\text{R2}}(\text{R2}|\text{R1})/\omega_{\text{R1}}(\text{R2}|\text{R1}). \quad (5)$$

**Incorporating mutual immunity.** To test the effects of allowing for mutual immunity between T6SS+ strains, we re-ran competition simulations as before, except with T6SS attacks having no effect on T6SS+ target cells. We then expanded our definition of a strategist's fitness, $\omega_X$, to be a weighted sum of its fitness against a competitor with $(Y')$ or without $(Y)$ mutual immunity, $\omega_X(Y) = p_s \omega_X(X|Y') + (1-p_s) \omega_X(X|Y)$. Note that we assume that T6SS carriage is a prerequisite for immunity, so unarmed (U) strategists are never immune and always have $p_s = 0$.

We then used this updated definition to recompute global invasion indices, now as a function both of firing rate $k_{fire,R}$ and of the weighting parameter $p_s$. The

updated invasion indices are as follows: for R vs. U, we have

$$I_{\text{inv},1}^{\text{global}}(k_{\text{fire,R}}) = \frac{\omega_R(\mathbf{R}|\mathbf{U})}{\omega_U(\mathbf{U}|\mathbf{U})} > 1, \quad (6)$$

$$I_{\text{inv},2}^{\text{global}}(k_{\text{fire,R}}, p_s) = \frac{\omega_U(\mathbf{R}|\mathbf{U})}{p_s \omega_R(\mathbf{R}|\mathbf{R}') + (1-p_s) \omega_R(\mathbf{R}|\mathbf{R})} \le 1, \quad (7)$$

and for R vs. Y = TFT or 2TFT, we have

$$I_{\text{inv},1}^{\text{global}}(k_{\text{fire,R}}, p_s) = \frac{p_s \omega_R(\mathbf{R}|\mathbf{Y}') + (1-p_s) \omega_R(\mathbf{R}|\mathbf{Y})}{\omega_Y(\mathbf{Y}|\mathbf{Y})} > 1, \quad (8)$$

$$I_{\text{inv},2}^{\text{global}}(k_{\text{fire,R}}, p_s) = \frac{p_s \omega_Y(\mathbf{R}|\mathbf{Y}') + (1-p_s) \omega_Y(\mathbf{R}|\mathbf{Y})}{p_s \omega_R(\mathbf{R}|\mathbf{R}') + (1-p_s) \omega_R(\mathbf{R}|\mathbf{R})} \le 1. \quad (9)$$

We interpreted invasion indices as previously: for each strategist pairing, the inequalities $I_{\text{inv},2}^{\text{global}} > 1$ and $I_{\text{inv},2}^{\text{global}} \le 1$, respectively, test whether a focal strategist can invade a resident metapopulation from rarity, and resist re-invasion once established. For instance, for R vs. U, $I_{\text{inv},2}^{\text{global}} < 1$ and $I_{\text{inv},2}^{\text{global}} > 1$ would indicate a circumstance in which U is able to invade R and not vice versa. In this way, we used invasion index traces to compute and generate stacks of pairwise invasion plots (Supplementary Fig. 8). These plots were colored and annotated according to invasion index values, using the key shown.

**Incorporating cheaters.** To examine the effects of cheater emergence in our pairwise competition system, we created a new strategist ($R_c$), representing a cheater strain emerging from a T6SS+ parent (which could be R, or TFT, or 2TFT). $R_c$ possesses the same T6SS genes as its parent (conferring possible immunity to other T6SS+ strains, in exchange for the growth cost of T6SS gene carriage $c_{upfront}$), but never invests in any T6SS activity ($k_{fire,R_c} = 0$). We then computed pairwise (global) invasion indices for $R_c$ vs. every other strain, in the following groupings: R vs. U vs. $R_c$, R vs. TFT vs. $R_c$, and R vs. 2TFT vs. $R_c$. We determined invasion behavior using the same invasion index system as before, again considering both cases with mutual vulnerability and mutual immunity. This introduced four additional invasion indices in each grouping, whose values indicate whether the cheater can invade (and avoid re-invasion by) the other two strategists in each case. Thus, the invasion behavior within each grouping is summarized by the values of six invasion indices.

**Incorporating reduced in-patch relatedness.** To incorporate the effects of increased within-patch relatedness, we created a second weighting scheme in which an R-strategist's effective fitness $\omega_R$ is a weighted sum of (i) fitness when growing alone (i.e., paired with itself), and (ii) fitness growing alongside a competitor Y. Note that being paired with self implies mutual immunity to T6SS attacks, since by assumption all clonemates share identical T6SS effector and immunity genes. Thus, we have

$$\omega_R(Y) = I\omega_R(\mathbf{R}|\mathbf{R}') + (1-I)\omega_R(\mathbf{R}|\mathbf{Y}), \quad (10)$$

where I is a weight parameter representing the probability of perfect strategist segregation, and where $\omega_R(\mathbf{R}|\mathbf{R}')$ represents R's fitness when grown with mutually immune clonemates. In this regime, the local invasion constraint then becomes

$$I_{\text{inv}}^{\text{local}}(k_{\text{fire,R}}, I) = \frac{I\omega_R(\mathbf{R}|\mathbf{R}') + (1-I)\omega_R(\mathbf{R}|\mathbf{Y})}{I\omega_Y(\mathbf{Y}|\mathbf{Y}') + (1-I)\omega_Y(\mathbf{R}|\mathbf{Y})} > 1, \quad (11)$$

for Y = U, TFT, or 2TFT. For global invasion, the (common) resident strategist will statistically only encounter other competitors sharing that strategy. Here, within-patch relatedness controls whether those resident competitors have the same or different effector/immunity sets, that is, the probability of mutual immunity:

$$\omega_{Y,\text{common}} = I\omega_Y(\mathbf{Y}|\mathbf{Y}') + (1-I)\omega_Y(\mathbf{Y}|\mathbf{Y}). \quad (12)$$

Note that Y = U, TFT, or 2TFT undertake no T6SS firing when paired in this way; in these cases, this equation reduces to $\omega_{Y,\text{common}} = \omega_Y(\mathbf{Y}|\mathbf{Y})$. Therefore, our global invasion indices become

$$I_{\text{inv},1}^{\text{global}}(k_{\text{fire,R}}, I) = \frac{I\omega_R(\mathbf{R}|\mathbf{R}') + (1-I)\omega_R(\mathbf{R}|\mathbf{Y})}{\omega_Y(\mathbf{Y}|\mathbf{Y})} > 1, \quad (13)$$

$$I_{\text{inv},2}^{\text{global}}(k_{\text{fire,R}}, I) = \frac{I\omega_Y(\mathbf{Y}|\mathbf{Y}') + (1-I)\omega_Y(\mathbf{R}|\mathbf{Y})}{I\omega_R(\mathbf{R}|\mathbf{R}') + (1-I)\omega_R(\mathbf{R}|\mathbf{R})} \le 1, \quad (14)$$

for Y = U, TFT, or 2TFT. We used these indices to construct 1-D invasion plots (as in Figs. 1 and 2 and Supplementary Fig. 3) for I values of 0.01, 0.5, and 0.99, representing increasing levels of within-patch relatedness. These results are plotted in Supplementary Figs. 11 and 12.

**Computation and postprocessing.** Agent-based model simulations were run on a 2017 Apple ® MacBook Pro laptop computer, with simulations distributed between an Intel ® 3.1 GHz quadcore i7-7920HQ CPU, an Intel ® HD 630 Graphics card, and an AMD Radeon Pro 560 Compute Engine. Simulation data were analyzed
using custom Matlab® scripts (version R2017a 9.2.0.556344), and visualized using the Paraview software (version 5.4.0)⁶¹.

**Bacterial strains and growth conditions.** *Pseudomonas aeruginosa* PAO1 tssB-*mNeonGreen*, *V. cholerae* 2740-80 *vipA-mCherry2*, and *V. cholerae* 2740-80 *vipA-mCherry2 Δhcp1 Δhcp2* were inoculated from Luria broth (LB) agar plates and grown aerobically at 37 °C in LB to an OD600 of 1 (~3 h). One milliliter of each day culture was then pelleted at 11,000 × g for 1.5 min and resuspended in LB to reach OD600 of 10. *Pseudomonas aeruginosa* PAO1 tssB-*mNeonGreen* was mixed with *V. cholerae* 2740-80 *vipA-mCherry2* or *V. cholerae* 2740-80 *vipA-mCherry2 Δhcp1 Δhcp2* in a 1:5 ratio (10–50 µl). Both mixtures (1.5 µl) were spotted on a pad of 1% agarose in 1/3 LB and 2/3 phosphate-buffered saline. The pad was covered with a glass coverslip and incubated for 30 min at 30 °C before imaging.

**Fluorescence microscopy.** For live-cell fluorescence microscopy, the same equipment was used as described previously⁶²,⁶³; a Nikon Ti-E inverted microscope with Perfect Focus System and a Plan Apo 1003 Oil Ph3 DM (NA 1.4) objective lens, a SPECTRA X light engine (Lumencore), and ET-GFP (Chroma #49002) and ET-mCherry (Chroma #49008) filter sets to excite and filter fluorescence. Exposure time was set to 150 ms and LED powers to 20%. Images were recorded with a sCMOS camera pco.edge 4.2 (PCO, Germany; 65-nm pixel size) and VisiView software (version 4.4.0.10, Visitron Systems, Germany). Imaging was carried out at 30 °C and 95% humidity controlled by an Okolab T-unit (Okolab) and images were collected every 2 s for 5 min. The imaging experiments were performed in two biological replicates.

**Image analysis.** Image analysis and manipulation was carried out with Fiji⁶⁴. Contrasts were set equally for a set of compared images. Intensity of GFP and mCherry channels was corrected with the simple ratio bleach correction function. Numbers of *P. aeruginosa* PAO1 tssB-*mNeonGreen* cells in contact with *V. cholerae* 2740-80 *vipA-mCherry2* or *V. cholerae* 2740-80 *vipA-mCherry2 Δhcp1 Δhcp2* cells were counted based on the phase contrast and GFP channel. The number of T6SS structures per cell in *P. aeruginosa* PAO1 tssB-*mNeonGreen* was counted in the maximum intensity projection image of the GFP channel. Only T6SS structures of cells in contact with *V. cholerae* were counted. To quantify the number of repeated T6SS assemblies in kymograms, the reslice function was used. Only repeated T6SS assemblies directed towards *V. cholerae* cells were analyzed. Kymograms of *V. cholerae* were used to calculate the time without new T6SS after contraction (2 s pixel⁻¹). Only T6SS assemblies directed towards *P. aeruginosa* cells were included in the analysis. All quantifications were performed manually. GraphPad Prism7 was used to display the histogram of repeated T6SS assemblies. The number of cells analyzed, averages with standard deviations, and medians are given in the figure legend.

**Statistical analyses.** Unless indicated otherwise, the number of simulation replicates is five for each parameter combination shown. Two biological replicates were used in all experiments. For comparative statistics (Fig. 3b, d), we used a two-sample, two-sided *t* test, assuming data normality. No adjustments were made for multiple comparisons. To estimate effect sizes, we used Cohen's *d* measure,
$$d = \frac{(\mu_1 - \mu_2)}{\sqrt{(SD_1^2 + SD_2^2)/2}},$$
where $\mu_1$ and $SD_1$ are, respectively, data means and standard deviations for each sample *i*. All statistical calculations were performed in Matlab® (version R2017a 9.2.0.556344).

**Reporting summary.** Further information on research design is available in the Nature Research Reporting Summary linked to this article.

**Data availability**

Source data are provided with this paper.

**Code availability**

Our model software is based on CellModeller, a GPU-compatible Python/OpenCL modeling framework³⁹,⁴⁰. Our source code is available to download from Github (https://github.com/WilliamPJSmith/CellModeller).

Received: 11 November 2019; Accepted: 22 September 2020; Published online: 26 October 2020

**References**

1. Boyer, F., Fichant, G., Berthod, J., Vandenbrouck, Y. & Attree, I. Dissecting the bacterial type VI secretion system by a genome wide in silico analysis: what can be learned from available microbial genomic resources? *BMC Genomics* **10**, 1–14 (2009).

2. Coulthurst, S. J. The type VI secretion system—a widespread and versatile cell targeting system. *Res. Microbiol.* **164**, 640–654 (2013).

3. Abby, S. S. et al. Identification of protein secretion systems in bacterial genomes. *Sci. Rep.* **6**, 23080 (2016).

4. Coyne, M. J. & Comstock, L. E. Type V. I. secretion systems and the gut microbiota. *Microbiol. Spectr.* **7**, https://doi.org/10.1128/microbiolspec (2019).

5. Pukatzki, S. et al. Identification of a conserved bacterial protein secretion system in *Vibrio cholerae* using the Dictyostelium host model system. *Proc. Natl Acad. Sci. USA* **103**, 1528–1533 (2006).

6. Costa, T. R. D. et al. Secretion systems in Gram-negative bacteria: structural and mechanistic insights. *Nat. Rev. Microbiol.* **13**, 343 (2015).

7. Durand, E., Cambillau, C., Cascales, E. & Journet, L. VgrG, Tae, Tle, and beyond: the versatile arsenal of type VI secretion effectors. *Trends Microbiol.* **22**, 498–507 (2014).

8. Nguyen, V. S. et al. Towards a complete structural deciphering of type VI secretion system. *Curr. Opin. Struct. Biol.* **49**, 77–84 (2018).

9. Ho, B. T., Dong, T. G. & Mekalanos, J. J. A view to a kill: the bacterial type VI secretion system. *Cell Host Microbe* **15**, 9–21 (2014).

10. Brackmann, M., Nazarov, S., Wang, J. & Basler, M. Using force to punch holes: mechanics of contractile nanomachines. *Trends Cell Biol.* **27**, 623–632 (2017).

11. Hecht, A. L. et al. Strain competition restricts colonization of an enteric pathogen and prevents colitis. *EMBO Rep.* **17**, 1281–1291 (2016).

12. Wexler, A. G. et al. Human symbionts inject and neutralize antibacterial toxins to persist in the gut. *Proc. Natl Acad. Sci. USA* **113**, 3639–3644 (2016).

13. Chatzidaki-Livanis, M., Geva-Zatorsky, N. & Comstock, L. E. Bacteroides fragilis type VI secretion systems use novel effector and immunity proteins to antagonize human gut Bacteroidales species. *Proc. Natl Acad. Sci. USA* **113**, 3627–3632 (2016).

14. Bernal, P., Allsopp, L. P., Filloux, A. & Llamas, M. A. The *Pseudomonas putida* T6SS is a plant warden against phytopathogens. *ISME J.* **11**, 972–987 (2017).

15. Zhao, W., Caro, F., Robins, W. & Mekalanos, J. J. Antagonism toward the intestinal microbiota and its effect on *Vibrio cholerae* virulence. *Science* **359**, 210–213 (2018).

16. Granato, E. T., Meiller-Legrand, T. A. & Foster, K. R. The evolution and ecology of bacterial warfare. *Curr. Biol.* **29**, R521–R537 (2019).

17. Bernard, C. S., Brunet, Y. R., Gueguen, E. & Cascales, E. Nooks and crannies in type VI secretion regulation. *J. Bacteriol.* **192**, 3850–3860 (2010).

18. Lazzaro, M., Feldman, M. F. & Garcia Véscovi, E. A transcriptional regulatory mechanism finely tunes the firing of type VI secretion system in response to bacterial enemies. *MBio* **8**, e00559–17 (2017).

19. Ostrowski, A. et al. Killing with proficiency: integrated post-translational regulation of an offensive type VI secretion system. *PLoS Pathog.* https://doi.org/10.1371/journal.ppat.1007230, 1–25 (2018).

20. Hachani, A., Wood, T. E. & Filloux, A. Type VI secretion and anti-host effectors. *Curr. Opin. Microbiol.* **29**, 81–93 (2016).

21. Brodmann, M., Dreier, R. F., Broz, P. & Basler, M. Francisella requires dynamic type VI secretion system and ClpB to deliver effectors for phagosomal escape. *Nat. Commun.* **8**, 15853 (2017).

22. Trunk, K. et al. The type VI secretion system deploys antifungal effectors against microbial competitors. *Nat. Microbiol.* **3**, 920–931 (2018).

23. Basler, M. & Mekalanos, J. J. Type 6 secretion dynamics within and between bacterial cells. *Science* **337**, 815–815 (2012).

24. Gerc, A. J. et al. Visualization of the serratia type VI secretion system reveals unprovoked attacks and dynamic assembly. *Cell Rep.* **12**, 2131–2142 (2015).

25. Ringel, P. D., Hu, D. & Basler, M. The role of type VI secretion system effectors in target cell lysis and subsequent horizontal gene transfer. *Cell Rep.* **21**, 3927–3940 (2017).

26. Basler, M., Pilhofer, M., Henderson, G. P., Jensen, G. J. & Mekalanos, J. J. Type VI secretion requires a dynamic contractile phage tail-like structure. *Nature* **483**, https://doi.org/10.1038/nature10846 (2012).

27. Basler, M., Ho, B. T. & Mekalanos, J. J. Tit-for-tat: type VI secretion system counterattack during bacterial cell-cell interactions. *Cell* **152**, 884–894 (2013).

28. Leroux, M. et al. Quantitative single-cell characterization of bacterial interactions reveals type VI secretion is a double-edged sword. *Proc. Natl Acad. Sci. USA* **109**, 19804–19809 (2012).

29. Ho, B. T., Basler, M. & Mekalanos, J. J. Type 6 secretion system-mediated immunity to type 4 secretion system-mediated gene transfer. *Science* **342**, 250–253 (2013).

30. Kamal, F. et al. Differential cellular response to translocated toxic effectors and physical penetration by the type VI secretion system. *Cell Rep.* **31**, 10776 (2020).

31. Mougous, J. D., Gifford, C. A., Ramsdell, T. L. & Mekalanos, J. J. Threonine phosphorylation post-translationally regulates protein secretion in *Pseudomonas aeruginosa*. *Nat. Cell Biol.* **9**, 797–803 (2007).

32. Hsu, F., Schwarz, S. & Mougous, J. D. TagR promotes PpkA-catalysed type VI secretion activation in *Pseudomonas aeruginosa*. *Mol. Microbiol.* **72**, 1111–1125 (2009).
33. Casabona, M. G. et al. An ABC transporter and an outer membrane lipoprotein participate in posttranslational activation of type VI secretion in *Pseudomonas aeruginosa*. *Environ. Microbiol.* **15**, 471–486 (2013).

34. Liebl, D., Robert-Genthon, M., Job, V., Cogoni, V. & ATTREE, I. Baseplate component TssK and spatio-temporal assembly of T6SS in *Pseudomonas aeruginosa*. *Front. Microbiol.* **10**, 1615 (2019).

35. Trivers, R. L. The evolution of reciprocal altruism. *Q. Rev. Biol.* **46**, 35–57 (1971).

36. Axelrod, R. & Hamilton, W. D. The evolution of cooperation. *Science* **211**, 1390–1396 (1981).

37. Nowak, M. A. Five rules for the evolution of cooperation. *Science* **314**, 1560–1563 (2006).

38. Zhang, H. & Perc, M. Evolution of conditional cooperation under multilevel selection. *Sci. Rep.* **6**, 23006 (2016).

39. Rudge, T. J., Steiner, P. J., Phillips, A. & Haseloff, J. Computational modeling of synthetic microbial biofilms. *ACS Synth. Biol.* **1**, 345–352 (2012).

40. Smith, W. P. J. et al. Cell morphology drives spatial patterning in microbial communities. *Proc. Natl Acad. Sci. USA* https://doi.org/10.1073/ pnas.1613007114, E280–E286 (2016).

41. Frost, I. et al. Cooperation, competition and antibiotic resistance in bacterial colonies. *ISME J.* **12**, 1582–1593 (2018).

42. Kan, A., Del Valle, I., Rudge, T., Federici, F. & Haseloff, J. Intercellular adhesion promotes clonal mixing in growing bacterial populations. *J. R. Soc. Interface* **15**, 20180406 (2018).

43. Nadell, C. D., Drescher, K. & Foster, K. R. Spatial structure, cooperation and competition in biofilms. *Nat. Rev. Microbiol.* **14**, 589–600 (2016).

44. Smith, W. P. J. et al. The evolution of the type VI secretion system as a disintegration weapon. *PLoS Biol.* **18**, e3000720 (2020).

45. Borenstein, D. B., Ringel, P., Basler, M. & Wingreen, N. S. Established microbial colonies can survive type VI secretion assault. *PLoS Comput. Biol.* **11**, 1–16 (2015).

46. McNally, L. et al. Killing by type VI secretion drives genetic phase separation and correlates with increased cooperation. *Nat. Commun.* **8**, 14371 (2017).

47. Brännström, Å. et al. The Hitchhiker's guide to adaptive dynamics. *Games* **4**, 304–328 (2013).

48. Wilson, D. S. A theory of group selection. *Proc. Natl Acad. Sci. USA* **72**, 143–146 (1975).

49. Mitri, S., Xavier, J. B. & Foster, K. R. Social evolution in multispecies biofilms. *Proc. Natl Acad. Sci. USA* **108**, 10839–10846 (2011).

50. Chassaaing, B. & Cascales, E. Antibacterial weapons: targeted destruction in the microbiota. *Trends Microbiol.* **26**, 329–338 (2018).

51. Kerr, B., Riley, M. A., Feldman, M. W. & Bohannan, B. J. M. Local dispersal promotes biodiversity in a real-life game of rock-paper-scissors. *Nature* **418**, 171–174 (2002).

52. Biernaskie, J. M., Gardner, A. & West, S. A. Multicoloured greenbeards, bacteriocin diversity and the rock-paper-scissors game. *J. Evol. Biol.* **26**, 2081–2094 (2013).

53. Lambert, P. A. Mechanisms of antibiotic resistance in *Pseudomonas aeruginosa*. *J. R. Soc. Med.* **95**, 22–26 (2002).

54. Schneider, J. P. et al. Diverse roles of TssA-like proteins in the assembly of bacterial type VI secretion systems. *EMBO J.* **38**, e100825 (2019).

55. Toska, J., Ho, B. T. & Mekalanos, I. J. Exopolysaccharide protects Vibrio cholerae from exogenous attacks by the type 6 secretion system. *Proc. Natl Acad. Sci. USA* **115**, 7997–8002 (2018).

56. Borenstein, D. B., Ringel, P., Basler, M. & Wingreen, N. S. Established microbial colonies can survive type VI secretion assault. *PLoS Comput. Biol.* **11**, https://doi.org/10.1371/journal.pcbi.1004520 (2015).

57. Vettiger, A., Winter, J., Lin, L. & Basler, M. The type VI secretion system sheath assembles at the end distal from the membrane anchor. *Nat. Commun.* **8**, 16088 (2017).

58. Storey, D. et al. *Klebsiella pneumoniae* type VI secretion system-mediated microbial competition is PhoPQ controlled and reactive oxygen species dependent. *PLoS Pathog.* **16**, e1007969 (2020).

59. Schneider, P. J. & Eberly, D. H. *Geometric Tools For Computer Graphics* (Elsevier, 2002).

60. Coyte, K. Z., Tabuteau, H. E., Gaffney, E. A., Foster, K. R. & Durham, W. M. Microbial competition in porous environments can select against rapid biofilm growth. *Proc. Natl Acad. Sci. USA* https://doi.org/10.1073/ pnas.1525228113, E161–E170 (2017).

61. Ahrens, J., Geveci, B. & Law, C. In Visualization Handbook (eds Hansen, C. D. & Johnson, C. R.) 717–732 (Elsevier, 2005).

62. Kudryashev, M. et al. Structure of the type VI secretion system contractile sheath. *Cell* **160**, 952–962 (2015).

63. Vettiger, A., Basler, M. & Type, V. I. Secretion system substrates are transferred and reused among sister cells. *Cell* **167**, 99–110 (2016). e12.

64. Schindelin, J. et al. Fiji: an open-source platform for biological-image analysis. *Nat. Methods* **9**, 676–682 (2012).

## Acknowledgements

We are grateful to Elisa Granato, Oliver Meacock, and Kat Coyte for their insight and comments. W.P.J.S., K.R.F., and L.E.C. are supported by the National Institutes of Health (project numbers R01AI093771 and R01AI120633). K.R.F. is funded by European Research Council Grant 787932 and Wellcome Trust Investigator award 209397/Z/17/Z. Y.D. is funded by European Research Council Grant 803074. This project is supported by a Templeton World Charity Foundation grant.

## Author contributions

Conceptualization: W.P.J.S., D.U., and K.R.F.; methodology: W.P.J.S., M.B.R., D.U., Y.D., M.B., and K.R.F.; investigation: W.P.J.S., M.B.R.; writing—original draft: W.P.J.S.; writing—review and editing: W.P.J.S., M.B.R., D.U., Y.D., L.E.C., M.B., and K.R.F.; funding acquisition: L.E.C., M.B., and K.R.F.; resources: Y.D., L.E.C., M.B., and K.R.F.; supervision: L.E.C., M.B., and K.R.F.

## Competing interests

The authors declare no competing interests.

## Additional information

Supplementary information is available for this paper at https://doi.org/10.1038/s41467- 020-19017-z.

Correspondence and requests for materials should be addressed to W.P.J.S. or K.R.F.

Peer review information *Nature Communications* thanks Luke McNally, William Ratcliff and the other, anonymous, reviewer for their contribution to the peer review of this work.

Reprints and permission information is available at http://www.nature.com/reprints

Publisher's note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

<figure><img src="image_26.png" /></figure>

Open Access This article is licensed under a Creative Commons

Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/.

© The Author(s) 2020