Introduction

Natural selection and game theory1,2,3 predict that cooperative behaviors are vulnerable to the exploitation of common resources by selfish individuals because selfish individuals (cheaters) consume common resources to gain benefits without contributing fairly. In this context, selfish individuals are fitter, eventually resulting in the collapse of cooperation4 when the magnitude of selfish exploitation exceeds the capacity of a cooperative, a situation known as the ‘tragedy of the commons’5. By contrast, cooperation mediated by producing public goods is consistently observed in diverse life forms ranging from microbes to social animals; for example, the yeast Saccharomyces cerevisiae secretes enzymes to externally digest sucrose and thus facilitates sucrose metabolism at the group level6, and the ant Pristomyrmex punctatus collectively contribute their efforts to build and maintain the nest for their housing7. Because of their experimental accessibility and the extensive and diverse genomic data available, microbes are used as model organisms by researchers to probe social interactions at the molecular level and examine fundamental aspects of the origins of cooperation in well-defined systems3. In past decades, numerous theoretical and experimental investigations have elucidated several mechanisms and processes that promote cooperation in microbes, including kin selection/discrimination8, cooperation when surrounded by cooperators/quorum sensing9,10, punishment/policing11,12, pleiotropy13, phenotype variation/bistability14, spatial self-organization15, and adaptation to changing environments16.

Microbes have evolved elaborate strategies to adapt to nutrient scarcity and environmental stresses, which is generally believed to increase competition and reduce cooperation among them. For example, molecular mechanisms underlying decision-making enable bacteria to change their phenotypes or tune their gene expression to adjust to environmental or nutritional perturbations17,18 and to counter-attack when they sense nutrient limitation or direct cell damage19. We hypothesize that environmental stresses that induce competition may also stimulate the cooperator to compete and thereby to resist cheater invasion, thus in turn promoting the evolutionary stability of those cooperative traits. This hypothesis is supported by the findings of Xavier et al.20 who reported that swarming21, a form of cooperative motility mediated by rhamnolipid secretion, can be maintained in Pseudomonas aeruginosa because carbon-rich rhamnolipid is secreted only when nitrogen is more limiting than carbon.

To elucidate mechanisms that make cooperators robust to environmental stresses, such as starvation, antimicrobial treatment, or oxidative stresses, we investigated how P. aeruginosa regulates the production and secretion of iron-scavenging siderophores in the presence of different environmental stresses. In addition, we evaluated whether these environmental stresses can facilitate the persistence of bacterial cooperation in this cooperative system22,23. Using the combination of a single-cell tracking technique, experimental evolution, and theoretical modeling, we identified a strategy we term “conditional privatization” that can increase survival and resist invasion by non-producing cheaters in the presence of environmental stresses.

Results

Stress induce the pyoverdine accumulation in the periplasm

We used a spinning-disc confocal microscope with high spatiotemporal resolution to directly image and localize pyoverdine (PVDI), a fluorescent siderophore24. We observed that illumination with a violet laser light (405 nm) led to the accumulation of PVDI in the periplasms of single P. aeruginosa cells (Fig. 1a–c and Supplementary Movie 1). The PVDI concentration increased approximately eight-fold within 4 min when illuminance exceeded \(6.00\,\mathrm{mW} \, \mathrm{cm}^{ - 2}\). Fluorescent PVDIs were excited when illuminated by the 405 nm laser source. To decouple the imaging of PVDI and the light stimulus of cells, we carefully optimized laser power and exposure time to identify an excitation condition that would not lead to the accumulation of PVDI or affect the growth of cells. Figure 1d and Supplementary Figure 1 indicate that relatively weak illumination \(\left( { < 3.00\,\mathrm{mW} \, \mathrm{cm}^{ - 2}} \right)\) does not affect bacterial growth and the excitation condition \(\left( {0.10\,\mathrm{mW} \, \mathrm{cm}^{ - 2}} \right)\) does not result in PVDI accumulation. Therefore, \(0.10\,\mathrm{mW} \, \mathrm{cm}^{ - 2}\) excitation was applied to image PVDI in this study. The accumulation of PVDI in the bacterial periplasm may arise from two possibilities: (i) a specific response to the stimulus of violet/blue light25 or (ii) a general response to photon stress that typically leads to reactive oxygen species (ROS) generation in live cells26. To assess these two possibilities, next, we used a ROS-specific dye (2′,7′-dichlorofluorescin diacetate, H2DCFDA) in situ to monitor the intracellular levels of ROS in single cells27 stimulated with violet light \(\left( { \ge 6.00\,\mathrm{mW} \, \mathrm{cm}^{ - 2}} \right)\). This illumination led to the accumulation of PVDI in 2 min. ROS was generated within 8 min in single P. aeruginosa cells (Fig. 1e and Supplementary Movie 2), as indicated by bluish green to show green fluorescence, after stimulation with violet light \(\left( { \ge 9.00\,\mathrm{mW} \, \mathrm{cm}^{ - 2}} \right)\). This finding suggests that the accumulation of PVDI is a general response to photon stress rather than a specific consequence of the stimulus of violet/blue light. To further confirm this finding, we used a low dose of tobramycin, an aminoglycoside antibiotic, with concentrations near the minimal inhibitory concentration to treat P. aeruginosa to enable ROS generation28. A low dose of tobramycin also led to the accumulation of PVDI through ROS generation in cells (Fig. 1f). This result indicates that different environmental stresses, including photon and antimicrobial stresses, trigger the accumulation of PVDI in the periplasms of P. aeruginosa.

Fig. 1
figure 1

Environmental stresses trigger the accumulation of a bacterial siderophores in the periplasms of P. aeruginosa. Representative bright-field (gray) + confocal images show that a illuminations of violet-laser (405 nm, 6.00 \(\mathrm{mW} \, \mathrm{cm}^{ - 2}\)) trigger the accumulation of a bacterial siderophores (pyoverdine, PVDI) in wild-type P. aeruginosa within 4 min and b \(\Delta \mathrm{\it{pvdA}}\) cells did not produce PVDI despite illuminations (6.00 \(\mathrm{mW} \, \mathrm{cm}^{ - 2}\)), where the PVDI is indicated by blue colors. c Distributions of PVDI fluorescence intensities along the vermillion line across the bacterium shown in a for the time t = 0, 60, 120, 240 s, from bottom to top. d Photon-stress dependence of PVDI fluorescence intensity in single cells, where cells were exposed to violet-laser for 2 min. The dots and the line present data arising from single bacteria and from the average of multiple bacteria, respectively. e, f Normalized histograms of PVDI (blue bar) fluorescent intensities or ROS-specific dye H2DCFDA fluorescent intensities (bluish green bar) arising single cell in the presence of e different photon-stresses (0.75, 3.00, 4.50, 6.00, and 9.00 \(\mathrm{mW} \, \mathrm{cm}^{ - 2}\)) or in addition of f different amount of tobramycin (0.0, 1.0, 2.0, 3.0, and 4.0 µg mL−1), where cells were exposed to violet-laser for 2 or 8 min or tobramycin for 1 or 7 h, respectively. Scale bar for all images are 2 µm

Accumulated PVDI enables survival of bacteria under stresses

