Introduction

Bacteria commonly live in densely populated, multispecies communities where they must compete for limited space and nutrients [1,2,3]. Life in these environments has driven the evolution of an array of bacterial weapon systems, used to inhibit or kill competing microorganisms [4, 5]. One of the most widespread and sophisticated of these weapons is the type VI secretion system (T6SS), a contractile nanomachine that fires a needle into neighbouring bacteria to deliver toxic effector proteins [6].

Possession of a T6SS can confer a strong ecological advantage to bacterial cells [7,8,9,10]. Conversely, being on the receiving end of a T6SS attack can be lethal. Defending against the T6SS, however, presents a unique set of problems for targeted cells, as—unlike many other weapon systems—the T6SS does not rely on the target cell’s surface receptors or transport systems. Instead, it uses mechanical force to pierce the target cell’s membrane and deliver its toxic cargo, which limits the potential range of mechanisms that can be employed in defence [11].

In the face of these challenges, here we show how bacteria can work together to protect themselves against T6SS attacks. Individual-level defence mechanisms are known, including immunity proteins, capsule formation, target modification, envelope stress responses, and the removal of susceptibility factors [12,13,14,15,16]. However, some of the most powerful defences in bacteria come about when bacteria act as a collective, allowing groups of cells to take advantage of their large numbers [17,18,19,20,21,22].

This project began when we serendipitously identified a potential collective defence mechanism against the T6SS while developing a computer game, as part of an outreach activity. The game—Gut Wars [23]—uses an agent-based model developed by our group for research [17, 24,25,26] to illustrate different bacterial warfare strategies in the human gut microbiome, and is freely available online for outreach at http://www.oum.ox.ac.uk/bacterialworld/gutwars/. Running the game repeatedly, we noticed that “Slimy” strategists, which secrete extracellular polymeric substances (EPS), were particularly resistant against “Stabby” competitors armed with the T6SS. Secretion of EPS is widespread among bacteria and plays a key role in the formation of biofilms [27, 28]. From observation of the game, we hypothesised that EPS has the potential to protect both the cell that produces it and others around it, thereby functioning as a powerful collective defence mechanism that had thus far been unappreciated. There is evidence that EPS has the potential to be physically resistant to T6SSs [12,13,14,15]. Moreover, biofilm formation—involving EPS secretion—is sometimes a response to bacterial competition via T6SSs [29]. We therefore decided to investigate whether EPS allows bacteria to work collectively in the face of T6SS attacks.

Here, we develop agent-based models of competitions between T6SS attackers and EPS-producing target cells. As suggested by the computer game, these analyses predict that secreting EPS is a collective defence mechanism in which producer cells both protect each other, and also cross-protect nearby non-producing cells. We test our predictions using a synthetic community, in which T6SS-wielding Acinetobacter baylyi compete with Escherichia coli strains secreting free (i.e., non-membrane-bound) EPS in amounts comparable to clinical E. coli isolates. These experiments revealed that EPS can indeed serve as a powerful collective defence against T6SS attacks. We identify two processes by which this collective defence can occur: (i) EPS sharing between cells and (ii) what we call “flank protection”, whereby groups of resistant cells shield non-producers without the need for EPS sharing. The latter process appears to be a very general route to collective defence, because it is predicted to occur whatever the underlying mechanism of protection against the T6SS.

Materials and methods

Agent-based modelling

We ran agent-based model simulations using the open-source modelling software Cellmodeller [30]. To simulate T6SS-mediated interactions and EPS particle secretion, we devised additional code modules, available for download at https://github.com/WilliamPJSmith/CellModeller. The key processes incorporated in our model are summarised here; the model’s parameters and their sources are summarised in Table S1.

Model description

Cell growth and division

Bacterial cells are modelled as exponentially growing, rigid elastic rods with fixed radius R, which push on one another as they elongate and divide (after doubling their initial volume V0, plus a small random noise term ηdiv). All cells are assumed to have equal access to growth-limiting nutrients. Generally, cells pay no growth penalty for using either T6SS needles or EPS secretion, and so a cell’s volume V increases over time as ΔV = kgrow V Δt, with kgrow the maximum specific growth rate, and Δt the simulation time step. However, we also explored scenarios in which EPS secretion carried a range of growth costs proportional to the EPS secretion rate (see Fig. S1). Each time step, immediately after cell growth, an elastic energy minimisation algorithm is applied to compute cell movements necessary to minimise total cell-cell overlap, subject to viscous drag forces acting on each cell. This process, described previously in detail [24, 30], approximates the elastic repulsion forces acting between cells in physical contact.

EPS secretion

Similar to previous work, we model agglomerations of EPS polymers as inert pseudospherical particles [31,32,33]. EPS+ cells secrete these particles from randomly chosen points on their surface. These particles have radius 0.4 μm, rod segment length 0.01 μm, and are assumed mechanically identical to bacterial cells. The secretion probability per time step, PEPS, is at most 0.1; larger values led to EPS particle numbers too large to be efficiently simulated. EPS particles persist indefinitely, and completely ignore the effects of T6SS toxin injection (see below). Following previous work [31], our model depicts loose EPSs very simply, modelling these as small, untethered spheres that can physically separate bacterial cells. While we show here that this simple representation can have striking and unexpected consequences for cell survival in a T6SS battle, it is important to consider the limitations of our model and their possible consequences. One obvious consideration that the model currently omits is the impact of EPS on cell adhesion and positioning [34]. For instance: EPS-mediated cell adhesion might promote clonal mixing between attacker and susceptible strains [35], perhaps offsetting T6SS protection via increased attacker contact.

T6SS interactions

Each time step, T6SS+ cells can fire needles of length R/2, projecting orthogonally from randomly chosen sites on their cell surface. The number of firings per cell per unit time is drawn from a Poisson distribution, whose mean is kfire. After firing, each needle is checked to determine if it comes into contact with any other cell in the population (line-segment method). Subsequent to this contact finding, each cell’s state is updated to indicate the number of T6SS needle hits it sustained. Cells die (cease growing) after being struck Nhits times in this way, and lyse (disappear) following a fixed delay of 1/klysis. Each T6SS needle can deliver its toxin payload to at most one cell. T6SS+ cells are assumed completely immune to their own T6SS toxins, such that they effectively ignore all collateral fire from clone-mates. EPS particles do not obstruct T6SS needles, and so EPS particles can only protect bacterial cells from T6SS attacks by enforcing spatial separation of attacker and susceptible cells.

