Main

One of the most striking illustrations of Darwin’s ‘struggle for existence’1 is the evolution of weaponry2,3. Weapons—traits that evolved to injure and harm competitors—have evolved many times in animals, with examples in groups as diverse as trilobites, insects, mammals and dinosaurs2. Bacteria are a second group of organisms that commonly evolve weapons3,4,5. Many clinical antibiotics were first isolated from bacteria that release them into the environment to inhibit competitors6,7,8,9,10. Ribosomally synthesized bacteriocins are deployed in a similar manner and include both chemical toxins and phage-tail-derived tailocins, which physically punch holes in competitors11. Bacteria also deploy close-range weapons that require contact between cells. Examples include type VI secretion systems (T6SSs), which fire toxin-laden needles into competing cells12, and contact-dependent inhibition (CDI) systems, which are toxin-loaded filaments anchored to the outside of the cell13. The diversity of weapons seen in bacteria, therefore, certainly rivals that seen in animals. However, there is a notable difference between the two groups. Excluding teeth and claws, whose primary evolutionary function is feeding, animals tend to carry a single weapon type: for example, horns or antlers or tusks2. Some animals are known to possess multiple weapons—the dinosaur Ankylosaurus magniventris had both horns and a bludgeoning tail club2,14—but such examples appear to be the exception. By contrast, bacteria commonly carry multiple types of weapon3.

Pseudomonas aeruginosa is a problematic opportunistic pathogen, due to its ability to withstand numerous antibiotics15. Alongside its defensive capacity, this species is a striking illustration of how many weapons bacteria can carry. P. aeruginosa produces multiple bacteriocins and toxic small molecules, which serve as long-range weapons16. In addition, it can deploy CDI and up to three T6SSs as short-range weapons17. More generally, among species whose weapons have been characterized in detail, many carry both short- and long-range weapons, including strains of Bacteroides fragilis18,19, Pectobacterium carotovorum20,21, Burkholderia cepacia22,23, Chromobacterium violaceum24,25 and Myxococcus xanthus26,27. What is the evolutionary basis for the prevalence of multiple weapons? One argument is that bacteria are simply more aggressive than other species such as animals, and that this favours the simultaneous use of multiple weapons. Consistent with this hypothesis, experiments suggest that bacteria engage in combat much more regularly than animals3, which typically avoid using their weapons2. However, a general increase in aggression does not explain why bacteria carry multiple types of weapon, as opposed to simply just investing more in a single type. We hypothesized that bacteria carry multiple weapons because they serve different functions during competition. We further reasoned that this explanation is most compelling for weapons that function at different ranges, a factor that can strongly influence the outcome of bacterial contests28. We therefore sought to test this hypothesis by performing a direct comparison of the competitive benefits of short- versus long-range weapons.

We first employ a realistic agent-based model of bacterial competition that has previously been used to understand the evolutionary function of single weapons29,30. The power of this framework is that it allows one to rapidly study a wide variety of competition scenarios with relative ease, while being realistic enough to generate focused predictions for empirical testing. The model predicts that short- and long-range weapons do indeed have the potential to serve different functions. We test these predictions by genome editing P. aeruginosa strain PAO1 to generate strains that are susceptible to its own short- and long-range weapons (CDI and tailocins, respectively). This approach allows us to directly compare weapons’ functioning in a controlled genetic background, and thereby investigate the relative benefits of the two weapon types. In support of the modelling, we find that short- and long-range weapons can provide different advantages during combat. Contact weapons remain effective when an attacking strain is outnumbered, facilitating invasion and establishment. By contrast, ranged weapons are most effective when attackers are abundant, but here they prove to be a devastating form of attack.

Results

An agent-based model of short- and long-range weapons

We first employ an established computational model where each cell is simulated as an individual agent (hence, ‘agent’ or ‘individual based’ model; Methods)29,30,31,32,33. Bacterial cells are seeded onto a two-dimensional (2D) surface where they grow and divide to fill a vertical space, as can occur in a biofilm for example, or at the intestinal mucosa of a mammalian host. Cells interact with each other both physically—pushing and displacing each other as they grow and collide—and chemically, by producing toxins that can inhibit strains of a different genotype (Fig. 1 and Supplementary Video 1). When cells reach a specified height they are removed, mimicking dispersal or shedding from the top of the community. Bacterial weapons can vary substantially in a wide range of properties, including method of delivery (short- or long-range), quantity produced, deadliness, cost of production and, of course, the strain or species where they are found3. This can make like-for-like comparisons of different weapons empirically challenging. However, with a model one can precisely define, and systematically vary, such properties of bacterial weapons to study general principles (Methods). The model is also spatially explicit, which is particularly important for contact-based weapons whose action depends upon the occurrence of physical contact between cells29,30.

Fig. 1: Agent-based modelling predicts that contact weapons are more robust to changes in frequency, density and secretion rate.
figure 1