It has been reported that siderophore-mediated iron acquisition is required for resistance to ROS stress in the fungus Alternaria alternate29. This report motivated us to investigate the mechanism underlying the accumulation of PVDI in P. aeruginosa cells in response to ROS generation. Intracellular reactive species of superoxide (\({\mathrm{O}}_2\cdot\)) or peroxide (\({\mathrm{H}}_2{\mathrm{O}}_2\)) can damage Fe–S clusters and result in the release of free ferrous ions from the damaged clusters30. The released ferrous ions can subsequently catalyze \({\mathrm{H}}_2{\mathrm{O}}_2\) to form the most harmful hydroxyl radical (OH·) through the Fenton reaction31. PVDI accumulated in P. aeruginosa cells may chelate the released ferrous and thereby repress OH· formation, consequently protecting cells from oxidative damage. To directly validate this conjecture, we used a combination of propidium iodide (PI)-staining and ROS staining to examine whether a mutant strain \(\left( {\Delta \mathrm{\it{pvdA}}} \right)\) deficient in PVDI production32 can tolerate the photon or antimicrobial stress used to treat the wild-type strain. Under the treatment of violet light \(\left( {3.00\,\mathrm{mW} \, \mathrm{cm}^{ - 2}} \right)\), tobramycin \(\left( {1.0\,\mathrm{\mu g} \, \mathrm{mL}^{ - 1}} \right)\) or gentamicin \(\left( {2.0\,\mathrm{\mu g} \, \mathrm{mL}^{ - 1}} \right)\) in iron-limited conditions, a higher percentage of \(\Delta \mathrm{\it{pvdA}}\) cells (18.5% (p < 10−6), 23.1% (p < 10−6) or 25.3% (p < 10−6)) generated ROS than that of wild-type cells (1.2%, 9.9%, or 0.7%) (Fig. 2b, Supplementary Fig. 2c, Supplementary Movie 3) and a higher percentage of \(\Delta \mathrm{\it{pvdA}}\) cells (15.4% (p < 10−6), 15.4% (p < 10−6) or 8.2% (p < 10−6)) were damaged than that of wild-type cells (0.7%, 0.8% or 1.5%) (Fig. 2b, Supplementary Fig. 2d, Supplementary Movie 4). To further explore whether the protective activity of PVDI is due to the repression of the Fenton reaction, we examined whether PVDI can protect the wild-type and \(\Delta \mathrm{\it{pvdA}}\) strains from antimicrobial stress in iron-rich conditions. Our results indicate that PVDI does not protect cells by preventing ROS generation or cell damage in the presence of antimicrobial stress in iron-rich conditions (Supplementary Fig. 3a–d). This finding suggests that the chelation of excess iron is essential for the protection of cells from damage; therefore, the protective activity of PVDI declined in iron-rich conditions. These findings fully support our conjecture.

Fig. 2
figure 2

Accumulation of pyoverdine in bacteria allows them to survive in the presence of environmental stresses. a Representative bright-field (gray) + multi-color confocal images show that the accumulation or the exogenous addition of PVDI (5.0 \(\mu \mathrm{M}\)) enables wide-type P. aeruginosa or \(\Delta \mathrm{\it{pvdA}}\) mutant to survive in the presence of a stronger photon-stress \(\left( {3.00\,\mathrm{mW} \, \mathrm{cm}^{ - 2}} \right)\), where blue, bluish green or vermillion colors represents PVDI, H2DCFDA or propidium iodide (PI) fluorescent intensity respectively, \(\Delta \mathrm{\it{pvdA}}\) or \(\Delta \mathrm{\it{pvdA}}\Delta \mathrm{\it{fpvA}}\) represents a mutant that deficient in production of PVDI or deficient in both production of PVDI and uptake of exogenous PVDI, respectively. +exo PVDI represents the exogenous addition of 5.0 \(\mu \mathrm{M}\) PVDI. b Photon-stress dependence of PVDI (blue), H2DCFDA (bluish green) or PI fluorescence intensity (vermillion) in single cells, where the dots present data from single bacteria. \(\Delta \mathrm{\it{pvdA}}\) and \(\Delta \mathrm{\it{pvdA}}\Delta \mathrm{\it{fpvA}}\) + exo PVDI groups show significantly higher percentage than that of the wide type group, both for H2DCFDA channel and PI channel (one-way RM ANOVA versus wide type data, p < 10−6 for \(\Delta \mathrm{\it{pvdA}}\) and \(\Delta \mathrm{\it{pvdA}}\Delta \mathrm{\it{fpvA}}\) + exo PVDI). \(\Delta \mathrm{\it{pvdA}}\) + exo PVDI group shows no significantly difference with wide type group, both for H2DCFDA channel (p = 0.8054) and PI channel (p = 0.2557). The black dashed line represents an intensity threshold to distinguish whether the fluorescence intensities arising from single cells is significantly greater than the average. Single cells were exposed to light stimulations for 5 hours. Scale bar for all images are 4 \(\mu \mathrm{m}\)

Furthermore, we expected that only PVDI accumulated in bacterial periplasms—not secreted PVDI—can protect cells in the presence of environmental stresses. To test this prediction, we exogenously added PVDI (5.0 \(\mu \mathrm{M}\)) in the culture media for \(\Delta \mathrm{\it{pvdA}}\) cells or a double-mutant strain \(\Delta \mathrm{\it{pvdA}}\Delta \mathrm{\it{fpvA}}\) deficient in the uptake of exogenous PVDI (ePVDI)33, allowing only the \(\Delta \mathrm{\it{pvdA}}\) cells to absorb exogenous ePVDI. We observed that after the absorption of ePVDI, the fraction of \(\Delta \mathrm{\it{pvdA}}\) cells that died (0.8% (p = 0.2557) or 1.5% (p = 0.9725)) was similar to that of the wild-type strain in the presence of photon (Fig. 2b and Supplementary Movie 5) or antimicrobial (Supplementary Fig. 2b) stress, and the fraction of \(\Delta \mathrm{\it{pvdA}}\) cells that died was significantly lower than that of \(\Delta \mathrm{\it{pvdA}}\Delta \mathrm{\it{fpvA}}\) cells (19.8% (p < 10−6) or 24.0% (p < 10−6)) in the presence of photon (Fig. 2b and Supplementary Movie 6) or antimicrobial stress (Supplementary Fig. 2b). These findings demonstrate that the accumulation of PVDI in bacterial periplasms enables P. aeruginosa cells to survive in the presence of different environmental stresses.

Attenuation the efflux of PVDI for private use

We observed that the concentration of PVDI in the supernatant of bacterial cultures (wild type) negatively correlated with the concentration of tobramycin (Fig. 3a) when we used low dose tobramycin \(\left( { \le 1.0\,\mu \mathrm{g} \, \mathrm{mL}^{ - 1}} \right)\) to treat bacteria. Note that the tobramycin concentration applied in this experiment did not affect the growth of cells (Supplementary Fig. 1). By contrast, the concentration of PVDI accumulated in cells positively correlated with the concentration of tobramycin (Fig. 1e). These findings suggest that P. aeruginosa cells prefer reserving PVDI molecules intracellularly rather than secreting these molecules in the presence of antimicrobial stress. To quantify this phenomenon, we used the following rate equation to describe the kinetics of the intracellular concentration of PVDI \(\left( {[\mathrm{PVDI}]^i} \right)\):