Computation and post-processing

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 visualised using Paraview software and analysed using custom Matlab and R scripts.

Simulation protocols

All simulations were initialised by randomly scattering different combinations of cells on a flat surface, within a circular “homeland” of radius 50 µm. We explore the impact of varying initial cell density and strain frequency in Fig. S2. At simulation time t = 0, all cells lie flat on the surface, but have randomised orientations. All simulations were run for 130 time steps (Δt = 0.025 h), totalling 3.25 h of simulated time. Depending on conditions (most crucially, the number of EPS particles present), most simulations had a runtime of between 10 and 30 min (approximately 10 simulations per hour after concurrency). Simulation replicate numbers are provided in figure captions.

Gut Wars simulations

The CellModeller simulations depicted in our Gut Wars game (http://www.oum.ox.ac.uk/bacterialworld/gutwars/) [23] showcase different bacterial strategies for outcompeting rivals in the context of an (intestinal) community. Strains compete within a laminar box 160 μm wide and 40 μm high, bounded by a hard base and sides, representing a vertical 2-D section of a larger, 3-D community. A sloughing mechanism removes any cell whose height exceeds the box height. Cells begin with a coccoid shape at birth but elongate and divide lengthways. Simulations begin with 24 cells of each type placed randomly on the base of the box, which are then allowed to grow and compete for nutrients diffusing in from the top of the box. The nutrient model and solver software are the same as those described in [24] with the nutrient Damkohler number set to 0.01 (such that approximately the top 10 μm of cells in the community are perfused with growth-limiting nutrient). In Gut Wars, “Slimy” (EPS+, T6SS-susceptible) and “Stabby” (T6SS+) phenotypes, respectively, have specific growth rates of 0.75 and 0.95 h−1 (i.e., EPS production carries a stronger fitness penalty than do T6SS attacks). T6SS+ cells have kfire = 250.0 firings cell−1h−1, and the EPS secretion probability PEPS = 0.03 for EPS+ cells. Under these conditions, Slimy readily outcompeted Stabby, but it was unclear whether this outcome was specific to the limited simulations that were run for the purposes of the computer game. We therefore performed a more systematic study of the interaction using dedicated simulations, as presented here.

Bacterial growth conditions

All strains were routinely grown overnight in 5 ml LB medium (per L: 10 g Tryptone, 10 g NaCl, 5 g Yeast Extract) in 15 mL polypropylene tubes with agitation (220 rpm). Where necessary, the medium was supplemented with streptomycin (50 μg/mL), ampicillin (100 μg/mL), carbenicillin (100 μg/mL) or gentamycin (15 μg/mL). Routine culturing was carried out on 1.5% w/v LB Agar at 37 °C (E. coli) or 30 °C (A. baylyi). All pre-cultures and experiments were carried out at 30 °C on 0.8% w/v LB Agar, unless indicated otherwise. Optical density (OD) of liquid cultures was measured at 600 nm. For time-lapse microscopy experiments, samples were kept at 30 °C throughout the duration of the experiment using a custom-built incubation chamber.

Strain construction

For the generation of MG1655 mScarlet-I::Tn7 and MG1655 mTagBFP2::Tn7, MG1655 cells were transformed with either pGRG25-Pmax::mScarlet-I or pGRG25-Pmax::mTagBFP2 via electroporation and selected on ampicillin at 30 °C. The resulting transformants were cultured for 16 h at 30 °C in liquid LB medium supplemented with ampicillin and arabinose (0.5% w/v). A small volume (appr. 5 μL) of these cultures was streaked onto 1.5% w/v LB agar supplemented with arabinose (0.5% w/v) and incubated at 42 °C for 12 h. For each construct, three fluorescent colonies were then selected, streaked onto 1.5% w/v LB agar and incubated at 42 °C for 12 h. Resulting colonies were tested for ampicillin sensitivity. For the generation of E. coli MG1655 mScarlet-I::Tn7 pRcsA2, MG1655 mScarlet-I::Tn7 cells were transformed with pRcsA2 [36] via electroporation and selected on 100 μg/mL carbenicillin at 37 °C. All plasmids and strains used in this study are listed in Table S2.

Competition assays

To monitor growth and survival of different E. coli strains in competition with each other or with A. baylyi strains, overnight cultures of A. baylyi and/or E. coli were diluted (A. baylyi 1:10; E. coli 1:100) into 5 mL of fresh LB medium supplemented with appropriate antibiotics (Table S2) and 0.5 mM IPTG to induce production of colanic acid. We used vipA-sfGFP-labelled A. baylyi ADP1 as the T6SS-positive competitor, whereas an isogenic tssM deletion mutant was used as T6SS-negative control competitor. Cultures were then grown for 3 h with agitation, washed twice with LB medium, and resuspended and normalised in LB medium to an optical density at 600 nm (OD600) of 0.1. For experiments with two competitors an E. coli strain was mixed with either an A. baylyi strain or a different E. coli strain at a ratio of 1:1 (100 μL each). For experiments with three competitors, one A. baylyi strain and two E. coli strains were mixed at a ratio of 2:1:1 (A. baylyi: E. coli: E. coli). For each strain combination, 5 μL were then spotted in triplicates in 24-well plates pre-filled with LB agar supplemented with 0.5 mM IPTG (1 mL per well). For experiments at different seeding densities, the initial strain mixture was further diluted 10-fold (for OD = 0.01) or 100-fold (for OD = 0.001) before being spotted on LB agar. Plates were then dried in a laminar flow cabinet at room temperature for approximately 20 min to allow droplet drying, before being incubated at 30 °C for 6 h. After incubation, competition spots were washed off with 500 μL NaCl (0.8%) each and subjected to seven rounds of 10-fold serial dilution. Colony-forming units (CFUs) of A. baylyi and E. coli strains were enumerated by plating on streptomycin (100 μg/mL; selecting for A. baylyi), ampicillin/carbenicillin (100 μg/mL; selecting for E. coli MG1655 pRcsA2) or gentamycin (15 μg/mL; selecting for E. coli MG1655 GenR) media, incubated at 30 °C (A. baylyi) or 37 °C (E. coli).

Determination of T6SS firing rate

To determine T6SS firing rate in A. baylyi cells exposed to EPS produced by E. coli, cells of E. coli EPS+ and EPS− were grown overnight for 16 h at 37 °C, and 1 mL of bacterial suspension was centrifuged for 5 min at 17,000 g to sediment cells. The resulting supernatants were sterile-filtered using 0.2 μm syringe filters (Sartorius), and 5 μL were each pipetted onto separate cut-outs (ca. 5 × 5 mm) of 1% w/v LB agarose and left to dry for 20 min at room temperature. In parallel, cells of the focal strain (A. baylyi T6SS + clpV-mCherry2) were grown to exponential phase in liquid culture (OD600 ~ 0.8–1.0) before spotting 1 μL of culture onto the agarose pads treated with supernatant, and leaving them to dry for 5 min at room temperature. Pads were then inverted onto a 5-cm diameter glass bottom Petri dish with a 3-cm diameter uncoated n° 1.5 glass window (MatTek Corporation), so that the cells were sandwiched between the agarose and the glass. The sample was then moved to the microscope and imaged immediately. Time-lapse fluorescence microscopy was performed using a Zeiss Axio Observer inverted microscope with a Zeiss Plan-Apochromat 63x oil immersion objective (NA = 1.4) and ZEN Blue software (version 1.1.2.0). Time-lapse images were recorded for 3 min at a 12-second interval. Exposure times were 1.05 ms for brightfield and 500 ms for mCherry2 (ex: 589 nm | em: 610 nm). The rate of T6SS firing was measured in a total of N = 916 A. baylyi cells via detection of ClpV (mCherry) fluorescent foci [25]. Each new ClpV focus was assumed to mark one T6SS contraction event in a focal cell. Three separate fields of view at different locations on the same agarose pad were monitored for each treatment. Image analysis was performed using FIJI 2.1.0/1.53c [37]. For each field of view, total number of cells and ClpV foci were determined each minute via thresholding, segmentation and object counting in the brightfield channel, and the FIJI built-in “Find maxima” function in the mCherry fluorescence channel, respectively.

Colanic acid quantification

To quantify the amount of colanic acid (CA) produced by different E. coli strains (Fig. S3), 1 mL of overnight cultures were washed once with fresh LB medium and density-adjusted to an OD of 1.0. For each strain, 50 μL were then spotted in triplicates in 24-well plates pre-filled with LB agar supplemented with 0.5 mM IPTG (1 mL per well). Plates were then dried in a laminar flow cabinet at room temperature for approximately 20 min to allow droplet evaporation, before being incubated at 30 °C for 6 h. Cell material was then harvested by adding 1 mL of sterile ddH2O to the well and pipetting up and down until all material was suspended, and then transferred to a sterile 1.5 mL tube. Tubes were vortexed for 5–7 s, and the OD600 was determined for all replicates. Of these volumes, twice 400 μL were then transferred to two separate reaction tubes pre-filled with 600 μL ddH2O: one for quantification of total CA, and one for quantification of CA secreted into the extracellular environment. For quantification of total CA, samples were boiled for 20 min at 95 °C, centrifuged at 17,000 g for 20 min, and 1 mL of supernatant was used for further processing. For quantification of CA in the extracellular environment, samples were centrifuged at 17,000 g for 20 min, and 1 mL of supernatant was used for further processing. To test whether sterile-filtering removes EPS from supernatants (Fig. S4), E. coli MG1655 pRcsA2 (EPS+) and MG1655 GenR (EPS−) strains were grown overnight for 16 h at 37 °C, and 1 mL of bacterial suspension was centrifuged for 5 min at 17,000 g to sediment cells. The resulting supernatants were either sterile-filtered using 0.2 μm syringe filters (Sartorius) or left unfiltered, and 900 μL of supernatant was used for further processing. Relative CA production was then determined through the quantification of L-fucose [38]. Briefly, samples were boiled with 4.5 mL H2SO4 ∙ H2O (6:1 H2SO4 and H2O) for 20 min and cooled to room temperature. Then, 900 μL of each sample was transferred to a spectrophotometer cuvette and absorbance was measured at 396 nm (A396) and 427 nm (A427). To each cuvette was then added 100 μL of freshly prepared L-cysteine hydrochloride (1 M), mixed by pipetting, and absorbance was again measured at 396 nm (A-cy396) and 427 nm (A-cy427). The concentration of L-fucose was then determined by calculating (A-cy396 − A396) − (A-cy427 − (A427) and applying a previously generated L-fucose standard curve (0–100 μg/mL).

Confocal microscopy

To image competition dynamics, fluorescently tagged versions of all relevant strains (Table S2) were pre-cultured and density-adjusted to OD600 = 0.1 as described in “Competition assays”. For each strain combination, 5 μL were then spotted onto a glass bottom Petri dish filled with 8 mL 0.8% w/v LB agar supplemented with 0.5 mM IPTG. After drying for ten minutes at room temperature, the plate was inverted to allow for immediate imaging of the competition area through air. Time-lapse confocal imaging was then carried out using a Zeiss Plan-Apochromat 10x objective (NA = 0.45) on a Zeiss LSM880 confocal laser scanning unit using ZEN Black software (version 14.0.18.201). Images (each covering an area of 472 × 472 μm) were acquired hourly for 6 h, over 5 different colony positions, spanning in total the entire radius of the competition area (edge to centre). Three biological replicates were carried out for each strain combination.

Confocal image analysis

Image segmentation and stabilisation

Following acquisition, raw confocal image data were analyzed using FIJI [37]. Multichannel images were split into individual channels, with each channel subjected to separate background subtraction (rolling ball radius 50 px) and conversion to binary image data via user-defined thresholds. To maximise the accuracy of cell group boundary tracking, we stabilised images using the FIJI “StackReg” plugin [39], applied to the GFP (A. baylyi) channel. This stabilisation made it necessary to exclude the final time point (t = 6 h) as these images were typically confluent, confounding accurate registration. We also excluded colony position 1 (colony edge); here, coffee-ring effects [40] consistently led to the formation of 3-D cell groups as early as 2 h into the competition. As our image analysis is limited to 2-D, we were unable to accurately track inter-strain boundaries at this position. For visualisation purposes, mtagBFP2 fluorescence is false-coloured orange in all images throughout the manuscript.

Inter-strain boundary length (flank protection)

Beginning with our stabilised, segmented timelapse images, we measured the lengths of A. baylyi–EPS− group interfaces by dilating A. baylyi cell group images (MATLAB imdilate method; 3 pixel spherical structuring element), computing their overlap (in pixels) with EPS+ cell groups, and then summing overlapping pixels. We verified that performing this procedure in reverse (dilate EPS− onto A. baylyi) yielded similar boundary pixel counts. To account for the greater initial abundance of EPS− cells when EPS+ was absent (2:2 A. baylyi: EPS− ratio instead of 2:1:1 A. baylyi: EPS− : EPS+), we normalised these boundary measurements by the initial relative abundance of the EPS− strain (that is, dividing interface lengths by 2 for E. coli strains growing alone). EPS+ exposure to the attacker was calculated and normalised in the same way. This normalisation likely underestimates the role played by flank protection, because it assumes that a focal strain growing alone with the attacker will start with double the exposure as compared to when it is growing with the other E. coli genotype. In reality, the exposure in the single E. coli treatments is likely to be less than double, so that the normalisation leads to a lower estimated exposure than reality. To understand why, it is helpful to consider what happens when additional E. coli cells are present at the beginning of an experiment. In some cases, these will form independent microcolonies that increase the interface with A. baylyi, as our normalisation reflects. However, in other cases, these additional E. coli cells will simply merge with existing groups instead of growing alone. As a result, starting with more cells will not always proportionally increase attacker exposure. For these reasons, we may underestimate the exposure of E. coli growing alone with the attacker. Nevertheless, our measure provides a conservative test of whether flank protection is contributing to cross-protection in experiments because we still see that exposure of EPS− is reduced by the presence of EPS+.

Normalised invasion rates (EPS sharing)

To estimate T6SS killing rates at inter-strain boundaries, we tracked changes in strain occupancy at each pixel across consecutive time-lapse images, using custom MATLAB scripts. We compared consecutive time points (t-1, t; t = 1,2,3,4,5 h) in each stabilised time lapse: any pixel where EPS− channel signal was replaced with new A. baylyi signal was marked as being “invaded” by A. baylyi, giving a measure of EPS− cell killing by the attacker. For each time point t, EPS− invasion pixel counts were normalised by the total amount of A. baylyi–EPS− contact found in the t-1 image. EPS+ invasion was calculated and normalised in the same way.

Statistical analysis

Statistical analysis and data visualisation were performed using RStudio version 1.2.5033 [41] and packages dplyr [42], Rmisc [43], ggplot2 [44], and cowplot [45], as well as Matlab version 2017b (9.3.0.713579). For all statistical tests, the significance level α was set to 0.05. To test whether cell recovery differed between competitions, two-way ANOVA of log-transformed CFU values with a post-hoc Tukey’s HSD test was performed. To test whether colanic acid production differed between strains (Fig. S3B), whether EPS production incurred a growth cost (Fig. S3C), and whether firing rate differed when cells were exposed to EPS (Fig. S4A), two-sided Wilcoxon rank sum tests were performed. To test whether filtering removed EPS from supernatants (Fig. S4B), a two-sided, paired samples Wilcoxon signed rank test was performed. To test whether total attacker exposure or total normalised invasion of the EPS− strain changed when grown alongside the EPS+ strain (or vice versa), we used one-sample Kruskal–Wallis tests. Statistical details (sample size, test values, p values) for each experiment are provided in the respective figure legends.

Results

Agent-based modelling predicts that EPS can protect against T6SS

Bacteria have evolved a wide repertoire of traits and strategies to increase their survival chances in densely populated communities. We recently devised a simple browser-based computer game—Gut Wars [23]—to showcase some of these competition strategies in a format accessible to children as well as adults. The game asks the user to select different characters representing distinct bacterial competition strategies, which are then pitted against each other in a simulated gut microbiome environment using agent-based modelling (Fig. 1A). Two of the available strategies are EPS production (“Slimy”) and T6SS firing (“Stabby”), both common traits in bacteria. While not originally implemented to fulfil this function, we noticed that (i) “Slimy” bacteria were highly resistant to T6SS attacks, and (ii) the simulated EPS particles covered a large area around the producing cells. This led us to ask whether the secretion of loose (i.e., non-membrane-bound) EPS could protect cells from T6SS firing events, and so help EPS-producing bacteria survive when faced with a T6SS attacker.

Fig. 1: Agent-based modelling of EPS secretion demonstrates collective defence against the T6SS.
figure 1

A Snapshots of our agent-based computer game Gut Wars, showing EPS-producing “Slimy” bacteria outcompeting T6SS-armed “Stabby” rivals. Visit http://www.oum.ox.ac.uk/bacterialworld/gutwars/ to play the game itself. B Agent-based simulations compete T6SS attackers (green) with EPS non-producing (EPS−, PEPS = 0.0) and EPS-producing (EPS+, PEPS = 0.1) susceptible cells (orange and magenta, right and left columns, respectively). Snapshots show (i) initial cell seeding (0 h), with 400 cells of each type scattered within a circular homeland, and (ii) cell configuration after 3 hours of competition (3 h). Scale bars: 50 µm. Zoomed sections highlight dead (black) susceptible cells and distribution of EPS particles. Inset scale bars: 10 µm. C Contour plot showing measurements of mean EPS benefit (see main text) as a function of initial attacker and susceptible cell density. N = 20 simulation replicates per parameter combination. D Plot showing susceptible final : initial cell counts against initial susceptible density, exemplifying density-dependent benefit of EPS production (fixed attacker density of 400 cells). Individual data points are shown; lines and error bars correspond to means and standard deviations. Dashed line denotes final : initial susceptible ratio = 1, i.e., no net loss or gain of susceptible strain. N = 20 simulation replicates per parameter combination; data replotted from (C).

To explore these questions, we implemented EPS secretion within an existing individual-based model of T6SS competition [25, 26]. Following previous models [31,32,33], EPS production is modelled as cells secreting loose, spherical particles into the environment, at a rate PEPS (see Methods). As they grow, divide, and secrete EPS, producing cells create small pockets of EPS particles around themselves, which helps to separate cells from T6SS-wielding competitors (Fig. 1B). We do not assume here that EPS can physically block T6SS needles, as this effect may not be universal [15]. However, were this to occur, the expectation is that it will only increase the protection conferred to cells.

We performed simulation parameter sweeps to identify conditions where EPS production was most protective against T6SS attacks. Comparing simulations with and without EPS (EPS+, EPS−; respectively, PEPS = 0.1, 0), we used a simple metric to quantify the benefit of EPS protection:

$${\it{EPS}}\,{\it{benefit}} = \left( {N_{susc}\left( {t_{end}} \right)/N_{susc}\left( {t_{start}} \right)} \right)_{EPS + } - \left( {N_{susc}\left( {t_{end}} \right)/N_{susc}\left( {t_{start}} \right)} \right)_{EPS - },$$

with Nsusc(t) the number of surviving susceptible cells present at time t. Thus, EPS benefit summarises how well EPS producers survive, relative to their initial numbers, compared with non-producers. Varying the starting number of attacker and susceptible cells (same Nsusc(tstart) for EPS+ and EPS− simulations) shows that EPS production always offers at least some T6SS protection (EPS benefit > 0), and that production is most beneficial for intermediate attacker and susceptible cell densities (Fig. 1C).

We performed additional simulations to test the robustness of EPS-mediated T6SS protection with respect to other simulation parameters (Fig. S1). Repeats of competition simulations with different EPS production rates showed that, as might be expected, susceptible survival decreases as the per-cell rate of EPS secretion is reduced (Fig. S1A); below a minimal secretion rate, survival is indistinguishable from that of a non-producing susceptible strain. We also tested a model in which EPS production is costly, such that susceptible cells suffer a growth penalty proportional to their EPS production rate,

$${\it{Susceptible}}\,{\it{growth}}\,{\it{rate}} = k_{grow}\left( {1 - c_{EPS}P_{EPS}} \right),$$

with kgrow the maximum cell growth rate, PEPS the probability of EPS secretion per simulation time step, and cEPS the unit cost of EPS production. For various cEPS > 0, costly EPS production remains net-beneficial to susceptible cells (Fig. S1B), such that the optimal secretion rate PEPS* > 0. Predictably, EPS investment collapses for excessive costs (Fig. S1B), and is contingent on attacker presence (Fig. S1C). Overall, our simulations predict that production of loose, non-membrane-bound EPS is an effective means for cells to protect themselves against the T6SS, even when costly.

EPS protection is predicted to function as a collective trait

We next used the simulations to more formally evaluate whether EPS protection is a collective trait. A key feature of many collective traits is a positive relationship between the number of individuals with the trait, and the benefit conferred [46]. To look for this, we plotted the benefit of EPS production against the starting number of susceptible (EPS producer) cells, which revealed that the relationship is positive for many levels of EPS secretion (Fig. 1D, S1A, B). Note that our metric controls for any density-dependent survival effects emerging solely from changes to cell group size [47]. That is, while survival is expected to generally increase with susceptible cell number, this effect becomes much stronger when susceptible cells also produce EPS (Fig. 1D).

Next, we examined the extent to which the benefits from EPS production are shared among cells, which is a second key feature of collective traits. Using the same competition protocol as before, we ran simulations pitting T6SS attackers against susceptible EPS− cells, susceptible EPS+ cells, or both together (Fig. 2A), for increasing initial total cell densities. (Please note that this analysis is in contrast to Fig. 1C, D, where we vary attacker and susceptible initial densities independently). We then quantified the survival of both the EPS+ cells and the EPS− cells when they grew either (i) alone with the attacker or (ii) paired with the other susceptible cell type (Fig. 2B). As expected when the protective effect of EPS is shared between cells, EPS− survival increased in the presence of EPS+ cells (Fig. 2B, “rescue”), and, conversely, EPS+ survival decreased in the presence of EPS− cells (Fig. 2B, “exploitation”).

Fig. 2: Modelling and experiments show that EPS secretion protects both producer and non-producer E. coli from T6SS attacks.
figure 2

A End-state snapshots of agent-based simulations competing T6SS attackers (green) with EPS− or EPS+ (orange, magenta) strains, or both strains at once. B Survival of each susceptible strain (EPS+, magenta; EPS−, orange) growing alone against T6SS attackers (dashed lines), or together with the other susceptible strain type (solid lines). Asterisk denotes the scenario depicted in (A); N = 5 simulations per case. (C + D) We conducted analogous competition assays in vitro between three bacterial strains: A. baylyi ADP1 (T6SS attacker), E. coli MG1655 GenR (EPS−), and E. coli MG1655 pRcsA2 (EPS+; colanic acid overproducer). For each strain, cell recovery (CFU) after 6 h of co-culturing at different starting cell densities (optical density; OD) is shown. Individual data points (N = 3) and their means are shown as dots and lines, respectively. Arrows highlight key comparisons. C Survival of E. coli EPS− (left), EPS+ (centre) or a 1:1 mix of EPS− and EPS+ (right), when competed against T6SS+ A. baylyi. At high seeding density (OD = 10−1), EPS+ cells survive pairwise competitions against a T6SS attacker better than EPS− cells (centre and left; p < 0.0001). When co-cultured with EPS+ and competing against the attacker (right), survival of EPS−cells is strongly increased relative to when they face the attacker alone (left; p < 0.0001). When EPS+ cells are co-cultured with EPS− and compete against the attacker (right), EPS+ survival is reduced compared to when they face the attacker alone (left; p < 0.0001). D Repeat of (C) with A. baylyi lacking a functional T6SS. When competed against a T6SS− attacker in pairwise competitions, no difference in cell recovery between EPS+ and EPS− cells was detected (p = 0.66). For both (C) and (D), competitions were analysed per strain combination and seeding density, with statistical analyses on log-transformed data via two-way ANOVA (α = 0.01) with Tukey post-hoc tests (****p < 0.0001).

A synthetic community demonstrates collective protection via EPS

To test the model’s predictions empirically, we turned to an established experimental system for studying T6SS killing: competitions between a T6SS+ A. baylyi attacker strain and a T6SS-susceptible E. coli strain (MG1655; [48]). Using their T6SS, A. baylyi cells can inject a cocktail of different effector proteins into neighbouring cells which rapidly induce lysis in susceptible E. coli [25]. To compare the relative T6SS susceptibility of EPS-producing and non-producing E. coli, we created E. coli MG1655 pRcsA2 (EPS+), a strain capable of undergoing IPTG-inducible production of the exopolysaccharide colanic acid, which is a major component of natural E. coli biofilms [49, 50]. Colanic acid production is induced via plasmid-based expression of RcsA, the major positive regulator of colanic acid biosynthesis in E. coli [36]. Its plasmid-free parent MG1655 serves as the non-EPS-producing control strain (EPS−), as MG1655 does not produce significant amounts of colanic acid under the conditions used in this study (Fig. S3).

We first measured the amount of colanic acid secreted by the EPS+ strain, as well as tested where it is localised with respect to the cell membrane. Across E. coli strains, colanic acid can be secreted both as a capsule tethered to the producing cell membrane, as well as in untethered, loose form [51]. We reasoned that the difference between these two states is likely to influence the role of colanic acid in collective protection from external assaults. To benchmark our colanic acid quantification and localisation assays, we compared the EPS+ and EPS− strains to six clinical E. coli isolates (Table S2). As for the majority of the clinical isolates, phase-contrast microscopy showed that our EPS+ strain has no visible membrane-bound capsule. This observation is consistent with colanic acid being untethered from producing cells and released into the extracellular environment (Fig. S3A). This conclusion was further supported by colanic acid quantification assays where we measured the amount of colanic acid found in total cell extracts vs. supernatant fractions of cultures harvested from agar plates. For the EPS+ strain, the entirety of the detected colanic acid was recovered in the supernatant (Fig. S3B). This same assay also revealed that the amount of loose colanic acid secreted by EPS+ is comparable to that secreted by two clinical isolates (#0172 and #0993, Fig. S3B). To test whether this level of EPS production incurs a growth cost, we competed EPS+ against EPS− at a range of starting densities, and found no significant difference between the two strains (Fig. S3C). This suggests that, at least in rich nutrient medium and under laboratory conditions, production of colanic acid does not incur a significant growth penalty. The EPS+ E. coli strain, therefore, secretes loose colanic acid at rates comparable to naturally occurring E. coli EPS producers, allowing for a direct test of the role of EPS in T6SS-mediated competitions.

We compared the EPS+ and EPS− E. coli strains in competition against a T6SS-wielding A. baylyi (ADP1; T6SS+) and a T6SS-deficient mutant (ADP1 ΔtssM; T6SS−). We seeded a 1:1 mixture of A. baylyi with either EPS+ or EPS− E. coli at various densities on agar plates and measured strain recovery after 6 h of co-culture using selective plating (Fig. 2C). At low seeding densities, the T6SS is less efficient because it relies on cell-cell-contact for killing [25, 47]. At high seeding densities, we expect the T6SS to be maximally effective; this was confirmed in our competition assays, as the EPS− control strain suffered maximal killing at high densities (Fig. 2C, left). In contrast, the EPS+ strain survived much better at high densities (Fig. 2C, centre), with a 105-fold increase in survival against T6SS+ A. baylyi compared to EPS−. This advantage was dependent on T6SS-activity, as there was no detectable difference in recovery between EPS+ and EPS− after pairwise competition with the T6SS− A. baylyitssM) mutant (Fig. 2D). To test whether the presence of EPS in the environment alters T6SS activity, we measured firing rates in hundreds of T6SS+ A. baylyi cells exposed to cell-free supernatants with and without EPS, and were unable to detect a difference (Fig. S4). These results strongly support our model’s prediction that non-membrane-bound EPS can protect susceptible cells from killing by the T6SS.

We then examined the potential for a producer strain to cross-protect a non-producer, as expected for a collective defence mechanism. We conducted 3-way competitions between T6SS+ A. baylyi and both the EPS+ and EPS− E. coli (2:1:1 ratio of A. baylyi: EPS+ : EPS−) and quantified strain recovery as above. At high seeding densities, as predicted by the model, the survival of EPS− increased 1000-fold in the presence of EPS+ (Fig. 2C, right) compared to when they faced the T6SS attacker alone (Fig. 2C, left), indicating that the presence of secreted EPS can rescue otherwise susceptible cells from T6SS attacks even if they do not produce EPS themselves. Further, consistent with the modelling, we observed that relative survival of the EPS+ strain decreased in presence of EPS− (Fig. 2C, right) compared to when grown alone with the T6SS attacker (Fig. 2C, left) suggesting that the presence of non-producing cells partially compromises the protective effects of EPS production.

Cross-protection can emerge from flank protection

Our modelling and experiments show that EPS can function as a collective defence, whose benefit is shared among cells in a colony or biofilm. We next sought to understand the mechanism(s) underpinning this collective property. We initially reasoned that loose EPS would protect cells from T6SS attacks and be shared between cells, resulting in the protection of non-producing cells seen in both modelling and experiments. To test this hypothesis, we modified our model so that EPS+ cells no longer secreted loose EPS particles, but instead became intrinsically resistant to T6SS attacks (requiring 2 hits to kill instead of 1). The goal of this model was to remove the possibility of EPS sharing between cells, so that we could test whether sharing was necessary for the cross-protection of non-producer cells (Fig. 3).

Fig. 3: Modelling shows that cross-protection can occur without EPS sharing.
figure 3

Modelling shows that cross-protection can occur without EPS sharing. (A) End-state snapshots of agent-based simulations competing T6SS attackers (green) with an EPS− strain (orange), a T6SS-resistant strain (purple) that secretes no EPS particles, or both strains at once. Box corresponds to zoomed section in C. B Survival of Resistant strain (purple) and the EPS− susceptible strain (orange) growing alone against T6SS attackers (dashed lines), or together with the other strain type (solid lines). Asterisk denotes the scenario depicted in A; N = 5 simulations per parameter combination; lines denote mean survival. C Magnified views showing Resistant strain shielding EPS− from the attacker (top), similar to when protection occurs via secretion of loose EPS (bottom).

We then competed the resistant cell type against T6SS attackers as before, either in the presence or absence of the EPS− susceptible cell type (Fig. 3A). To our surprise, this again led to collective T6SS defence, which displayed both cross-protection and the same density-dependence seen for loose EPS (Fig. 3B). Close inspection of simulations revealed that resistant cells act as barriers, protecting the flanks of susceptible cell groups by physically separating them from T6SS attackers (Fig. 3C). We therefore term this mechanism “flank protection”. Because it involves one set of cells protecting others, flank protection is also a collective effect, but one that can be provided by a purely private resistance mechanism, as well as by loose EPS.

Time-lapse microscopy reveals both flank protection and EPS sharing

Our modelling raised the possibility that EPS-producing bacteria can collectively defend themselves against T6SS attacks via flank protection, without sharing of EPS between cells. However, an important simplification of the model is that it represents EPS as solid spheres. This limits the ability of EPS to flow past and around cells, restricting sharing in a manner that may not always reflect real EPS [52]. We sought, therefore, to explore both hypotheses—EPS sharing and flank protection—as potential explanations for the collective effects seen in our experiments. To do this, we turned to time-lapse confocal microscopy, which enables direct observation of cells over time (Fig. 4). We competed fluorescent protein-expressing strains of A. baylyi (vipA-sfGFP, green) with EPS+ E. coli (mScarlet, magenta) and EPS− E. coli (BFP, orange) and performed competitions on agar pads as before, except we imaged different locations in the competition area hourly, using confocal microscopy. End-state images of the competition area (Fig. 4A) provided visual confirmation of (i) improved survival of EPS+ relative to EPS−, and (ii) improved survival of EPS− in the presence of EPS+. Surviving EPS− cells also tended to co-localise with EPS+ cells (bottom right), similar to the behaviour observed in our model.

Fig. 4: Timelapse microscopy shows that EPS producers cross-protect non-producers via both flank protection and EPS sharing.
figure 4

A Top row: A. baylyi attacker (green), EPS− (orange) and EPS+ (magenta) E. coli strains expressing fluorescent proteins were mixed and co-cultured as before (Fig. 2C, D), this time analysing competition dynamics using confocal microscopy. Colonies were imaged for 6 h at 1 h intervals, across five 470 × 470 µm frames spanning the colony edge (position 1) to its centre (position 5). Example images shown are zoomed-in areas of interest from position 4 (t = 6 h); scale bars: 50 μm. Bottom row: magnified views of individual-based model snapshots corresponding to the experimental scenarios shown in microscopy images. Scale bars: 5 μm. B Automated image analysis to identify flank protection: when the EPS− strain is cultured alone (top), its exposure to the attacker (grey boundary) is greater than when the EPS+ strain is occluding part of the EPS− group flank (bottom, cyan boundary). C Time plots of A. baylyi exposure for EPS− (left) and EPS+ (right) strains, grown alone (dashed lines) or together (solid lines), and normalised by initial relative abundance. D Comparison of total normalised exposure (area under curves in D) across all strain pairings, including T6SS− controls. “A” and “T” denote “Alone”, “Together”. E Automated image analysis to identify signatures of EPS sharing: when the EPS− strain is cultured alone (top), it is invaded more rapidly by the attacker than when EPS+ is present (bottom), consistent with EPS being shared between E. coli strains. F, G as with (C, D) but now measuring A. baylyi invasion rates, normalised by boundary length. In (C, D, F, G), lines connect means, and error bars denote standard deviations. Time-lapse data were aggregated over colony positions 2–5; position 1 was excluded for analysis since cells quickly grew beyond a monolayer, confounding our 2-D analysis. N = 3 biological replicates; 12 data points per time point. Red crosses denote outlier data points (< Q1 - 1.5 * IQR or > Q3 + 1.5 * IQR). Significance assessed using one-sample Kruskal–Wallis tests: *p = 0.0327; ***p = 0.0004; N.S. non-significant (p > 0.05).

To look for signatures of flank protection and EPS sharing, we used automated image analysis to track the movement of boundaries between A. baylyi and E. coli cell groups in our time-lapse data. We reasoned that, if cross-protection occurs via flank protection (Fig. 4B), we should observe a reduction in the EPS− strain’s total exposure to A. baylyi attackers. More formally, we should observe a reduction in the length of the interface between A. baylyi and EPS− cells, when the EPS+ strain is present, versus when it is absent. Alternatively, if cross-protection occurs via the association of loose EPS with EPS− cells (Fig. 4E), then an EPS− cell group should be able to withstand encounters with the T6SS attacker better when EPS+ producers are present as opposed to absent. Note that the tests we develop are not able to estimate the relative importance of flank protection vs EPS sharing because the measures used in each test are not directly comparable. Nevertheless, we are able to test whether each play a role in the collective benefits of EPS production.

To test for flank protection, we measured the length of A. baylyi–EPS− and A. baylyi–EPS+ group interfaces over time (see Methods). We compared competitions where the susceptible strains grew alone alongside the attacker with those where both susceptible strains were present. To account for the greater initial abundance of EPS− cells in the former case (2:2 A. baylyi : EPS− ratio instead of 2:1:1 A. baylyi : EPS− : EPS+), we normalised boundary measurements by the initial relative abundance of each E. coli strain (that is, dividing interface lengths by 2 for E. coli strains growing alone). As we further discuss in the methods, this normalisation is likely to provide a conservative test of whether flank protection is contributing to cross-protection in experiments (see Methods). Shown in Fig. 4C, these normalised measurements confirm that EPS− indeed has reduced exposure to the attacker when co-cultured with EPS+ (“together”) vs. without (“alone”), with the improvement being most pronounced between hours 3 and 4 of competition. Comparing total attacker exposure (area under curves in Fig. 4C) of each susceptible strain grown alone or together, alongside analogous measurements for T6SS− controls (Fig. 4D), we find that the presence of EPS+ significantly reduces EPS− exposure to A. baylyi, consistent with the flank protection hypothesis. Conversely, EPS+ exposure changes only marginally in the presence of EPS−, which is consistent with the inability of the EPS− strain to effectively shield the flanks of EPS+ groups.

To assess EPS sharing, we measured the rate of A. baylyi encroachment into EPS+ and EPS− cell groups (Fig. 4E), normalising this by the total length of interface between A. baylyi and each individual susceptible strain (see Methods). The resulting metric, which we term the normalised invasion rate, provides an estimate of how susceptible each E. coli strain is to T6SS attack. Importantly, since the normalised invasion rate examines A. baylyi–EPS+ and A. baylyi–EPS− strain interactions separately, it excludes any possible effects of flank protection. Measurements of normalised invasion rates over time showed that the EPS− strain was indeed invaded less rapidly when grown together with the EPS+ strain, vs. when grown alone (Fig. 4F, left). Meanwhile, the EPS+ strain was invaded at a consistently lower rate (Fig. 4F, right) than the EPS− strain, with normalised invasion rates largely unchanged by the presence/absence of the EPS− strain (i.e., no significant exploitation effect detected). This variation was contingent on T6SS activity: control experiments showed minimal variation in EPS− strain invasion with EPS+ strain presence when attackers lacked a functional T6SS (Fig. 4G, right).

In conclusion, our analyses suggest that both processes—flank protection and EPS sharing—contribute to the collective benefits of EPS when cells are exposed to T6SS attackers.

Discussion

The production of EPS is a defining property of bacterial biofilms, where the majority of bacteria are thought to spend their lives [28]. A key challenge for bacteria living in biofilms is the potential for exclusion by competing strains and species [4]. Our modelling shows how EPS production can help with this challenge by allowing bacteria to work together and protect themselves against armed competitors. Moreover, an experimental test of our model revealed that EPS dramatically increases E. coli survival in competition with T6SS-wielding A. baylyi. Here, colanic acid is secreted into the extracellular environment and we find evidence that it has the potential to protect cells other than the producer. Secretion of colanic acid is widespread in Enterobacteriaceae such as E. coli, Klebsiella, Salmonella, and Enterobacter [53, 54], where it plays an important role in biofilm formation [49, 50, 55], and confers protection against various environmental stressors such as desiccation, osmotic stress, and oxidative stress [56, 57]. Moreover, elevated EPS production (mucoidy) readily evolves in E. coli and other species in response to predation by phages [58,59,60], and membrane-anchored capsules can protect pathogenic bacteria from attacks by the immune system [61,62,63]. EPS-mediated protection from T6SS attacks could, therefore, evolve as a by-product of adaptation to other types of stressors, as well as a direct response to T6SS attacks itself.

Both our modelling and experiments showed that EPS non-producing cells are able to survive T6SS attacks better when co-cultured with EPS producers. Our initial hypothesis was that this cross-protection stemmed from the sharing of loose EPS between EPS producers and non-producers. Unexpectedly, however, our simulations identified a second cross-protection mechanism, whereby groups of T6SS-resistant producers reduced the exposure of non-producers to attackers (flank protection). We turned to image analysis of our experimental system to examine these possibilities, which suggested that both flank protection and EPS sharing are important in practice. The role we find for EPS secretion implies that secreted EPS can shield non-producing cells, at a range spanning multiple cell lengths, in a manner not seen in the model. This finding does not necessarily imply that EPS has evolved to be shared with non-producers, however. Cross-protection of nearby non-producing cells can arise as a by-product of natural selection for sharing between cells of the same EPS-producing genotype. Indeed, social evolution theory predicts that the benefits from shared traits will typically fall on the producing genotype, if they are to be evolutionarily stable [33, 64, 65]. Such high-relatedness conditions are common during biofilm growth [64].

Overall, our findings suggest that EPS production will frequently result in collective resistance to T6SS attacks, including in cases where EPS is not shared between cells [15]. Flank protection, in particular, has the potential to be highly general: it is predicted to emerge whenever sensitive cell groups interface with resistant cell groups, without assuming anything about the underlying resistance mechanism. Flank protection, therefore, has the potential to be mediated by other mechanisms of T6SS resistance, such as envelope stress responses [13, 16], or the production of immunity proteins [14]. Indeed, we hypothesise that flank protection has the potential to occur against any contact-dependent weapon, including against the T4SS, T7SS, and Cdi (contact-dependent growth inhibition) systems [4], adding further complexity to interbacterial interactions. Such effects underline the potential for third parties to weaken interactions between bacterial strains in diverse communities. This idea is known from the study of bacterial cooperation, whereby the presence of other species can limit the potential for cooperating strains to work together (“social insulation”) [65, 66]. As such, flank protection is an example of a higher-order interaction [67] that extends beyond simple spatial segregation known to occur between two warring strains [68] and highlights the need to consider community context in interbacterial aggression.

T6SS-wielding bacteria are increasingly being considered as potential biotherapeutics, capable of delivering toxins into pathogenic bacteria [69, 70]. Our work cautions that many species have the potential to resist such attacks due to the widespread ability of bacteria to work as collectives. Consistent with this, bacteria are already known to display collective defences against antibiotics [17, 19, 22], predators [71] and phage [20], and biofilm formation continues to be a major issue in industry and medicine [72,73,74,75]. Strategies that seek to remove problem strains, therefore, need to consider the ability of bacteria to work both as individuals and as groups.