a, Contact toxins (top): producing cells can deliver toxins to neighbouring cells. If a susceptible cell (yellow) is within range, the toxin is injected (left dashed circle) and the susceptible cell dies; otherwise the toxin is wasted (right dashed circle). Diffusing toxins (bottom): when the local concentration of a diffusible toxin exceeds a threshold (within dashed line), susceptible cells die. b, Cells secrete toxins, incurring a growth-rate penalty proportional to the amount of toxin being secreted (secretion rate). c, Snapshots of competition outcomes for attackers with contact-dependent toxins (blue cells, left column) or diffusible toxins (magenta cells, right column). Unarmed susceptibles (yellow cells) die upon lethal toxin exposure (black cells). The contact weapon performs better at lower frequencies than the diffusible weapon. Snapshots show cropped (150 µm) sections of the 300-µm-wide, 2D simulation domain; below the black line (arrow) represents the lethal concentration for the diffusible toxin. Scale bar, 50 µm; inoculum, 100 cells. d, Quantification of competition outcomes for two initial cells densities: ‘low’ (10 cells inoculum) and ‘high’ (100 cells inoculum). Competitive advantage assesses the fold change in the attacker strain compared with its competitor from the beginning to end of the simulation (Methods). Horizontal bars indicate the mean from multiple simulations (n = 6). e, Snapshots of competition outcomes for invasion scenario (invader frequency: 10%), with contact-dependent and diffusible-toxin-armed attackers coloured as in c. Scale bar, 10 µm. Successive timepoints (rows) show fates of initially rare attackers following random inoculation into confluent biofilms of susceptible cells. f, Quantification of competition outcomes for invasions (invader frequency: 10%) using the same competitive advantage metric as in d, quantified as a function of toxin secretion rate. Horizontal bars indicate the mean from independent simulations (n = 6).

Source data

Modelling predicts distinct strengths of short- and long-range weapons

We use our model to compare short- and long-range bacterial weapons that—other than their range of effect—are as similar as possible. Attacking cells can ‘fire’ a short-range weapon at random from their cell surface, intoxicating any susceptible cell(s) that are contacted (Fig. 1a), which is intended to simulate contact weapons including T6SSs29,30 and CDI13. Alternatively, attacking cells can release a diffusible factor into the environment, which could represent a range of toxins, including a small-molecule antibiotic, a ribosomally synthesized bacteriocin or a tailocin. The rate at which toxins are exported out of attacking cells is matched for short- and long-range weapons, and is controlled via a secretion rate parameter, ksec. Toxins also have matched potencies: both contact and diffusible toxins are lethal once intracellular concentrations exceed a set threshold Tc. We assume that producing either toxin incurs an equivalent growth-rate cost in attacking cells that is proportional to the secretion rate: that is, increasing the toxin secretion rate results in a lower growth rate (Fig. 1b and Methods)34,35. Our goal is to compare weapons that differ only in their range, while keeping all other features identical. As a result, we assume that the cost of use is equivalent for both short- and long-range weapons.

We begin by modelling competitions between an attacker strain, which either has a short- or a long-range weapon, and a second strain that is susceptible to the weapon. We look at a wide range of competition scenarios, varying the initial frequency of the attacker, initial density of cells and the amount that the attacker invests in its weapon (that is, toxin secretion rate). In each case, the two strains are allowed to grow and interact for a set period of time (10 h; Fig. 1c), after which we compare the final attacker:susceptible cell ratio to its initial value (‘competitive advantage’; Methods). Both weapons tend to perform better when cells are seeded at high initial density, because this promotes cell–cell contact for short-range weapons36 and toxin accumulation for long-range weapons. Nevertheless, there remains a clear difference between the two weapon types. Across the majority of scenarios tested, the contact-dependent weapon provided an advantage to the attacker (Fig. 1d and Extended Data Fig. 1a). By contrast, the long-range weapon is more sensitive to starting conditions, requiring a higher secretion rate to be effective (Supplementary Fig. 1b) and reaching its full potential only when the attacker is seeded at high frequency and high density.

The models suggest a particular advantage of contact-dependent weapons: they are effective even when users are at a numerical disadvantage. This benefit is likely to be most substantial when invading an established population, because here invaders will be outnumbered by residents. We explored this scenario further by modelling established biofilms of susceptible cells and simulating the late arrival of attacker cells (by replacing some of the susceptible cells at random with attackers). In this scenario, cells using the short-range weapon were able to successfully invade an established population, where increasing toxin secretion rate increased their success (Fig. 1e,f and Extended Data Fig. 1c). Conversely, long-range weapons never enabled invasion, as producer cells could never amass in sufficient numbers to kill the susceptible strain.

In summary, even though we closely matched the properties of the two weapon types, the models predict that they perform differently across the variety of competition scenarios we tested. In general, contact weapons work well across a range of frequencies, including cases when a strain is rare, allowing it to invade. By contrast, long-range weapons function well only when a producing strain is relatively abundant, but here they are an effective form of attack.

Using genome editing to generate strains for weapon comparisons

Our modelling predicts that a long-range weapon will perform poorly at low attacker frequency, which is consistent with the findings of several previous studies—both theoretical and empirical—showing that toxin production is most effective when attackers are abundant35,37,38,39,40,41. However, to test our predictions on the relative benefits of short- versus long-range weapons, a well-controlled comparison of the two types of weapon is required. To do this, we turned to the opportunistic pathogen P. aeruginosa (strain PAO1), which naturally carries both short- and long-range weapons. Of its long-range weapons, the mechanical tailocins (specifically its R-type pyocins) are known to be highly effective weapons under biofilm-like conditions42,43. For short-range weapons, P. aeruginosa has a dedicated antibacterial T6SS17, but it is under complex regulation and typically fires only in response to incoming attacks29,44,45. Therefore we instead chose to focus on a CDI system of P. aeruginosa46 as a short-range weapon to test predictions. The fitness costs of these weapons potentially differ. Tailocins are induced by DNA damage and released through the self-lysis of a sub-population of cells47. CDI systems are regulated by unknown signals and are expected to be produced by all cells of a population, but their use does not require cell death46. The regulatory strategies of weapons can have important effects on their effectiveness48, which we do not study here. Nevertheless, both weapons have been shown to provide clear advantages to their users, which made them a good choice for representative short- and long-range weapons.