$$\frac{{\mathrm{d}[\mathrm{PVDI}]^i}}{{\mathrm{d}t}} = P + \alpha [\mathrm{PVDI}]^o - \gamma [\mathrm{PVDI}]^i - \mu [\mathrm{PVDI}]^i,$$
(1)

where \([\mathrm{PVDI}]^o\) is the extracellular concentration of PVDI, P is the productivity of PVDI, a and γ are the uptake and efflux rates of extracellular and intracellular PVDI, respectively, and μ is the growth rate of a cell. Note that (1) exponential growth dilutes the intracellular concentration of PVDI with the constant of μ and (2) the ratio \(\left( {\gamma /\mu } \right)\) of the terms \(\gamma [\mathrm{PVDI}]^i\) and \(\mu [\mathrm{PVDI}]^i\) accurately quantifies how cells allocate their produced PVDI, in which \(\gamma /\mu > 1\) or \(\gamma /\mu < 1\) indicates that cells prefer to secrete or reserve PVDI molecules produced by themselves, respectively. To directly measure the value of \(\gamma /\mu\) in the presence of environmental stresses, we pre-cultured \(\Delta \mathrm{\it{pvdA}}\) cells (P = 0) in the presence of ePVDI (50 \(\mu \mathrm{M}\)) to allow them to absorb sufficient PVDI; we then rapidly removed all ePVDI from bacterial cultures by washing of a fresh medium \(\left( {\alpha [\mathrm{PVDI}]^o = 0} \right)\) and recorded the decline of \([\mathrm{PVDI}]^i\) as well as the growth of cells in situ in the presence of different photon stresses ranging from 0.10 \(\mathrm{mW} \, \mathrm{cm}^{ - 2}\) to 3.00 \(\mathrm{mW} \, \mathrm{cm}^{ - 2}\). These specific boundary conditions considerably simplify the Eq. (1). In all tested conditions, the decline of \([\mathrm{PVDI}]^i\) scaled linearly to the time elapsed (t) using a semi-logarithmic plot (Fig. 3b), indicating that the decline of \([\mathrm{PVDI}]^i\) in these \(\Delta \mathrm{\it{pvdA}}\) cells follows first-order kinetics: \(\left[ {\mathrm{PVDI}} \right]^i(t)/\left[ {\mathrm{PVDI}} \right]^i(t = 0) = {\mathrm{exp}}[ - \left( {\gamma + \mu } \right)t]\). The decay rate \(\left( {\gamma + \mu } \right)\) of \([\mathrm{PVDI}]^i\) correlated nonlinearly (Hill-like) with the magnitude of photon stresses (Fig. 3c), indicating that \(\gamma + \mu\) decreased considerably only in the presence of stronger photon stresses (> 0.50 \(\mathrm{mW} \, \mathrm{cm}^{ - 2}\)). Next, we evaluated the value of μ in the presence of different photon stresses (Fig. 3d), which enabled us to calculate directly the value of \(\gamma /\mu\). Note that the illumination conditions applied in this experiment did not affect the growth of cells. Figure 3e shows that the Hill-like transition existed in the profile of \(\gamma /\mu\), where the value of \(\gamma /\mu\) remained at a constant of 3.70 if photon stress was relatively low (<\(0.30\,\mathrm{mW} \, \mathrm{cm}^{ - 2}\)); however, its value rapidly decreased to 1.05 if photon stress became higher (>\(1.00\,\mathrm{mW} \, \mathrm{cm}^{ - 2}\)).

Fig. 3
figure 3

P. aeruginosa tunes down the efflux of PVDI in the presence of environmental stresses. a Representative regular + fluorescent photos show that the amount of PVDI in the supernatant of bacterial cultures negatively relates to the concentration of tobramycin, where all the bacterial cultures were harvested at an identical bacterial density (O.D.600 = 0.3). b Decline of PVDI fluorescence intensity in the presence of different photon-stresses indicates that bacteria tune down the efflux of PVDI, where dots and lines represent the average intensities and the fitting lines using exponential fitting, respectively, with the magnitude of the photon-stress of 0.1, 0.15, 0.3, 0.6, 0.66, 0.72, 0.82, 1.2, 1.8, and 3.0\(\mathrm{mW} \, \mathrm{cm}^{ - 2}\), from bottom to top. c-e Photon-stress dependence of c \(\left( {\gamma + \mu } \right)\), d μ, and e \(\gamma /\mu\), where \(\gamma\) or μ represents the PVDI efflux rate or bacterial growth rate, respectively. The error bars in cd are the standard deviation of experimental values

It has been reported that P. aeruginosa uses an efflux pump (PvdRT-OpmQ) composed of PvdR, PvdT, and OpmQ to secrete PVDI to the environment in a specific manner34. To further investigate whether the attenuation of PVDI efflux in the presence of environmental stress is caused by the tuning down of the efflux pump of PvdRT-OpmQ, we examined the response of the \(\Delta \mathrm{\it{pvdRT}} - \mathrm{\it{opmQ}}\) mutant deficient in PvdRT-OpmQ expression to photon stress. We found that the initial level of intracellular PVDI of \(\Delta \mathrm{\it{pvdRT}} - \mathrm{\it{opmQ}}\) mutant was markedly higher than that of wild-type cells (Supplementary Fig. 4), however, light stimulation (3.00 \(\mathrm{mW} \, \mathrm{cm}^{ - 2}\)) did not result in further accumulation of PVDI in \(\Delta \mathrm{\it{pvdRT}} - \mathrm{\it{opmQ}}\) cells. This finding strongly suggests that P. aeruginosa can specifically tune down the efflux pump of PvdRT-OpmQ in the presence of environmental stress. Hence, we conclude that an existing molecular mechanism enables P. aeruginosa cells to tune down the efflux pump of PvdRT-OpmQ to reserve public PVDI for private use in the presence of environmental stress. We term this mechanism ‘conditional privatization’.

Resistance of cheater invasion via conditional privatization

Griffin et al.23 reported that the cheating strain of P. aeruginosa (which does not secrete PVDI) eventually outcompetes the cooperative strain (wild type) in various iron-limited conditions, thus resulting in the collapse of cooperation. This collapse occurs because the cheater does not produce the metabolically expensive PVDI, but instead exploits the public goods secreted by cooperators. We predicted that conditional privatization enables the cooperative stain of P. aeruginosa to withstand invasion by cheaters in the presence of environmental stresses. To test this prediction, we mixed an equal ratio of cheater \(\Delta \mathrm{\it{pvdA}}\) and cooperator (wild type) strains and cocultured them for 30 days to allow them to evolve in the presence of environmental stresses. We adjusted the magnitude of environmental stresses by adding tobramycin to achieve various final concentrations (0.0 to 2.0 \(\mathrm{\mu g} \, \mathrm{mL}^{ - 1}\)) in the culture medium, with the ferric concentration ranging from \(1.0 \times 10^{ - 5}\) to \(5.0 \times 10^{ - 2}\mathrm{\mu M}\). We observed that under all iron-limited conditions, the \(\Delta \mathrm{\it{pvdA}}\) strain outcompeted the wild-type strain after 15 days in the absence of a stronger environmental stress ([tobramycin] \(\le 0.125\,\mathrm{\mu g} \, \mathrm{mL}^{ - 1}\)) (Fig. 4a–c); this finding is consistent with that reported in a previous study23. By contrast, the wild-type strain outcompeted the \(\Delta \mathrm{\it{pvdA}}\) strain after 7 days in the presence of a stronger environmental stress (\(1.0 \le\) [tobramycin] \(\le 2.0\,\mathrm{\mu g} \, \mathrm{mL}^{ - 1}\)). This result indicates that the presence of environmental stresses prevent invasion by the cheater strain. The protective activity of intracellular PVDI plays an essential role in the survival of the cooperator strain in the presence of environmental stress; however, exogenously added PVDI can protect the cheater strain \(\Delta \mathrm{\it{pvdA}}\) in the presence of environmental stress (Fig. 2, Supplementary Fig. 2). This finding indicates that public PVDI can be exploited by cheaters both to acquire iron in iron-limited conditions and protect themselves in the presence of environmental stress. We have summarized and plotted the results of our evolutionary experiments in Fig. 4d. This figure shows that as the environmental stresses intensify, the final evolutionary outcome changes, with the dominance of the cheater changing to that of the cooperator.