For both weapons, we used genome editing to generate a strain that is susceptible to the weapon but otherwise well-matched to the attacker, allowing us to study the effects of each weapon on bacterial competition. For CDI, this was straightforward: deleting the three gene locus that encodes the CDI transporter, toxin filament and immunity (PA0040–PA0041), resulting in a strain that does not have CDI and is susceptible to CDI. For the tailocins, we selected pyocin R2, but here resistance is more complex as it is determined by the composition of the lipopolysaccharide (LPS) moieties of the outer membrane49. Here, we engineered a susceptible strain by deleting both the pyocin R2 locus and the gene wbpL, which causes a deficiency in the LPS that in our strain background leads to susceptibility to pyocin R2 (Extended Data Fig. 2). However, this deficiency in the LPS caused a competitive disadvantage to the susceptible strain, independent of the effects of tailocins (Extended Data Fig. 3). To generate a near-matched attacker strain, therefore we made a ΔwapR deletion in the wild-type strain, which causes a similar LPS deficiency but not one that leads to pyocin R2 susceptibility (Extended Data Fig. 2 and Methods).

In the absence of the weapon-mediated advantage of pyocin R2 (hereafter ‘tailocin’), the wapR mutation puts the attacker at a moderate disadvantage relative to the wbpL mutation in the susceptible strain (Extended Data Fig. 4). We quantified this difference and used it to adjust the predicted competitive advantage of the attacker strain in our experiments, in order to estimate the effects of the weapon alone (Extended Data Fig. 4 and Methods). However, in practice this adjustment has little impact on the data because the benefits of the tailocin, when they are seen, massively outweigh this moderate cost of wapR deletion (for further discussion of these LPS mutations, see Methods).

Experiments with P. aeruginosa show distinct advantages to short- and long-range weapons

With these strains, we could then test our modelling predictions for a scenario where attackers armed with either a contact or diffusible weapon compete against a susceptible strain (Methods). Both weapons are probably influenced by the spatial structuring of the environment. With structured environments, for example, there is the potential for diffusion limitation that might constrain long-range weapons. Spatial structure can also limit short-range weapons if single genotypes are growing in distinct patches, because this can reduce contacts between attacker and target cells30,50. The spatial structure of the environment, therefore, may affect short- and long-range weapons differently. To include the potential for such effects, we performed competitions when cells are growing on agar (the ‘colony biofilm model’)51,52. This assay allows us to capture the dense, spatially structured conditions thought to be typical of bacterial communities53, and both weapons are expected to function well in this context (Methods). The interior and edge of bacterial colonies represent distinct competition scenarios, due to the much greater potential for population expansion at the edge54,55. We therefore decided to sample each region separately (Methods), although the competition outcomes show similar trends between the two. Consistent with previous work, we find that both weapon systems have the potential to provide large competitive benefits for an attacking strain43,46,56,57. As in the models, outcomes were quantified by comparing the final ratio of attacker:susceptible cells with its initial value (the ‘competitive advantage’).

Overall, we find good support for our modelling predictions, despite the potential for differences in the cost of using tailocins and CDI. As the models predict, high attacker frequency is most important for the effectiveness of the long-range weapon (tailocin; Fig. 2b). In comparison, the short-range weapon (CDI) almost always performs equivalently or better at intermediate and low frequencies, especially at the colony edge (Fig. 2c). The CDI experiments also include cases where weapon performance peaks at intermediate frequency as in the model (compare Fig. 1d, high density, with Fig. 2b, density 104 cells). For the tailocin competition, we observe an improvement in weapon performance as initial cell densities increase. This pattern is again predicted by the model (Fig. 1), although the effect is substantially stronger in the experiments, which cover much larger total numbers and ranges of initial cell density than are possible with the modelling. We note that previous work on long-range inhibition did not find this density-dependence28, but the inhibitory mechanism in this study relied on the diffusion of a quorum-sensing signal and a synthetic gene circuit, not a bacterial weapon, so it is not directly comparable.

Fig. 2: Experiments show the importance of high density and high frequency for long-range weapons.
figure 2

Colony competitions with P. aeruginosa PAO1 between wild-type and mutants susceptible to either CDI (short range) or pyocin R2 (tailocin, long range) inoculated from different densities (mean inoculum density 1.9 × 103, 104, 105, 106 CFU µl−1). a, Representative microscopy images from equal-frequency (1:1) competitions after 48 h of growth. All strains express constitutive fluorescent protein genes and are false-coloured either blue (CDI attacker, top), magenta (tailocin attacker, bottom) or yellow (susceptible, top and bottom). Scale bar, 500 µm. b, Quantification of competition outcomes at the colony centre. One-way ANOVA showed that initial density and ratio significantly affected both weapons in the centre (CDI, density: P = 1.45 × 10−6, n = 80; CDI, ratio: P = 1.45 × 10−6; tailocin, density: P = 3.68 × 10−8, n = 91; tailocin, ratio: P = 5.01 × 10−10). c, Quantification of colony competition outcomes at the colony edge. One-way ANOVA showed that initial density and ratio significantly affected both weapons at the edge (CDI, density: P = 6.54 × 104, n = 80; CDI, ratio: P = 2.29 × 1010; tailocin, density: P = 1.89 × 106, n = 92; tailocin, ratio: P = 1.43 × 109). For b and c, competitions were assessed via counts of CFUs. Competitive advantage assesses the fold change in the attacker strain compared with its competitor from the beginning to end of the competition. The tailocin attacker advantage in b and c has been adjusted for a disadvantage in the background genotype of the attacking strain (see Methods and Extended Data Figs. 3 and 4). Horizontal bars indicate the mean of independent biological replicates (n ≥ 6; see Supplementary Table 5 for exact values of n). Top brackets indicate a significant difference between the weapons (two-sided Welch’s t-test, P < 0.05, Benjamini–Hochberg correction for multiple testing; see Supplementary Table 5 for exact P values).

Fluorescence micrographs of the colonies show how the competitions play out in space (Fig. 2a and Extended Data Fig. 5), and allow a finer assessment of spatial structure than can be achieved with sampling of the edge and the middle for counting. These images reveal a pattern where the tailocin performs worse at the very edge of the colony as compared to CDI (Fig. 2a middle bottom). This pattern is consistent again with the requirements for tailocins to build up to be effective, as this build up is expected to happen first in the colony interior and last at the colony edge. The genotypic patchiness seen in these images is also likely to help explain the variability in the quantification data. Patchiness, especially at low density, is more prominent at the edge, leading to variation between replicates due to the coarse nature of the sampling procedure. Nevertheless, the overall patterns and difference between weapon types remain clear and statistically significant (Fig. 2b,c).

In summary, our experiments show that both weapons can be highly effective, but that the two weapons perform best under different conditions. Tailocins are extremely effective at high frequencies and densities, while CDI performs more consistently across conditions, including the unique ability to provide a competitive advantage when a strain starts out rare and at low density.

Head-to-head contests of short- and long-range weapons

Our first experiments examine the performance of each weapon type against susceptible cells that do not fight back. We next explore the case where users of the two weapons meet. In this situation, a weapon can potentially take on new significance, as eliminating competitor cells also serves to reduce incoming attacks. The agent-based model again predicts that both initial frequency and cell density can be critical to the performance of the weapons (Fig. 3a,b, Extended Data Fig. 6 and Supplementary Video 2). At low cell density, the impact of both weapons is limited, but the contact weapon user does gain an advantage when it starts in the majority. At high cell density, the long-range weapon user can win but, as in the single weapon competitions (Fig. 1d), this requires it to start at high frequency. When the long-range strain is at low or equal initial frequency, the contact weapon performs the best.

Fig. 3: Head-to-head competitions between short- and long-range weapon users.
figure 3

a, Modelling: snapshots of competition outcomes for cells armed with contact-dependent toxins, but susceptible to diffusible toxins (blue cells) or cells armed with diffusible toxins, but susceptible to contact-dependent toxins (magenta cells). Both cells die upon lethal toxin exposure (black cells). Snapshots show cropped (150 µm) sections of the 300-µm-wide, 2D simulation domain; below the black lines (arrows) represents the lethal concentration for the diffusible toxin. Scale bars, 50 µm; initial densities were ‘low’ (10 cells) or ‘high’ (100 cells). b, Modelling: quantification of competition outcomes for two initial cell densities: ‘low’ (10 cells) and ‘high’ (100 cells). Competitive advantage assesses the fold change in the attacker strain compared with its competitor from the beginning to end of the simulation (Methods). Horizontal bars indicate the mean from independent simulations (n = 6). c, Experiments: representative microscopy images of competitions between mutually susceptible CDI and tailocin-producing cells after 48 h inoculated from different densities (mean inoculum density 2.3 × 105, 106 CFU µl−1). All strains are expressing constitutive fluorescent proteins and are false-coloured either blue (CDI attacker, tailocin-susceptible) or magenta (tailocin attacker, CDI-susceptible). Scale bars, 500 µm. d, Experiments: quantification of colony competition outcomes via counts of CFUs. Values above 1 (dashed line) indicate an advantage for CDI, while values below 1 indicate an advantage for tailocins. Data are adjusted to account for differences in competitiveness of the strain backgrounds (ΔwapR relative to ΔwbpL; see Methods and Extended Data Fig. 2). Horizontal bars indicate the mean from independent biological replicates (n = 8). Top brackets indicate a significant difference between the initial ratios (two-sided Welch’s t-test, P < 0.05, Benjamini–Hochberg correction for multiple testing; see Supplementary Table 5 for exact P values). Stars indicate a significant competitive advantage. The genotype of the CDI-using, tailocin-susceptible strain (blue) is ΔR2ΔwbpL. The genotype of the tailocin-using, CDI-susceptible strain (magenta) is ΔwapRΔCDI.

Source data