Fig. 4
figure 4

Conditional privatization stabilizes bacterial cooperation in the presence of environmental stresses. ac Direct evolution of the producer (cooperator, wild-type) and non-producer strain (cheater, \(\Delta \mathrm{\it{pvdA}}\) mutant) of PVDI in the presence of different amounts of FeCl3 (a 1 × 10−5 \(\mathrm{\mu M}\)), (b 0.005 \(\mathrm{\mu M}\)), and (c 0.05 \(\mathrm{\mu M}\)) and different amounts of tobramycin (0.0 to 2.0 \(\mathrm{\mu g} \, \mathrm{mL}^{ - 1}\)), where symbols and lines represent the experimental data and the theoretical calculations, respectively. The final concentration of tobramycin in each panel is 0.0, 0.125, 0.25 0.5, 1.0, and 2.0 \(\mathrm{\mu g} \, \mathrm{mL}^{ - 1}\), from bottom to top, respectively. d Producer fraction as a function of the ferric abundance and the normalized ROS stress, where the normalized ROS stress = [Tobramycin]/IC50, the symbol [] represents the concentration, IC50 = 2.0 \(\mathrm{\mu g} \, \mathrm{mL}^{ - 1}\). Colors represent the fraction of producers in the end of direct evolution, red or blue color indicates the cooperator or cheater dominated, respectively. Symbols represent the evolutionary outcomes arising from experiments in the presence different amount of ferric ions or tobramycin; i.e., 10−5 \(\mathrm{\mu M}\) (a), \(0.005\,\mathrm{\mu M}\) (b), 0.05 \(\mathrm{\mu M}\) (c) FeCl3, 0.125 (II), 0.25 (III), 0.5 (IV), 1.0 (V), 2.0 (VI) \(\mathrm{\mu g} \, \mathrm{mL}^{ - 1}\) tobramycin. e Schematic showing the principle response curves of the efflux of the public goods in the presence of various environmental stresses, where the curve with cyan, red or magenta color represents the conditional privatization, loyal cooperation or selfishness respectively. The error bars in ac are the standard deviation of experimental values

To determine the role played by conditional privatization in our evolutionary experiments, we built a theoretical model to link environmental stresses to evolutionary outputs by considering the following factors: (1) production of public goods (PVDI) enables the growth of all populations in iron-limited conditions, but this is metabolically expensive and thus reduces the growth rate of producers (Eqs. 2 and 3 in the Methods); (2) conditional privatization enables producers to reserve those public molecules for private use in the presence of environmental stresses, as indicated by the change from \(\gamma /\mu > 1\) to \(\gamma /\mu < 1\) when the magnitude of environmental stresses exceeds a certain threshold (Eq. 4 in the Methods); and (3) private use of public goods enables producers to survive in the presence of environmental stresses (Eq. 7 in the Methods). Note that our modeling based on solving the differential equations (Eqs. 812), but alternative modeling based on the adaptive dynamics framework also could be applied to determine the evolutionary role played by conditional privatization35,36. To directly compare evolutionary outputs arising from conditional privatization, we assumed that producers may employ distinctive strategies in response to environmental stresses (Fig. 4e), including (1) “loyal cooperation” through which a bacterium always secretes public goods despite environmental stresses, as indicated by a maintained constant of \(\gamma /\mu = \mathrm{cons.} \gg 1\) (Eq. 4 in the Methods) and (2) “selfishness” through which a bacterium does not secrete public goods, as indicated by a maintained constant of \(\gamma /\mu = \mathrm{cons.} \ll 1\) (Eq. 6 in the Methods). Theoretical calculations indicate that our modeling can reproduce evolutionary kinetics (as indicated by solid lines in Fig. 4a–c) and final evolutionary outcomes (as indicated by the color map in Fig. 4d) that are fully consistent with our experimental observations (as indicated by symbols in Fig. 4a–c or d) in all tested conditions. By contrast, our model predicts that bacterial cooperation would eventually collapse if a bacterium always secreted public goods despite environmental stresses (Fig. 5a). After comparing the evolutionary outcomes dominated by different strategies, including conditional privatization (Fig. 4d) and loyal cooperation or selfishness (Fig. 5a), we concluded that conditional privatization in the presence of environmental stresses is a novel mechanism that can prevent the “tragedy of the commons”.

Fig. 5
figure 5

Evolutionary outcomes dominated by different strategies. a Theoretical calculations show \(\gamma /\mu\) dependence of producer fractions as a function of the abundance of ferric ions and the normalized environmental stress, where \(\gamma /\mu\) ranges from selfishness (\(\gamma /\mu\) = 0.1) to loyal cooperation (\(\gamma /\mu\) = 50). b Schematic showing that conditional privatization stabilizes bacterial cooperation in the presence of environmental stresses

Competition in wild-type and ΔpvdRT—opmQ strain

First, we examined the growth rate of \(\Delta \mathrm{\it{pvdRT}} - \mathrm{\it{opmQ}}\) strain in different growth conditions to evaluate the cost of privatization of public PVDI. We found that (1) in the iron-limited condition of FeCl3 = \(1.0 \times 10^{ - 5}\,\mu \mathrm{M}\) (Supplementary Fig. 5) or FeCl3 = \(0.1\;\mu \mathrm{M}\), the growth rate of \(\left( \Delta \mathrm{\it{pvdRT}} - \mathrm{\it{opmQ}} \right)\) mutant (\(\mu _3 = 0.0032\,\mathrm{min}^{ - 1}\) at FeCl3 = \(1.0 \times 10^{ - 5}\mathrm{\mu M}\), Supplementary Fig. 8b or \(\mu _3 = 0.0035\,\mathrm{min}^{ - 1}\) at FeCl3 = \(0.1\,\mathrm{\mu M}\), Supplementary Fig. 9b) was slower than that of the wild-type strain (\(\mu _1 = 0.0039\,\mathrm{min}^{ - 1}\) at FeCl3 = \(1.0 \times 10^{ - 5}\mathrm{\mu M}\), Supplementary Fig. 8a or, \(\mu _1 = 0.0099\,\mathrm{min}^{ - 1}\) at FeCl3 = \(0.1\,\mu \mathrm{M}\), Supplementary Fig. 9a); and (2) the exogenous addition of PVDI (ePVDI = \(5.0\,\mu \mathrm{M}\)) markedly increased the growth rate of the \(\Delta \mathrm{\it{pvdRT}} - \mathrm{\it{opmQ}}\) strain (\(\mu _3 = 0.0100\,\mathrm{min}^{ - 1}\) at FeCl3 = \(0.1\,\mu \mathrm{M}\) + ePVDI = \(5.0\,\mu \mathrm{M}\), Supplementary Fig. 9c) in iron-limited conditions. These results arising from \(\Delta \mathrm{\it{pvdRT}} - \mathrm{\it{opmQ}}\) strain (constitutive privatization) indicated that (1) production of PVDI is metabolically expensive whether produced PVDI is public or private; (2) the secretion of private PVDI is beneficial to bacterial growth in the iron-limited condition; and (3) PVDI constitutive privatization strain can exploit public PVDI to benefit in iron-limited conditions.

Next, we predict the evolutionary outcome of competition between the wild-type (conditional privatization) and \(\Delta \mathrm{\it{pvdRT}} - \mathrm{\it{opmQ}}\) (constitutive privatization) strains using our theoretical model (see Methods). Our calculation indicated that (1) \(\Delta \mathrm{\it{pvdRT}} - \mathrm{\it{opmQ}}\) coexists with the wild-type strain in the presence of ROS stress (Supplementary Fig. 10a); and (2) the relative yield is negative in the coexistence region (Supplementary Fig. 10b). These results are in contrast with those of the competition of \(\Delta \mathrm{\it{pvdA}}\) and wild-type strain, in which the relative yield is positive in the region dominated by \(\Delta \mathrm{\it{pvdA}}\) cells (Supplementary Fig. 10c, d). There the results indicated that the \(\Delta \mathrm{\it{pvdRT}} - \mathrm{\it{opmQ}}\) strain is not able to invade the wild-type strain in the presence of ROS stress. To further test this, we predicted the evolutionary outcomes of competition among the wild-type (conditional privatization), \(\Delta \mathrm{\it{pvdRT}} - \mathrm{\it{opmQ}}\) (constitutive privatization) and \(\Delta \mathrm{\it{pvdA}}\) (cheater strain) strains. Supplementary Fig. 11a and b show that the wild-type strain is favored in the presence of ROS stress; that is, the wild-type strain cannot be invaded by either \(\Delta \mathrm{\it{pvdRT}} - \mathrm{\it{opmQ}}\) or \(\Delta \mathrm{\it{pvdA}}\) strain in the presence of ROS stress.

Roles played by private PVDI

To determine the roles played by private PVDI in our evolutionary experiments, we directly calculated the kinetics of the extracellular PVDI concentration (\([\mathrm{PVDI}]^o\)(t)), the growth rate (\(\mu _1\left( t \right)\) or \(\mu _2\left( t \right)\)), death rate (\(p_1\left( t \right)\) or \(p_2\left( t \right)\)), and intracellular PVDI concentration (\([\mathrm{PVDI}]_1^i\)(t) or \([\mathrm{PVDI}]_2^i\)(t)) of the cooperator or cheater strain during competition by using our theoretical model. Our calculations indicated that (1) the cooperator strain outcompetes the cheater strain in the presence of environmental stress (i.e., FeCl3 = \(5.0 \times 10^{ - 3}\mu \mathrm{M}\) and Tobramycin = \(2.0\,\mu \mathrm{g} \, \mathrm{mL}^{ - 1}\), Supplementary Fig. 12a); (2) the domination of the cooperator strain led to the accumulation of extracellular PVDI, resulting in a gradual increase of \([\mathrm{PVDI}]^o\) over time (Supplementary Fig. 12b); (3) an increase of \([\mathrm{PVDI}]^o\) led to an increase in the growth rate of both the cooperator and cheater strains (Supplementary Fig. 12c, note that \(\mu _2\left( t \right) > \mu _1\left( t \right)\) despite their increase); (4) the intracellular PVDI concentration was high in the cooperator strain (Supplementary Fig. 12e) because ROS stress triggers the privatization of PVDI, which further results in the reduction of the death rate of cooperator strain; and (5) the intracellular PVDI concentration in the cheater strain remains at a low level in the initial stage and then gradually increases with increase in \([\mathrm{PVDI}]^o\) (note that the cheater strain could also tune down the efflux of PVDI in the presence of environmental stress), which results in an increase in the death rate of the cheater strain in the initial stage, which gradually decreases in the later stage. These results indicated that the wild-type strain outcompetes those non-producers in the presence of ROS stress due to protective activity of intracellular PVDI. To further test this interpretation, we predicted the evolutionary outcomes of competition between the wild-type strain (conditional privatization) and \(\Delta \mathrm{\it{pvdA}}\) strain (cheaters) with an additional assumption that intracellular PVDI does not enable cells to survive in the presence of ROS stress. We found that under this assumption the cheater always outcompetes the cooperator strain despite ROS stress (Supplementary Fig. 13).

Discussion

We have shown that when P. aeruginosa is exposed to photon and antibiotic stresses, it suppresses secretion of the siderophore PVDI and instead reserves PVDI intracellularly. The intracellular PVDI protects cells from ROS damage and increases cell survival in stressful conditions. We term this strategy ‘conditional privatization’: the bacteria secrete public goods to cooperate with other cells in the absence of environmental stresses, whereas they reserve those public goods for private use once the environment becomes stressful. This conditional strategy outcompetes the non-producing, cheater strategy under environmentally stressful circumstances (Fig. 5b). The molecular mechanism of conditional privatization follows a hierarchical procedure: (1) environmental stresses generally trigger ROS generation in P. aeruginosa cells; (2) ROS triggers cells to tune down the efflux pump of \({\mathrm{PvdRT}} - {\mathrm{OpmQ}}\) to decrease the secretion of PDVI, leading to the accumulation of PDVI in cells; and (3) the accumulation of PVDI enables cells to survive in the presence of environmental stresses, presumably through the repression of hydroxyl radical formation. However, the mechanism through which the efflux pump of \({\mathrm{PvdRT}} - {\mathrm{OpmQ}}\) is tuned down in response to ROS remains elusive, meriting a more detailed investigation.

The private use of public goods by their producer might be a common mechanism that enables the persistence of cooperative behaviors in microbes. For example, Gore et al.37 reported that the budding yeast S. cerevisiae can retain approximately 1% of public goods for private use, and that such a seemingly insignificant level of privatization allows cooperative cells to invade a population of cheaters37,38. In addition, our findings highlight that environmental stresses affect cooperation in microbes, which may be compared to the effect of resource scarcity on cooperation in human society. For example, Gatiso et al.39 found that people who encountered resource scarcity were less cooperative compared with those who had more abundant resources in an investigation of the extraction of trees from a communally managed forest in Ethiopia. It should be emphasized that conditional strategies, including conditional cooperation or cheating, are quite general. For example, Rustagi et al.40,41 reported that conditional cooperation and costly norm enforcement can stabilize large-scale cooperation for common management. By contrast, our findings highlighted that one conditional strategy can coordinate the secretion of PVDI that plays the dual function; i.e., public PVDI for iron scavenging or private PVDI against ROS stress.