To test these predictions, we competed a strain susceptible to CDI against a strain susceptible to tailocins (pyocin R2; Fig. 3c,d). The CDI attacker was thus an LPS mutant (ΔwbpL; see above and Methods), which renders it susceptible to the tailocin. As this mutation causes changes to the cell envelope, we first checked that the CDI system remained functional. The gene deletion (ΔwbpL) did not prevent CDI from functioning, but it did reduce the advantage provided by CDI at lower initial densities (Extended Data Fig. 7). Going forward, therefore, we only provide data from the two highest initial cell densities (106 or 105 cells μl−1). We also focus on data from the interior of the colony going forward, as they are most reflective of typical biofilm growth33, but data from the colony edge are similar (Extended Data Fig. 8). As predicted by the high-cell-density model, only the CDI-using strain gains a significant advantage in equal-frequency competitions (Fig. 3d). Moreover, again as predicted, both weapon users are able to win when they start in the majority. This effect is particularly strong for the tailocin, which provides a large competitive advantage when starting from high frequency.

Contact and diffusible weapons are complementary

Our findings thus show that short- and long-range weapons can provide distinct advantages, which helps to explain why bacteria would carry both types. However, it is possible that these advantages are not provided simultaneously in practice. Therefore, we sought to experimentally study a single strain using both weapons, compared to each weapon being used alone. To allow susceptibility to tailocins and make the comparison as fair as possible, we put all attacker strains in the same LPS genetic background (ΔwapR), and all susceptible strains in the ΔwbpL background. All competition outcomes are again adjusted for the moderate disadvantage caused by the ΔwapR mutation, and we focus on high initial cell densities as before (see above and Extended Data Fig. 9). As predicted by the study of each weapon individually, across the competitions and contexts, the two weapons function in a complementary fashion, providing an equivalent or greater benefit than either weapon alone (Fig. 4 and Extended Data Figs. 9 and 10). That is, we find that using both CDI and tailocins can allow a strain to receive benefits from both.

Fig. 4: The benefits of short and long-range weapons combine positively in P. aeruginosa.
figure 4

Quantification of competition outcomes in the colony centre for two initial cell densities (mean inoculum density 1.9 × 105, 106 CFU µl−1). Competitive advantage assesses the fold change in the attacker strain compared with its competitor from the beginning to end of the competition. Competitions where the attacker has just CDI (blue, left), just tailocins (magenta, centre) or both weapons (purple, right) show the advantage gained from using two weapons together as compared to just one. Data are adjusted to account for differences in competitiveness of the strain backgrounds (ΔwapR relative to ΔwbpL; see Methods and Extended Data Fig. 2). Horizontal bars indicate the mean from independent biological replicates, n ≥ 6; see Supplementary Table 5 for exact values of n). Stars above the double weapon data indicate a significant difference between the combination of weapons and either single weapon (blue and magenta), or just CDI (blue) (two-sided Welch’s t-test, P < 0.05, Benjamini–Hochberg correction for multiple testing; see Supplementary Table 5 for exact P values).

Source data

Discussion

Bacteria use a vast variety of weapons to inhibit and kill competitors. Here we have shown that two major categories of weapon—short- and long-range—can provide distinct and complementary advantages to bacteria. We find that weapons that rely on contact between cells are generally effective whether a strain is rare or common, which is consistent with previous work on the CDI systems of Escherichia coli58. Conversely, weapons that diffuse across long ranges are more reliant on high producer cell frequency and density. However, under these conditions, long-range weapons can be particularly powerful in eliminating both armed and unarmed competitors. These observations help to answer two related questions. First, why do short- and long-range weapons exist at all in bacteria? Here, our work suggests that a strain may benefit more from one weapon type or another, depending on its ecology. For example, if bacterial fitness is more determined by the ability of a given strain to invade communities than persist in a community, contact-dependent weapons may be most useful. This matches with observations showing that pathogens including Salmonella59 and Vibrio cholera60 use the T6SS during invasion of established communities, although gut-resident Bacteroides fragilis can also use its T6SS to repel invaders61 and the H1-T6SS of P. aeruginosa fires only in response to incoming attacks44, underlining the flexibility of short-range weapons (Figs. 13).

The second question is this: why do many bacteria carry both short- and long-range weapons? Again, the fact that the two weapon types can perform distinct functions provides an answer to why a cell would carry both. However, the possession of multiple weapons may also carry other non-mutually exclusive advantages. If two weapons are simply more potent than one, this can also favour carrying several of them62. In addition, if a given competitor is likely to carry resistance to some of the available weapons, natural selection may favour using multiple weapons simply to increase the likelihood that the competitor is susceptible to at least one. This explanation may be most important for cases where bacteria carry several of the same weapon type and functional differences are less pronounced, for example, P. aeruginosa releasing multiple S-type pyocin protein toxins and tailocins simultaneously via cell lysis16. If the use of short- and long-range weapons can be so beneficial, why is it not more widely seen in organisms other than bacteria? Short-range weapons, like CDI and T6SSs, can be used against competitors by lone cells and remain effective at low densities58. However, the effectiveness of long-range weapons rests upon the strength in numbers that comes with group living. Mounting evidence suggests that bacteria commonly live, and fight, as part of large groups3. Our work suggests that it is this propensity for group living that has led to the widespread evolution of both short- and long-range weapons.

Methods

Agent-based modelling

A major challenge in comparing bacterial weapons is that even within the broad categories of contact and diffusible, their method of deployment varies substantially. The T6SS can be fired at random intervals to deliver toxins or only in response to incoming attack44, whereas CDI filaments are produced to decorate attacking cells in unknown numbers, but toxin translocation occurs only in response to receptor binding on a target cell. The small-molecule antibiotics of Streptomyces are secreted from intact cells, whereas E. coli’s colicins and the pyocins of P. aeruginosa require cell lysis for release. These examples also demonstrate the high variability in the cost of using weapons. The use of computational models is very amenable to these challenges, as we can unify the production of both contact and diffusible weapons under a single parameter ‘secretion rate’ and make their growth costs (per unit secretion) equal.

The behaviours of cellular groups are often emergent, in the sense that they can only be understood in terms of collective effects that arise whenever there are many interacting organisms63. A strength of our modelling approach is that it is able to capture emergent and spatial effects, such as the importance of cell shape for bacterial competition31,33, the importance of lytic toxins for T6SS attack30 and the need for strong reciprocation when the T6SS is used in response to incoming attacks30. For each of these examples, the models predicted novel biology that was subsequently validated empirically using experimental work29,30,33, giving us confidence in our modelling approach.

All simulations were carried out using CellModeller32, an open-source software platform for running agent-based models of bacterial growth. To model contact-based and diffusible toxin secretion, we implement additional python-based CellModeller modules, whose source codes are available at https://github.com/WilliamPJSmith/CellModeller. The key processes incorporated in our model are summarized below; model variables and parameters are summarized respectively in Supplementary Tables 1 and 2.

Model description

Cell growth and division

In our simulations, bacterial cells are represented as short capsules with a fixed radius R = 0.5 μm, and a birth segment length of 0.01 μm (equivalent to a birth volume V0 = 0.54 μm3). Cells grow through elongation, dividing after doubling their birth volume V0, plus a small random noise term ξV ≈ U(0, 0.05)V0. Each simulation timestep Δt, each cell grows by an amount proportional to that cell’s current volume, V= kgrowV, discretized as V(t + Δt) = V(t) (1 + kgrowΔt). Here, kgrow (s−1) represents the net per capita growth rate. The production of ranged or contact toxins is assumed to be costly, such that weapon users suffer a growth penalty proportional to their toxin secretion rate, kgrow = kmax(1–cksec), with c, kmax and ksec the pro rata toxin cost, maximum growth rate and equivalent contact toxin secretion rate, respectively. For simplicity and computational expediency, we assume throughout that nutrient access is non-limiting, such that kmax is independent of cells’ positioning in a community.

Mechanical interactions

Mechanically, cells are modelled as rigid, elastic particles that push on one another as they grow and divide. Each simulation timestep, immediately following the growth stage outlined above, an energy penalty method is used to compute cell movements necessary to minimize total cell–cell overlap, subject to viscous drag forces acting on each cell. This process, described previously in detail32,33,64, approximates the elastic repulsion forces acting between cells in physical contact.

Contact-dependent toxins

As in previous publications29,30, we use a custom Python module to represent cell–cell antagonism via contact-dependent toxins. While this module was previously used to study T6SS-mediated interference, it is a generic representation of contact-dependent warfare that allows us to make general predictions that should apply to many mechanisms, including CDI. Each simulation timestep, cells armed with contact toxins fire needles of length R, projecting orthogonally from randomly chosen sites on their cell surface. The number of secretion events per cell per unit time is drawn from a Poisson distribution, whose mean is the secretion rate ksec. After firing, each needle is checked to determine if it comes into contact with any other cell in the population (line-segment method). Successful hits are logged for each target cell and result in cell death if their number (excluding hits by kin cells) exceeds a lethal threshold Nhits = 1 (ref. 65).

Diffusible toxins

We assume toxins to be freely diffusible solutes that kill susceptible cells when their local concentration uT exceeds a lethal threshold TC (controlled by Nhits; see below). To represent natural variability in toxin susceptibility66,67,68, lethal toxin threshold is drawn for each cell from a normal distribution, N(1, 0.2) at birth (we ignore this stochasticity in the discrete contact toxin model, because with mean Nhits = 1, the chances of any cell surviving more than one hit are approximately 1:130,000). To model the toxin concentration field uT = uT(x, y) (kgT m−3) for a given cell configuration, we use the reaction–diffusion equation ∂uT/∂t = DT2uT + kTɑ⍴ɸ(x, y)69. Here, DT, kT, ɑ, and ɸ(x, y) are respectively the toxin diffusivity (m−3), the specific toxin production rate (s−1), the toxin yield per unit cell biomass (kgT kgX−1], the cell biomass density (kgX m−3) and the cell volume fraction function (unitless). In non-dimensional form, pseudo-steady-state solutions to this equation are given by 2uT = T ɸ(x, y). The behaviour of this equation is governed by a single parameter grouping, the Damköhler number T = l2kTɑ⍴/DTTC. Conceptually, we vary T by changing the toxin production parameter kT, such that increases in production always incur proportional increases in production cost. We compute pseudo-steady-state solutions with the finite element method, using the FEniCS Python library and supporting CellModeller modules. Solutions are evaluated on a 2D rectangular domain of dimensions Lx by Ly with crossed mesh element size h = 5 μm. Solutions are subject to mixed boundary conditions: periodic boundary conditions (left and right edges), Neumann boundary conditions (base edge) and Dirichlet boundary conditions (uT = 0 along top edge). As in previous studies69, we assume that toxin is not subject to degradation or removal as part of its activity; toxin is only lost from the domain via leakage along the top edge.

Parity between diffusible and contact-dependent toxins