As a crucial opportunistic human pathogen, understanding the cooperation of P. aeruginosa is of great significance to clinical therapies42. Exploitation of iron in the hosts of P. aeruginosa depends on the cooperative production of siderophores43 and virulence correlates with siderophore production44. Therefore, our findings of how P. aeruginosa alters siderophore secretion in the presence of environmental stresses can not only advance our understanding of the maintenance of cooperation but also provide an opportunity to deepen our understanding of the relationship between cooperation and virulence. This advance may assist in the rational development of novel therapies for pathogenic populations45.

Methods

Bacterial strains and growth conditions

Bacterial strains and plasmids used in this study are listed in Supplementary Table 1. Strains were grown on LB agar plates at 37 °C for 12 h. Monoclonal colonies were inoculated and cultured with a minimal medium (SSM) at 37 °C under an aerobic condition, in which the medium had the following composition per liter: K2HPO4·3H2O, 7.86 g; KH2PO4, 3.00 g; (NH4)2SO4, 1.00 g; MgSO4·7H2O, 0.20 g; succinic acid, 4.00 g NaOH was added to the medium to adjust pH = 7.0 before sterilization. Different amounts of FeCl3 aqueous solution (pH = 2.0) were added to the medium with the resultant concentrations of 10−5, 0.005, 0.05, 0.1, or 100 \(\mu \mathrm{M}\) to generate iron-limited (FeCl3 = 10−5 to 0.1 \(\mu \mathrm{M}\)) or iron-rich conditions (FeCl3 = 100 \(\mu \mathrm{M}\)). Iron-rich or iron-limited conditions were also generated using the Casamino Acid medium (CAA) or CAA medium + 20 mM apotransferrin (Sigma-Aldrich), in which one liter CAA medium consists of Casamino Acid (BBI Life Sciences), 5.00 g; K2HPO4·3H2O, 1.18 g; MgSO4·7H2O, 0.25 g. Different amounts of tobramycin (0.0 to 4.0 \(\mu \mathrm{g} \, \mathrm{mL}^{ - 1}\)) or gentamicin (2.0 \(\mu \mathrm{g} \, \mathrm{mL}^{ - 1}\)) were added in the medium to adjust the antimicrobial stresses. We found that wild-type P. aeruginosa bacteria grow slowly in the CAA medium +20 mM apotransferrin during the first 12 h, reflecting iron limitation. However, growth became fast after 20 h of culturing and the bacterial culture eventually reached high density (OD = 1.0, 44 h), suggesting that iron abundance is no longer limited. This is presumably because P. aeruginosa can gradually secrete proteases that may degrade the apotransferrin46, thus releasing these chelating irons in the later stage. Most importantly, we found that PVDI cannot protect cells against ROS stress at a later culturing stage (24 h) (Supplementary Fig. 3g, h) in the CAA medium +20 mM apotransferrin, which would further result in a distinctive evolutionary outcome (Supplementary Fig. 13), in which the PVDI non-producer outcompetes the producer strain in the presence of antimicrobial stress47. Our results indicated that the CAA medium + 20 mM apotransferrin is not reliable in generating an iron-limited condition. Therefore, the SSM medium was used in our evolutionary experiments.

Construction of the P. aeruginosa mutants

Deletion mutants \(\Delta \mathrm{\it{pvdA}}\), \(\Delta \mathrm{\it{pvdA}}\Delta \mathrm{\it{fpvA}}\), \(\Delta \mathrm{\it{pvdRT}} - \mathrm{\it{opmQ}}\) were constructed by allelic exchange using a modified procedures for P. aeruginosa. We constructed unmarked deletion mutants by Flp-mediated excision of the antibiotic resistance marker48. Firstly, two DNA fragments, each obtained from upstream and downstream of target deletion genes by PCR, were cloned into a gene replacement vector pEX18Ap via a three-piece ligation. Then the constructed plasmid was inserted into a gentamicin/tetracycline resistant piece between upstream and downstream fragment. The final plasmid was electroporated into PAO1 and the corresponding recombinant strain was identified by screening on LB agar plates containing 5% (w/v) sucrose within 30.0 \(\mu \mathrm{g} \, \mathrm{mL}^{ - 1}\) gentamicin. Then the strains were electroporated with a pFLP2 plasmid and distinguished on LB agar plates containing 5% (w/v) sucrose for the excision of the resistance marker. Mutations were finally verified by PCR and sequencing. The constructed plasmids are listed in Supplementary Table 1. The PAO1 psfGFP, PAO1 pmCherry, PAO1 \(\Delta \mathrm{\it{pvdA}}\) psfGFP strains were constructed by specific insertion into PAO1 genome with the plasmid pUC18T-mini-Tn7T-Gm49. Firstly, target fluorescent protein piece was amplified by PCR and cloned into the plasmid pUC18T-mini-Tn7T-Gm. Then the plasmid carrying sfGFP/mCherry, was electroporated into PAO1 or PAO1 \(\Delta \mathrm{\it{pvdA}}\) with a helper plasmid pTnS2 and finally identified on LB agar plates containing 30.0 \(\mu \mathrm{g} \, \mathrm{mL}^{ - 1}\) gentamicin.

Pyoverdine extraction and purification

Pyoverdine extraction and purification were exactly followed as previously reported protocol50. Briefly, 1 litre conical flasks, which contained 200 mL SSM, was inoculated with PAO1. The bacteria were grown to exponential-phase under an aerobic condition at 37 °C. After that, the bacterial culture were centrifuged at 10,000×g for 10 min at 4 °C. The supernatant was further filtered by a 0.22 \(\mu \mathrm{m}\) filter (Merck Millipore). The cell-free supernatant was resuspended in 1 M HEPES buffer (pH = 7.0) and then applied to a Chelating Sepharose Fast Flow column (1 by 5 cm; GE Healthcare, eluent flow rate = 300 \(\mathrm{mL} \, \mathrm{h}^{ - 1}\)), where the column was pre-saturated with CuSO4 and equilibrated with 20 mM HEPES buffer (pH = 7.0) containing 100 mM NaCl. The column was then washed with 20 mM HEPES buffer and eluted with 20 mM acetate buffer (pH = 5.0) containing 100 mM NaCl. Fractions (5 mL) were collected and the absorbance at 400 nm (A400) of which was determined with a spectrophotometer (NanoDrop 2000, Thermo SCIENTIFIC). The pyoverdine-containing fractions were separately pooled and lyophilized. Each fraction of dried pyoverdine was dissolved with 1 mL 10 mM EDTA and then applied to a Sephadex G-15 column (1 by 80 cm; GE Healthcare) which wax pre-equilibrated with deionized water. The column was eluted with ultrapure water at a flow rate of 20 \(\mathrm{mL} \, \mathrm{h}^{ - 1}\) and 15 fractions (4 mL) were collected and monitored the absorbance of UV–Vis spectrum. The fractions with the highest absorbance at 385 nm were chosen as purified-pyoverdine and then were pooled, lyophilized and stored at −20 °C.

Observation of pyoverdine productions in vivo