Our model aims to compare diffusible and contact weapons in a like-for-like manner. For this comparison to be as fair as possible, we assume in all cases that both weapons involve the secretion of the same (hypothetical) toxin, at the same rate kT,cell, with the same potency (lethal concentration) TC, and at the same growth cost c. For simplicity, the secretion rate is fixed within each simulation, while in reality many bacteria responsively upregulate toxin production via competition sensing70,71 and other mechanisms72. Here we outline the equations that link these properties between the two models, bridging the (discrete) contact model with the (continuum) diffusible toxin model. For contact weapons, the per-cell secretion rate kT,cell is given by kT,cell = ksecTsec, with ksec (h−1) the per-cell secretion rate, and Tsec (kgT) the mass of toxin released by each secretion event. For diffusible toxins, this can be expressed as kT,cell = kTɑ⍴l3 (terms defined as above) with l3 approximating the cell volume. The contact-dependent secretion rate ksec can therefore be related to the diffusible toxin Damköhler number, T, as T = Tsecksec/DTTCl. To relate the potencies of contact and diffusible toxins, we assume that Nhits is equivalent to the minimum number of contact events required to raise the intracellular toxin concentration to the lethal threshold TC:Nhits = TCl3/Tsec, with l3 approximating a cell’s volume as before. Moreover, by combining these equations, we can eliminate the (unknown) contact toxin load Tsec and compute T = ksec(l2/NhitsDT) for the two weapons operating at equivalent secretion rates. This relation highlights that toxin diffusivity DT is a crucial parameter for our model, because increasing DT is equivalent to reducing effective diffusible toxin production while keeping contact toxin production the same. While previous work has explored the interplay between toxin diffusivity, cost and environmental structure69, here we assume a fixed value for DT (that for colicin Ia73), which is towards the lower limit of the range explored by previous work69.

Simulation domain and protocols

All model simulations are run on an Lx-by-Ly rectangular domain with lateral periodic boundary conditions, representing a vertical 2D slice through a bacterial community. The base of the domain, y = 0, is an impenetrable substrate. The domain width Lx is fixed; its height Ly is set to track the maximum height py of bacterial cell groups as Ly = max(py) + δ, with δ the diffusive boundary layer thickness. To represent cell detachment through mechanical sloughing, cells are removed from the simulation once they reach a height hslougher. This provides a simple representation of a biofilm with a limited carrying capacity, and (by capping the number of simulated cells) allows simulations to be run for longer than if the population were allowed to increase indefinitely. All simulations are initiated by randomly scattering cells along the base edge of the simulation domain. Unless otherwise indicated, simulations run for a fixed duration of 400 steps (10 h of simulated time, timestep Δt = 0.025 h). Invasion simulations involve a two-step process: first, the domain is inoculated as above using only susceptible cells, which are then allowed to divide until the cell group reaches the slougher height hslougher. Then, a random sub-population of the susceptible cells is converted to the invading cell type, and the simulation is allowed to run for up to 1,000 steps (25 h), terminating early if either cell type is lost from the simulation.

Computation and postprocessing

All agent-based simulations were run using a 2017 Apple MacBook Pro laptop computer, with concurrent 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 visualized using Paraview software (5.4.0), and analysed using custom MATLAB and R scripts.

Experiments

Strain construction

Deletion mutants were constructed using standard two-step allelic exchange methods using the vector pEXG2 and Gibson assembly74,75. Strains constructed and used are summarized in Supplementary Table 3. Primer sequences for up/downstream regions and exterior confirmation primers are listed in Supplementary Table 4. Constructed deletion vectors were introduced into P. aeruginosa PAO1 by conjugation with E. coli JKE201 (ref. 76) and transconjugants were selected on lysogeny broth (LB) agar with 50 µg ml−1 gentamycin. After counter-selection on LB no salt, 10% sucrose, colony PCR positive clones were confirmed by Sanger sequencing (Source Bioscience) and gentamycin sensitivity confirmed. Stocks in LB 20% glycerol were stored at −80 °C. For strains with multiple deletions, they are listed in the order the deletions were made. Strains were subsequently constitutively tagged with eYFP and mScarlet (Sujatha Subramoni, unpublished) using pUC18-mini-Tn7-GmR77 delivered by conjugation with E. coli S17λ and selected on Pseudomonas Isolation Agar with 100 µg ml−1 gentamycin.

Engineering strains for weapon comparisons

For CDI-mediated competition, we deleted the three gene locus that encodes the CDI transporter, toxin filament and immunity (PA0040–PA0041), which resulted in a strain that does not have CDI and is susceptible to CDI. For pyocin R2, we found that deletion of wbpL led to susceptibility. wbpL is a transferase that initiates the formation of LPS chains by adding the first sugar to the undecaprenol-phosphate carrier, and in a previous study a cosmid library-derived insertional inactivation mutant was found to be resistant to pyocin R2 (ref. 49). For our purposes, we made an in-frame deletion mutant of wbpL from scratch, which grew poorly in liquid media. We reasoned that this was due to inhibition by its own pyocins. Consistent with this, making the wbpL mutant in a pyocin R2 deletion background restored growth. Moreover, this strain was then found to be susceptible to pyocin R2 from its parent. Finally, to confirm that wbpL was responsible for this susceptibility we complemented the in-frame deletion mutant of wbpL with a copy of wbpL on a plasmid, which restored pyocin resistance (Extended Data Fig. 4). On this basis, we are confident that, in our strain background, deleting wbpL leads to pyocin susceptibility.