Bacterial strains were inoculated into a flow cell (Denmark Technical University) and continuously cultured at \(30.0 \pm 0.1^\circ {\mathrm{C}}\) by flowing SSM medium (3.0 \(\mathrm{mL} \, \mathrm{h}^{ - 1}\))51 in the presence of different environmental stresses: illumination by 405 nm laser with different powers and exposure times was used to generate photon stresses with a controllable magnitude (0.1–10.0 \(\mathrm{mW} \, \mathrm{cm}^{ - 2}\)) and different amounts of tobramycin (0.0–4.0 \(\mu \mathrm{g} \, \mathrm{mL}^{ - 1}\)) or gentamicin (2.0 \(\mu \mathrm{g} \, \mathrm{mL}^{ - 1}\)) were added to the medium to generate antimicrobial stresses. The illuminances were determined using a laser power meter (Newport 842-PE). Meanwhile, a spinning-disk confocal microscope (Revolution Andor) equipped with a 100 × oil objective and an EMCCD (iXon 897i Andor) was applied to continuously record the bright-field and confocal images. The dyes of propidium iodide (PI, Sigma) with a resultant concentration of 1.0 \(\mu \mathrm{g} \, \mathrm{mL}^{ - 1}\) and 2',7'-dichlorofluorescin diacetate (H2DCFDA, Thermo Fisher Scientific) with a resultant concentration of 20 \(\mu \mathrm{M}\) were pre-added in the medium. The pyoverdine, H2DCFDA or PI was excited using a 405, 488, or 561 nm laser, respectively and imaged with three different emission channels (450, 524, or 607 nm). The confocal images with different channels were further analyzed to quantify the fluorescent intensities of single cells using a standard algorithm coded by Matlab, in which ≥2000 cells were typically counted for each condition.

Quantification of pyoverdine efflux rate under stresses

The strain (PAO1-\(\Delta \mathrm{\it{pvdA}}\)) was inoculated into the channel of flow cell and pre-cultured for 1 h by flowing (3.0\(\mathrm{mL} \, \mathrm{h}^{ - 1}\)) the SSM medium in the presence of 50.0 \(\mu \mathrm{M}\) purified PVDI. Then, a flash SSM medium in the absence of PVDI was used to wash surface-attached cells for 30 min to remove PVDI presented in the environment. Afterwards, the illuminations of 405 nm laser with different powers and exposure times were used to generate different photon stresses. Meanwhile, a spinning-disk confocal microscope (Revolution Andor) equipped with a 100 × oil objective and an EMCCD (iXon 897i Andor) was applied to continuously record the bright-field and confocal images, in which PVDI was excited using a 405 nm and imaged with a 450 nm emission channel. The confocal images or bright-field images were further analyzed to quantify the decline of PVDI fluorescent intensities detected in the bacterial periplasm or the growth rate of single cells, respectively, in the presence of different photon stresses.

Direct evolution of cooperator and cheater stains

The cooperator (PAO1 pmCherry) and cheater (PAO1 \(\Delta \mathrm{\it{pvdA}}\) psfGFP) strains were inoculated into SSM mediums at a 1:1 ratio in the presence of different amounts of \({\mathrm{FeCl}}_3\) (10−5, 0.005, 0.05 \(\mu \mathrm{M}\)) or tobramycin (0.0, 0.125, 0.25, 0.5, 1.0, and 2.0 \(\mu \mathrm{g} \, \mathrm{mL}^{ - 1}\)). The control group was set by inoculating a 1:1 ratio of strains PAO1 pmCherry and PAO1 psfGFP in the SSM medium in the absence of \({\mathrm{FeCl}}_3\) and tobramycin. Each condition was replicated three times. The resultant mixed bacterial cultures were further cultured in a shaker at 37 °C for 24 h. Afterwards, the bacterial cultures were diluted (v/v 1:1000) in fresh SSM mediums containing corresponding amounts of \({\mathrm{FeCl}}_3\) and tobramycin for the next round of culturing. Thirty rounds of culturing were performed in total. At the end of each round, a bacterial counting sample was carefully prepared by sandwiching 2.0 \(\mu \mathrm{L}\) bacterial culture between a coverslip and 2.0 mm thick agarose gel. Then, a spinning-disk confocal microscope (Revolution Andor) equipped with a 100 × oil objective and an EMCCD (iXon 897i Andor) was applied to directly image and count GFP or RFP-labeled bacteria, in which ≥104 cells were typically counted for each round.

Theoretical modeling and evolutionary analysis

In our model, we assume that the growth rate (\(\mu _1\) or \(\mu _2\)) of producer (cooperator) or non-producer strains (cheater) of PVDI relates to the ferric abundance in the environments ([Fe3+]) and the extracellular concentration of PVDI \(\left( {[\mathrm{PVDI}]^o} \right)\) as below,

$$\mu _1 = \mu _1^{\mathrm{max}} - \left( {\mu _1^{\mathrm{max}} - \mu _1^{\mathrm{min}}} \right)\,{\mathrm{exp}}( - a_1\left[ {{\mathrm{Fe}}^{3 + }} \right] - a_2[{\mathrm{Fe}}^{3 + }][\mathrm{PVDI}]^o),$$
(2)
$$\mu _2 = \mu _2^{\mathrm{max}} - \left( {\mu _2^{\mathrm{max}} - \mu _2^{\mathrm{min}}} \right)\,{\mathrm{exp}}\left( { - a_1\left[ {{\mathrm{Fe}}^{3 + }} \right] - a_2[{\mathrm{Fe}}^{3 + }][\mathrm{PVDI}]^o} \right),$$
(3)

where the parameters (\(\mu _1^{\mathrm{max}}\), \(\mu _1^{\mathrm{min}},\;\mu _2^{\mathrm{max}}\) and \(\mu _2^{\mathrm{min}}\)) are set by \(\mu _1^{\mathrm{max}}\) = 0.0160 \(\mathrm{min}^{ - 1}\), \(\mu _1^{\mathrm{min}}\)= 0.0039 \(\mathrm{min}^{ - 1}\), \(\mu _2^{\mathrm{max}}\)= 0.0163 \(\mathrm{min}^{ - 1}\) and \(\mu _2^{\mathrm{min}}\)= 0.0042 \(\mathrm{min}^{ - 1}\) (Supplementary Figs. 6, 7) according to the measurement of the actual growth rate of these strains in the iron-limited condition ([Fe3+] = \(1.0 \times 10^{ - 5}\) \(\mu \mathrm{M}\)) or in the presence of sufficient [Fe3+] ([Fe3+] = 1.0 \(\mu \mathrm{M}\)) and PVDI ([PVDI] = 5.0 \(\mu \mathrm{M}\)), the exponent of \(a_1\left[ {{\mathrm{Fe}}^{3 + }} \right]\) or \(a_2\left[ {{\mathrm{Fe}}^{3 + }} \right]\left[ {\mathrm{PVDI}} \right]^o\)in the Eqs. (2) and (3) reflects directly or indirectly uptake of the ferric iron. Note that \(\mu _2^{\mathrm{max}} > \)\(\mu _1^{\mathrm{max}}\) and \(\mu _2^{\mathrm{min}} > \mu _1^{\mathrm{min}}\), indicating that production of PVDI is metabolically expensive and thus reduces the growth rate of producers. We also assume that the ratio of PVDI efflux rate (γ) and bacterial growth rate (μ) for both strains (\({\gamma_1}/{\mu_1}\) or \(\gamma _2/\mu _2\)) is equal and follow the same equations in response to environmental stresses as below,

$$\mathrm{Conditional\;privatization}\frac{{\gamma _1}}{{\mu _1}} = \frac{{\gamma _2}}{{\mu _2}} = b_4 \cdot \left[ {\frac{1}{{1 + b_1\left( {\frac{{\mathrm{Ens}}}{{E_{50}}}} \right)^{b_2}}} + b_3} \right],$$
(4)
$$\mathrm{Loyal}\,\mathrm{cooperation}\frac{{\gamma _1}}{{\mu _1}} = \frac{{\gamma _2}}{{\mu _2}} \gg 1,$$
(5)
$$\mathrm{Selfishness}\frac{{\gamma _1}}{{\mu _1}} = \frac{{\gamma _2}}{{\mu _2}} \ll 1,$$
(6)

where \(\gamma _1/\mu _1\) or \(\gamma _2/\mu _2\) nonlinearly (hill-like) relates to the magnitude of environmental stresses (Ens) if bacteria follow conditional privatization, while \(\gamma _1/\mu _1\) and \(\gamma _2/\mu _2\) are independent of Ens if bacteria follow loyal cooperation or selfishness. Ens is normalized by dividing by the stress level (\(E_{50}\)) that leads 50% of cells to die. After the normalization, the coefficients \(b_1\), \(b_2\), \(b_3\), and \(b_4\) can be obtained from the fitting of the experimental data (Fig. 3e). Lastly, we assume that the death rate (\(p_1\) or \(p_2\)) for producers and non-producers relates to the magnitude of environmental stress, intracellular concentration of PVDI and ferric concentration as below,

$$\begin{array}{lll}p_1 = \left\{ {1 - {\mathrm{exp}}\left[ { - \frac{{c_1\frac{{\mathrm{Ens}}}{{E_{50}}} + c_4\mathrm{ln}\left( {\frac{{\left[ {{\mathrm{Fe}}^{3 + }} \right]}}{{\left[ {{\mathrm{Fe}}^{3 + }} \right]_{\mathrm{min}}}}} \right)}}{{c_2[\mathrm{PVDI}]_1^i + c_3}}} \right]} \right\}/\Delta t \\ \,p_2 = \left\{ {1 - {\mathrm{exp}}\left[ { - \frac{{c_1\frac{{\mathrm{Ens}}}{{E_{50}}} + c_4\mathrm{ln}\left( {\frac{{\left[ {{\mathrm{Fe}}^{3 + }} \right]}}{{\left[ {{\mathrm{Fe}}^{3 + }} \right]_{\mathrm{min}}}}} \right)}}{{c_2[\mathrm{PVDI}]_2^i + c_3}}} \right]} \right\}/\Delta t\end{array}$$
(7)

where the exponent \(\frac{{c_1\frac{{\mathrm{Ens}}}{{E_{50}}} + c_4\mathrm{ln}\left( {\frac{{\left[ {{\mathrm{Fe}}^{3 + }} \right]}}{{\left[ {{\mathrm{Fe}}^{3 + }} \right]_{\mathrm{min}}}}} \right)}}{{c_2[\mathrm{PVDI}]_1^i + c_3}}\) or \(\frac{{c_1\frac{{\mathrm{Ens}}}{{E_{50}}} + c_4\mathrm{ln}\left( {\frac{{\left[ {{\mathrm{Fe}}^{3 + }} \right]}}{{\left[ {{\mathrm{Fe}}^{3 + }} \right]_{\mathrm{min}}}}} \right)}}{{c_2[\mathrm{PVDI}]_2^i + c_3}}\) reflects the fact that intracellular PVDI can allow bacteria to survive in the presence of environmental stress and \({\mathrm{Fe}}^{3 + }\)would promote hydroxyl radical formation via Fenton reaction, \(\Delta t\) = 1 min.

We mix producer and non-producer strains to allow them to grow together in the presence of a given environmental stress, in which the dynamics of the system are assumed to exactly follow the differential equations as below,

$$\frac{{\mathrm{d}[\mathrm{PVDI}]_1^i}}{{dt}} = P + \alpha [\mathrm{PVDI}]^o - \gamma _1[\mathrm{PVDI}]_1^i - \mu _1[\mathrm{PVDI}]_1^i,$$
(8)
$$\frac{{\mathrm{d}[\mathrm{PVDI}]_2^i}}{{\mathrm{d}t}} = \alpha [\mathrm{PVDI}]^o - \gamma _2[\mathrm{PVDI}]_2^i - \mu _2[\mathrm{PVDI}]_2^i,$$
(9)
$$\frac{{\mathrm{d}[\mathrm{PVDI}]^o}}{{\mathrm{d}t}} = \phi _1\gamma _1[\mathrm{PVDI}]_1^i + \phi _2\gamma _2[\mathrm{PVDI}]_2^i - (\phi _1 + \phi _2)\alpha [\mathrm{PVDI}]^o - \delta [\mathrm{PVDI}]^o,$$
(10)
$$\frac{{\mathrm{d}\phi _1}}{{\mathrm{d}t}} = \phi _1(\mu _1 - p_1 - \delta ),$$
(11)
$$\frac{{\mathrm{d}\phi _2}}{{\mathrm{d}t}} = \phi _2(\mu _2 - p_2 - \delta ),$$
(12)

where \(\phi _1\) and \(\phi _2\) are the volume fractions \(\left( {\phi \equiv vN/V} \right)\) of producer and non-producer strains, respectively, \(v\) and \(V\) are the bacterial and the system volumes, respectively, \(N\) is the bacterial number, and \(\delta\) is the global dilution rate in our evolutionary experiment. \(\phi _1(t)\) and \(\phi _2(t)\) are obtained by directly solving these differential equations using the iterative method with following initial conditions, \(\phi _1(0) = \phi _2\left( 0 \right) = 10^{ - 7}\), \(\left[ {\mathrm{PVDI}} \right]_1^i(0) = [\mathrm{PVDI}]_2^i(0) = \left[ {\mathrm{PVDI}} \right]^o\left( 0 \right) = 0\;\mu M\). The parameters used in our model are listed in Table 1.

Table 1 Parameters used for the theoretical modeling

To improve the evolutionary analysis, we evaluated the total population size \(\left( {N\left( t \right)} \right)\) of the invading strain during the competition. Note that \(N\left( t \right) \equiv \phi (t)V/v\). To ensure that \(N\left( t \right)\) (or \(\phi \left( t \right)\)) is independent of δ, we normalized \(N\left( t \right)\) by \(N\left( t \right)/N_r\left( t \right)\) to calculate a relative yield defined as below,

$${\mathrm{Relative}}\,{\mathrm{yield}}\,\overset{\mathrm{def}}{=}\, \mathrm{log}_{10}[N\left( t \right)/N_r\left( t \right)],$$
(13)

where \(N_r\left( t \right)\) represents the total bacterial number of a reference strain (wild-type strain used for reference) grown under conditions identical to those used in the competition assay (i.e., identical iron abundance, ROS stress and initial bacterial number). As a result, the relative yield can be used to assess whether the tested strain can invade the wild-type strain; i.e., positive or negative relative yield (\(\mathrm{log}_{10}[N\left( t \right)/N_r\left( t \right)]\)>0 or \(\mathrm{log}\,_{10}[N\left( t \right)/N_r\left( t \right)]\)<0) represents that the tested strain can or cannot invade, respectively.

Data availability

All data generated or analysed during this study are available from the authors on reasonable request.