wbpL was PCR-amplified from P. aeruginosa PAO1 genomic DNA and inserted into the expression vector pSEVA524 (Rubén de Dios, Eduardo Santero and Francisca Reyes-Ramírez, unpublished)78 by Gibson assembly (NEB Hifi Assembly, NEB Location). After conjugation with E. coli JKE201 and selection on LB 10 µg ml−1 tetracycline a positive clone and a clone carrying the empty vector were tested for susceptibility to pyocin R2. Strains were grown overnight at 37 °C in LB (with 10 µg ml−1 tetracycline), then 1 ml mixed with 7 ml 0.75% LB agar and poured onto a warm LB plate to generate an overlay. Attacker cultures were also grown similarly and R pyocins were prepared by filter sterilizing supernatant from overnight cultures. Twenty microlitres was spotted on the overlays, which were then dried and incubated overnight at 37 °C prior to photographing using a Gel Doc imager.

We also made a deletion of wapR, which attaches the first L-rhamnose to the LPS core, initiating LPS capping, which did retain resistance to pyocin R2. We then had two strains, ΔwbpL and ΔwapR, that are LPS defective, but one is susceptible to pyocin R2 and one is not. These strains were thus used for the long-range diffusible weapon experiments. To account for all fitness differences due to these LPS biosynthesis mutations in the absence of effects from pyocin R2, ΔR2ΔwapR was competed against ΔR2ΔwbpL (Extended Data Fig. 4), and this difference was used as a baseline for comparison when the pyocin was present in the ΔwapR strain. All strains are available upon request.

Culturing and the colony biofilm model

Strains were recovered from cryo stocks by streaking on LB 1.5% agar and incubating overnight at 30 °C. LB 1.5% agar for competitions was prepared immediately prior to competition setup by pouring 20 ml into a Petri dish and allowing it to set for 15 min in a laminar flow hood. Colony competitions were prepared as previously by scraping cells off the overnight plate and resuspending cells to an initial OD600 of 1 (ref. 51). Strains were mixed at defined ratios of 1:10, 1:1 and 10:1 then serially diluted 10-fold and 1 µl spotted on the prepared plate to generate competitions at various initial ratios and densities. Initial culture density was determined by serially diluting and spot plating. Independent biological replicates were performed with each attacker/susceptible combination carrying opposite fluorescent markers.

We performed competitions when cells were growing on agar (the ‘colony biofilm model’)51,52. In nature, most bacteria live in densely packed communities, such as surface-associated biofilms, which are densely packed and spatially structured53,63,79. These high-density conditions are where both short- and long-range weapons are expected to function at their best, because they ensure plentiful cell–cell contacts and the potential for factors released in the cells to build up to high concentrations40,41,80,81. Bacterial weapons can also strongly influence the spatial structure of competing strains, and vice versa; effects that are not captured in liquid culture28,63,82,83. Finally, P. aeruginosa’s CDI system is upregulated in structured static cultures, as compared to shaking culture, again suggesting these are the conditions where it has most impact46. Growing bacteria on agar captures these dense and structured conditions in a highly tractable manner, allowing large numbers of competitions and conditions to be studied and imaged33,51,84 (Fig. 2). Colonies also represent a good match to our model framework, which is again focused on high-density, biofilm-like conditions.

Imaging of colonies and quantification of competition outcomes

After 48 h of growth at room temperature, colonies were imaged using a Zeiss Axio Zoom V16 microscope with a Zeiss MRm camera, 0.5X PlanApo Z air objective and HXP 200 C fluorescence light source. Forty-eight hours allowed colonies inoculated from the lowest initial densities to grow sufficiently to be observed. All colonies from a single set of frequencies and densities were imaged at the same zoom (between ×1 and ×2.5). To make the composite images shown in the figures, the display histograms of each channel were scaled to the minimum and maximum values found in the entire set of frequency and density, meaning images can be compared within sets (that is, weapon competitions) but not between. For Extended Data Fig. 5, all images were treated as a set, so comparisons can be made across all images. After microscopy imaging, colonies were sampled with a 10 µl pipette at both the centre and edge of the colony into 0.9% saline. Samples were homogenized, serially diluted and 5 μl spotted onto LB or LB 50 μg ml−1 gentamycin and incubated at 30 °C overnight. Colonies were counted to determine the final ratio of the two strains.

Calculation of competitive advantage

Using the initial density counted from the original inoculum cultures and the known inoculum ratios, the initial ratio of attacker:susceptible strains was determined. The final ratio was determined from the colony forming unit (CFU) counts of the serially diluted centre and edge samples, with a detection limit of 2,000 CFU ml−1 used to replace zeros and prevent dividing by zero. Competitive advantage was defined as the final ratio/initial ratio and is plotted on log axes.

Statistical tests

Data were checked for normality by inspecting histograms and quantile–quantile plots, then confirmed using the Shapiro–Wilk test. As most (≥75% in each set) groups were normal, two-sided t-tests (Welch’s) were used to find significant differences between weapons. To account for multiple hypothesis testing, each group of tests was corrected using the Benjamini–Hochberg method. Data analysis and figures were carried out in R version 3.6.3 using the following packages: tidyverse version 1.3.2 (ref. 85), dplyr version 1.0.9, broom version 1.0.1, ggplot2 version 3.3.6, ggfx version 1.0.1, patchwork version 1.1.2 and scales version 1.2.1. Microscopy images were prepared for presentation using Image J version 1.53o86.

Reporting summary

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