Introduction

The understanding of how microorganisms mediate adaptive changes to ensure survival under changing environmental conditions requires monitoring of the corresponding stress response pathways. RpoS, SOS, and RpoH are critical stress response pathways that modulate transcriptional pathways through a broad spectrum of stress stimuli, with implications for biofilm formation and proliferation1,2, pathogen virulence3, antibiotic resistance4, evolution4 and ecological competition5. RpoS is an alternative sigma factor which regulates, directly and indirectly, about 500 genes in Escherichia coli (E. coli)6. Known as the general stress response, RpoS activation is mainly stimulated by starvation as an indicator of physiological stress7. The SOS response on the other hand comprises more than 50 genes that bear several functions in response to DNA damage induced by chemical, physical or biological agents8. Hence, SOS response upregulation is associated with cell genotoxicity. The alternative sigma factor RpoH is the key regulator of the heat-shock stress response in E. coli that encompasses more than 30 genes9,10. Activation of the RpoH response is stimulated by the accumulation of unfolded proteins in the cell as indication of cytotoxicity.

In view of the high relevance of these biological processes for technology and medicine, a comprehensive understanding of the underlying molecular mechanisms is of outstanding importance. For example, monitoring cellular responses to multiple stressors can make an important contribution to understanding cell viability and productivity11, such as product inhibition, nutrient deprivation, pH, or shear stress12, as well as for monitoring a variety of environmental toxicants, such as herbicides or antibiotics13. A multimodal analysis of microbial stress response would therefore be important not only for basic research but also for biotechnological processes.

Towards this goal, several genetically-encoded bacterial biosensors have been developed12,13,14,15,16,17,18. Commonly used reporter elements are the colourimetric β-galactosidase (lacZ)15 and bioluminescence (luc, lux)16 reporters. Since these systems usually require cell lysis, multi-step assays, or catalytic reactions which limit online measurement and multi-colour reporting, fluorescence-based reporters have been developed for the analysis of stress response17,18. However, the currently available systems lack the ability to report the multimodal response of living cells with high spatiotemporal resolution. We here describe a genetically-encoded three-colour fluorescent biosensor that simultaneously displays bacterial response to physiological stress, genotoxicity, and cytotoxicity through monitoring of the corresponding stress response pathways (Fig. 1 and Supplementary Fig. 1).

Fig. 1: Starvation, genotoxicity and cytotoxicity are being reported via the RGB-S reporter plasmid in E. coli.
figure 1

Activation of the RpoS, SOS and RpoH stress response pathways leads to expression of red, green and blue fluorescent proteins, respectively, as indicated by fluorescence microscopy images. Scale bar is 50 µm.

Results and discussion

Sensor construction and validation

To realize a robust multi-colour stress response reporter with high signal-to-noise ratios, three promoters of the model organism E. coli K12 MG1566 were selected: PsulA is a strongly induced promoter during the SOS response that indicates DNA damage (genotoxicity)19, and PosmY from the RpoS regulon is an indicator of nutrient starvation, osmotic, and other physiological stresses20. The chaperon promoter PgrpE is involved in the heat-shock RpoH response, which gets activated due to intracellular accumulation of unfolded proteins that are indicative of cytotoxicity16,21. Three orthogonally detectable fluorescent protein (FP) variants with red (mRFP1)22, green (GFPmut3b)23, and blue (mTagBFP2)24 colours were selected to enable simultaneous read-outs of pathway activation (Supplementary Table 1). The coding sequences for the three FPs were optimized for high protein translation rates25 in E. coli to secure adequate signals even under conditions of growth inhibition. Since FP synthesis and maturation play a significant role in fluorescence signal initiation26, we used the enhanced fluorescent proteins GFPmut3b23 and mRFP122 which mature faster than the native ancestors. By fusing the FPs downstream of the promoters, the fully assembled RGB-S reporter (for red, green blue stress reporter) contained the genetic elements of PosmY::mRFP1 for indication of physiological stress, PsulA::GFPmut3b for genotoxicity, and PgrpE::mTagBFP2 for cytotoxicity (Supplementary Fig. 1). To prevent artefacts from translational read-through of one reporter element to the others, strict transcriptional terminators were added between the sensing elements, resulting in an individually triggered response of the isolated sensor elements (Supplementary Fig. 1). The tribble biosensor cassettes were cloned in a multi-copy plasmid backbone and maintained by kanamycin selection.

To initially verify the specificity and robustness of the RGB-S reporter in both microscopy analysis and quantitative bulk measurements, its performance was compared with previously published systems. To this end, E. coli transformed with the RGB-S reporter was exposed to the herbicide glyphosate. As expected, the upregulation of the starvation response occurred27, resulting in a substantial expression of red fluorescent protein (RFP) (Fig. 2a). Likewise, presence of the antibiotic nalidixic acid (NA) that interferes with the DNA gyrase to impair DNA fidelity and induce SOS response28, triggered the expected expression of green fluorescent protein (GFP). Notably, fluorescence imaging also enabled the identification of unique cell morphologies, such as cellular filamentation. This phenotype is characteristic of the late stage SOS response29 and it was clearly visible in the GFP channel of cells exposed to NA (Fig. 2a) or ciprofloxacin (Supplementary Fig. 2). Treatment of the cells with methanol, which is known to affect the membrane permeability besides other cytotoxic modes of action30, led to induction of a significant blue fluorescent protein (BFP) signal (Fig. 2a). However, the fold change observed for BFP is lower than for the other two fluorescent proteins, likely since the cytotoxicity indicated by the sensor reports misfolding events, which might also affect the BFP itself. In addition to microscopy analysis, the response of the RGB-S reporter to stresses could also be monitored in bulk culture to enable detailed quantitative assessment of the kinetics and dose-dependency of drug treatment (Fig. 2b and Supplementary Fig. 3). Treatment of E. coli harbouring RGB-S reporter (RGB-S E. coli) with defined dosages of stressors clearly showed the expected dose-dependent increase of the corresponding fluorescent signal over time. Notably, the most accurate results for most stressors can be acquired during the first five hours while cells grow actively, after which stochastic readouts might be observed due to accumulated and interfering stress signals in aging cells (Supplementary Fig. 4). Furthermore, we checked for plasmid stability in the presence and absence of kanamycin selection during prolonged stress assays. We found that the absence of kanamycin selection did not affect RGB-S reporter plasmid stability in aging and diluted cultures (Supplementary Fig. 5). However, a general decline of the specific fluorescence signal was observed in the diluted culture, indicating potential decline of plasmid copy number due to the continuous cell division (Supplementary Fig. 5c, d).

Fig. 2: Orthogonal fluorescence readout of stress response reveals time and dose dependencies.
figure 2

a Fluorescence microscopy images of planktonic E. coli harbouring RGB-S reporter exposed to various stressors for 5 hours. Scale bar is 50 µm. b The corresponding quantitative microtiter plate readings, shown as bars, indicate the fold change (FC) of specific fluorescence (FU/OD600) over controls that carried the sensor but were not subjected to a stressor. Error bars are the standard deviation (SD) of six biological replicates. (*) test and control show significant difference (p ≤ 0.05), evaluated by Independent Samples T-Test. c Time-course measurements of the specific red, green and blue fluorescence response to glyphosate (RFP), nalidixic acid (GFP) and methanol (BFP), respectively, illustrate the dependence of stress response on the stressor dose and exposure time. RFU, GFU and BFU refer to red, green and blue fluorescence units, respectively. Error bars are the standard deviation (SD) of six biological replicates. Note that the main responses observed by microscopic imaging in a clearly correlate with the quantitative evaluations by plate reader in b and c.

Furthermore, the RGB-S reporter revealed cellular responses in real-time. For example, the DNA damage induced by NA is cumulative due to the continuous exposure to NA in the medium, thus leading to an exponential GFP signal increase over time (Fig. 2b). In contrast, a short stimulation by UV irradiation led to an increase of the GFP signal (SOS response due to DNA damage) that reached its peak 45–75 min after the stimulus, followed by signal decline likely due to the damage repair or signal dilution by cell growth (Supplementary Fig. 3b). Such detailed analyses of the mechanisms of action of cell toxic substances are difficult to achieve with conventional sensor approaches.

Multimodal stress response

The ability to observe responses in real-time revealed variations in signal initiation due to different regulon activation upon employment of variable stressors. For example, we found that cells exposed to glyphosate respond by RFP fluorescence within 15 minutes, whereas exposure to sodium dodecyl sulphate (SDS) led to similar signal intensities only after 4 hours lag time (Supplementary Fig. 6).

We then used the RGB-S E. coli for direct comparison of mono- and multimodal effects of various stressors measured quantitatively by fluorescence plate reader (Fig. 3a and Supplementary Fig. 7) and qualitatively by fluorescence microscopy (Fig. 3b, c and Supplementary Fig. 2). We found that the RGB-S reporter correctly identified the major modes of action, which had been determined previously by other means (Fig. 3a)16,19,27,28,31,32,33,34,35,36. For example, some antibiotics and UV irradiation were highly specific in inducing GFP fluorescence, thus correlating with their genotoxic potential due to DNA damage (Fig. 3a)19,28,31. Glyphosate also exhibited a highly specific change in RFP (RpoS) expression due to its inhibition of the shikimate pathway via 5-enolpyruvylshikimate-3-phosphate synthase, thus interfering with many metabolic pathways27.

Fig. 3: Multimodal effects and heterogenic response to stressors.
figure 3

a Multimodal response of RGB-S E. coli to stress inducers depicted as fold changes (FC) of fluorescence signal relative to non-stressed controls. Error bars are the standard deviation (SD) of six biological replicates. (*) test and control show significant difference (p ≤ 0.05), evaluated by Independent Samples T-Test for normal means and Mann-Whitney U Test for not normal means. For starvation, significance was determined by Paired Sample T-Test. Cultures containing the reporter plasmid were incubated for 5 h in Luria-Bertani medium supplemented with kanamycin (LB+kan), except for starvation that was conducted over 9 days. b Analysis of heterogenic response on the single-cell level to 2-propanol 2% (v/v) determined by microscopy analysis after 5 h incubation. Scale bar is 25 µm. c Representative images (obtained from b) showing cells that display single, multimodal, or no stress response. Scale bar is 5 µm. Red, green and blue colours indicate physiological stress, genotoxicity and cytotoxicity, respectively.

In addition to correctly identifying the known major response regulon, the RGB-S reporter provided insights into the molecular mechanisms triggered by stressors, which induce more than one response regulon. For example, in case of starvation a bimodal response of RFP and GFP was observed (Fig. 3a). While the RFP fluorescence was expected due to the known RpoS induction upon starvation33, the associated 3.5-fold GFP (SOS) response can be attributed to stationary-phase mutagenesis37. Moreover, as a general trend, we observed a triple-modal response for compounds inducing BFP (cytotoxicity), such as ethanol, 2-propanol or acetone (Fig. 3a and Supplementary Fig. 7). BFP expression is indicative for the accumulation of misfolded proteins, which, in turn, can affect vital functions of cellular components. This explains why RFP and GFP signals are usually associated with the BFP response. On the other hand, the reverse correlation was not observed.

The multimodal response capability of the RGB-S reporter was then used for detailed analysis on the single cell level using microscopic imaging analysis (Fig. 3b, c), from which the relative extent of each response can be efficiently deduced (Supplementary Fig. 8). It was found that the multimodality is based on heterogenic responses of subpopulations, which react to a given stressor in distinctly different ways. For example, after addition of 2-propanol, cells could be assigned to four categories displaying either mono-, dual-, triple-, or no-stress response (Fig. 3c). Cells with no stress response could be either dead cells, thus have shut down the transcription, or cells that have lost the sensor plasmid. Similar heterogenic results were obtained from other stressors, such as phenol and butanol (Supplementary Fig. 9). While phenotypic heterogeneity is a well described phenomenon attributed to cell-inherent dynamics, transcriptional stochastic effects, and other ecological factors38,39, the detailed analysis of these processes remains difficult. In this context, the RGB-S reporter can elucidate the molecular basis of such phenomena by enabling the identification and separation of individual subpopulations using established technologies such as fluorescence-activated cell sorting (FACS).

To demonstrate this approach, we sorted approximately 1 million cells of RGB-S E. coli treated with 2-propanol 2% (v/v) in two replicates based on the single cell responses into four subpopulations (mono RFP, mono GFP, dual RFP-GFP, and triple RFP-GFP-BFP) using FACS (Supplementary Fig. 10). Ttranscriptomic analysis was conducted to determine relative changes in mRNA levels (Fig. 4 and Supplementary Fig. 11). As expected, the mono and dual responses revealed upregulation in their respective stress regulons. In subpopulations with mono GFP response, the transcription of SOS genes was upregulated, including the recA and lexA genes, which are known as the main SOS regulators (Fig. 4a). Likewise, the RpoS reported gene osmY showed predominant transcription both in the mono RFP and dual RFP-GFP subpopulations (Fig. 4b). In the dual RFP-GFP subpopulations, both the SOS reported gene, sulA, as well as the regulator gene, lexA showed high transcription levels. These results confirmed the phenotypic analysis of the RGB-S reporter.

Fig. 4: Transcriptomics analysis of SOS, RpoS, and RpoH stress responses and of selected metabolic pathways.
figure 4

RGB-S E. coli cells were treated with 2-propanol 2% (v/v) and sorted using FACS. Populations were sorted based on individual cell responses into four subpopulations, mono GFP, mono RFP, dual RFP-GFP, and triple RFP-GFP-BFP, with numbers (1, 2) indicating replicates. Differentially transcribed genes involved in SOS (a), RpoS (b), and RpoH (c) stress response pathways were analysed within the four sorted subpopulations. d Analysis of differentially transcribed metabolic pathways as annotated in the KEGG database of the four sorted subpopulations.

Unexpectedly, however, the RFP-GFP-BFP subpopulations showed downregulation in the transcription of the RpoH reported gene grpE, as well as of genes involved in SOS and RpoS responses (Fig. 4c). The cells in this population have activated all three stress responses analysed in this study and have started accumulating all three fluorescent reporter proteins. The intense stress provoked by activating several pathways might, however, lead to the cells shutting down transcription. Such cells would then still show significant fluorescence for all three reporters, but reduced overall transcription levels which would ultimately lead to stopped cell division thus undiluted fluorescent proteins. This hypothesis is supported by the low transcription profile of the RpoH regulon observed in the triple response cells (Supplementary Fig. 11). The results suggest that more in-depth time and dose-dependent studies of such subpopulations are needed to elucidate the detailed transcriptional profile of the RpoH regulon to stressors.

Interestingly, transcriptome analysis of the sorted subpopulations revealed other transcriptional profiles altered by the stressor in addition to stress response signalling pathways, as shown in particular by enrichment analysis of Kyoto Encyclopedia of Genes and Genomes (KEGG)40 metabolic pathways (Fig. 4d). For example, lipopolysaccharide biosynthesis, purine, and pyruvate metabolisms were shown to be upregulated in the mono GFP responding populations, while fructose, alanine, and cysteine metabolisms were upregulated in the dual RFP-GFP populations (Fig. 4d). Already, these first new findings on the modulation of such metabolic pathways clearly demonstrate the enormous potential of the new approach for the identification of unknown stress-induced effects, which could be applicable for the rational design of production strains and further applications in synthetic biology. The exploration of these novel interactions can be further elucidated through the application of systems biology methods41. By leveraging transcriptomic datasets obtained from diverse stress conditions combined with RGB-S reporter’s analysis in further studies, researchers can reveal the intricate interrelations across reported stress responses as well as other non-stress-related pathways.

Compartmentalised response in biofilms

Phenotypic heterogeneity is also a distinct feature of bacterial biofilms39, which are important in ecology as well as medical and biotechnological settings42,43. In order to investigate living E. coli biofilms, we employed a microfluidic flow cell setup44 enabling non-disruptive in situ analysis of the RGB-S E. coli by confocal laser scanning microscopy (CLSM) (Fig. 5a, b and Supplementary Fig. 12). Imaging analysis of mature biofilms, grown for 96 hours in the absence of stressors, typically revealed signals originating from a few, randomly occurring fluorescent cells at locations in the centre of the microfluidic channel (Fig. 5b, “centre”). However, in specific locations, such as at the edge of the fluidic channel where the flow profile leads to accumulated biomass, distinctive patterns of fluorescent cells were visible (Fig. 5b, “edge”). For example, a noticeable GFP expression was frequently observed in aggregated cell clusters. Further, an increased RFP expression was often observed in cells near the bottom of the biofilm, presumably indicative for the limitation in nutrients in the respective microenvironments.

Fig. 5: Spatial organization and triggered stress responses in biofilms.
figure 5

a Schematic illustration of the flow channel used for the cultivation and real-time imaging of a living RGB-S E. coli biofilm grown under continuous flow of 10 µl/min LB+kan. The “centre” and “edge” positions are indicated. b A mature biofilm grown for 96 h mainly shows a low heterogenic response caused by random occurrence of individual stressed cells (upper row). Near the edge of the flow channel (lower row), GFP-expressing cells dominate the top of the biofilm whereas RFP-expressing cells accumulate at the bottom. Scale bar is 100 µm for top and bottom views, and 25 µm for side views. c After growing the biofilm for 96 h, only a basal background signal can be observed as detected at centre positions (no stress, I) indicating the normal state of the biofilm without particular stress. After treatment with nalidixic acid for another 24 h (NA, II), the cells in the biofilm displayed an elevated GFP signal (genotoxicity). Subsequent administration of glyphosate (Gly, III) leads to decreased GFP response with concomitant occurrence of an elevated RFP (physiological stress) response. Further treatment with methanol (MeOH, IV) leads to induction of strong BFP signals (cytotoxicity). Scale bar is 100 µm. Quantitative red, green and blue bars (on the right) represent the intensity average of RFP, GFP and BFP, respectively, acquired from nine 100 µm2 regions. (*) indicate statistical significance of response means (p ≤ 0.05), evaluated by One-way ANOVA for parametric groups, and Kruskal-Wallis Test for nonparametric groups. Error bars represent the standard deviation (SD). Additional images of different centre positions are shown in Supplementary Fig. 13. d Internal organization of the three stress responses inside the final MeOH treated biofilm, imaged at a centre position. The biofilm displays a blue fluorescence with a second internal red fluorescent layer and a final inner thin SOS layer. 3D scale bar is 25 µm.

Importantly, the experimental setup enabled the controlled perturbation of biofilms by administration of distinctive stressors, using otherwise unaltered environmental conditions like constant nutrients and flow (Fig. 5c and Supplementary Fig. 13). For example, after an initial growth phase of 96 hours without stressor (Fig. 5c, I), the mature biofilm was sequentially exposed to nalidixic acid (NA), glyphosate (Gly), and methanol (MeOH), respectively, each for 24 hours under unchanged flow conditions. As expected from the results with the planktonic cultures described above, NA led to a specific increase in the GFP signal (SOS), indicating DNA damage in biofilm-forming cells (Fig. 5c, II). Exchange of the genotoxic NA to the physiological stressor Gly not only induced the expected high RFP signal, but also restored the non-stressed GFP state (Fig. 5c, III). The same effect was also observed when applying MeOH as the third stressor, which induced a strong BFP response, along with minor RFP and GFP signals (Fig. 5c, IV), similar to the multimodal response observed with planktonic cells. These biofilm responses documented by confocal fluorescence microscopy clearly correlate with the measured quantitative responses by plate reader for the respective stressors shown in Figs. 2b, c and 3a. The dynamic response of the living biofilm could also be monitored in real-time (Supplementary Fig. 14). These results vividly document that biofilm molecular stress-coping mechanisms respond flexibly to environmental changes, which, among other defence strategies, should also contribute to the well-known inherent resilience of biofilms.

Perturbation with stressors also alters the three-dimensional organization in the living biofilm. For example, after 24 hours of MeOH administration, the entire biofilm structure showed a largely homogeneous blue fluorescence, as expected (Fig. 5d). However, more detailed analysis with all three colours surprisingly revealed a distinct three-dimensional layered pattern of stress responses within the biofilm, indicating inner layers with predominant RFP fluorescence (physiological stress) and a thinner GFP layer (SOS) in the middle. Stress heterogeneity and structural stratification in biofilms have been connected to microgradients of nutrients, oxygen and metabolites42,45. The homogeneous blue fluorescence observed here across the entire biofilm with an average structural thickness of about 50 µm suggests that diffusion of stress factors was not restricted under the conditions used. Therefore, metabolic activity could be the reason for the observed stratification. Since oxygen is rapidly consumed by cell metabolism, the middle red layer (Fig. 5d) could result from local oxygen limitation and thus represent the most physiologically stressed and therefore SOS-sensitive zone (green) of the biofilm. Similar spatial heterogenic effects have been described for Pseudomonas aeruginosa biofilms39, where oxygen consumption by surface layers of the biofilm could be faster than its diffusion into the lower layers, thus leading to a metabolically active surface in addition to inactive thick bottom layers46. Overall, the observations made here demonstrate for the first time that a living E. coli biofilm under continuous flow conditions responds at the cellular level with a dynamic and spatially localized response to stressors. These results underscore the utility of the technology presented here and suggest that a combination with spatiotemporally resolved sampling39,44 and sequencing techniques should enable detailed investigations of the underlying molecular and physiological mechanisms at such complex microbial communities.

In conclusion, the RGB-S reporter described here facilitates multi-stress analyses in bacterial planktonic and biofilm populations, revealing population responses to stresses along with population heterogeneity and spatial organization. Since the fluorescent proteins will accumulate over time due to their stability, coupled with signal fluctuations experienced during extended measurements, the accuracy of relative quantification in experiments which run for more than 5 hours may be compromised. This could be addressed in further studies by employing less stable reporter proteins. As the present biosensor system is designed on a multi-copy plasmid to enable a quick signal amplification and sensitivity at low stressor concentrations, plasmid stability issues especially in diluting cultures can lead to biased or stochastic assays. A genome-integrated biosensor cassette can be investigated in further studies to overcome such issues. An additional future suggestion is to label the sensor strain with a compatible, constitutively expressed fourth fluorescent protein, which will enable visualizing and localizing all cells especially in 3D space of heterogenic biofilms, thus to estimate the ratio of stressed to non-stressed cells. Since the novel biosensor is compatible with modern high-throughput screening and imaging systems47, this kind of multi-stress biosensors will enable the acquisition of high-content data to facilitate the fast, robust and comprehensive analysis of bacterial response to transient and permanent environmental changes. We believe that this approach is of great value not only for fundamental research in the context of stress-emergence of antibiotic resistance48 and stress heterogeneity within biofilms42,43 but also for practical applications in medicine and biotechnology.

Methods

Genetic elements

The RGB-S reporter was constructed by fusion of three synthetic sensing elements, cloned into the backbone pMK-RQ [kanR & ColE1 ori] (GeneArt® Gene Synthesis, ThermoFisher Scientific and IDT Inc.) (Supplementary Fig. 1). Each sensing construct is comprised of three parts, a) a stress-responsive promoter, b) a fluorescent reporter protein, and c) a transcriptional terminator. Based on the main criteria of exhibiting a fast and specific response, stress-responsive promoters were selected based on literature studies. Sequences of the chosen promoters were obtained from the genome sequence of E. coli str. K12 substr. MG1655 (GenBank: U00096.3). Fluorescent proteins were chosen with respect to high signal intensity and spectral compatibility. To enhance their translation rates, codons for selected fluorescent proteins were optimized for E. coli using the GeneOptimizer™ software (ThermoFisher Scientific)25. Sequences of fluorescent proteins as well as transcriptional terminators were obtained from the well documented parts of the Registry of Standard Biological Parts (parts.igem.org). Sequences of all genetic elements are listed in Supplementary Table 2. For handling of genetic designs in silico, the software Geneious 9.1.8 (Biomatters Ltd.) was used. The plasmid backbone contained the kanamycin resistance gene (kanR), for which kanamycin was provided for selection in all broth and agar media (LB+kan) at a final concentration of 50 µg/ml.

Cloning

The RGB-S reporter was assembled using the isothermal cloning reaction49 Gibson Assembly® Master Mix (NEB inc.) according to the manufacturer’s protocol. If necessary, template DNA was removed by DpnI treatment. 1 µl of methylation-sensitive restriction enzyme DpnI and 2 µl CutSmart® buffer (both from NEB inc.) were added to the assembled reaction and incubated at 37 °C for 30 min. The reaction product was used to transform chemical competent E. coli cloning strain DH5α (lab stock) then plated on LB+kan (50 µg/ml) agar and incubated overnight at 37 °C. All plasmids were purified using the ZR Plasmid Miniprep – Classic (Zymo Research inc.) following manufacturer’s protocol, sequence verified (LGC genomics) and stored at −20 °C.

The overall cloning strategy is depicted in Supplementary Fig. 1. After initial construction of the dual-colour sensor (named RG-S reporter) consisting of PsulA::GFPmut3b::terminator_1 and PosmY::mRFP1::terminator_2, this vector was linearized using primers O17051-F and O17052-R and assembled with the third sensing element (terminator_3::PgrpE::mTagBFP2::terminator_4), resulting in the final triple-colour/stress sensing plasmid named RGB-S reporter.

Stress assay

Chemicals

Chemicals used in this study are: EtOH 96% ANALAR, 1-BuOH ANALAR and 2-propanol HPLC grade from VWR international GmbH. Nalidixic acid, ciprofloxacin, dimethyl sulfoxide (DMSO) cell culture grade, chloramphenicol molecular biology grade, isopropyl β-D-1-thiogalactopyranoside (IPTG), kanamycin sulphate, ampicillin sodium salt, and glucose monohydrate from PanReac AppliChem. MeOH and acetone were analysis grade, phenol was synthesis grade, acetate 100% and glycerol analysis grade from Merck, Darmstadt, Germany. Glyphosate, Roundup® Gran 420 g/kg as sodium salt from Monsanto, Germany. Sodium dodecyl sulphate (SDS) electrophoresis grade from BioRad. Fructose ≥99% from Sigma-Aldrich. Furfural 99% from Acros Organics.

RGB-S E. coli preparation

For stress sensing assays, chemical competent cells of wildtype E. coli K12 MG1655 DSMZ 18039 (DSMZ GmbH, Germany) were transformed with the RGB-S reporter (designated as RGB-S E. coli) and plated on LB+kan agar as described above. A seedbank of glycerol cryostock of the RGB-S E. coli was prepared using a single pure colony to minimize phenotypic heterogeneity in the stress assays. From an overnight LB+kan agar plate, several single colonies were inoculated each into 5 ml LB+kan broth and incubated in 180 rpm shaker at 37 °C. From these exponentially growing cultures cryostock aliquots of 15% glycerol were stored at −80 °C. A fresh aliquot was used to start every new stress assay experiment.

Assay protocol

The assay protocol was designed in order to reliably determine the culture stress state even under high stress levels where no further culture growth was occurring. The stress assay started by using an aliquot of the seedbank to inoculate two independent cultures (Cult. 1 & Cult. 2) each in 5 ml LB+kan broth and incubated overnight in 180 rpm shaker at 37 °C. The next day, cultures were diluted to 1:250 using fresh LB+kan and incubated again at the same conditions for 5–6 hours. After reaching adequate optical density, the cultures were diluted using fresh LB+kan to adjust the OD600 to 0.4, which is 2X of the final cell density in the assay plate. At the same time, the chemical stressing agents were diluted in LB+kan to 2X of the final required concentration. The stress treatment started by adding 250 µl diluted RGB-S E. coli culture to 250 µl LB-stress mixture (or LB containing no stressor as the control culture) to form 500 µl total volume, which had a final cell density of OD600 0.2 and 1X stressor concentration. Upon mixing, each of the two cultures (Cult. 1 & Cult. 2) were then distributed in three replicates in 96-micowell plate, each well containing 150 µl. In total, six independent biological replicates were analysed for every stress concentration unless otherwise indicated. The microtiter plate was then covered by a fluorescence-compatible transparent film (Lab Logistics Group Inc.) to prevent culture evaporation and incubated in a Synergy H1 microplate reader (BioTek Inc.) with continuous orbital shaking (282 cpm, 3 mm) at 37 °C and measuring the optical density (OD600) and the three fluorescence readouts at wavelengths given in Supplementary Table 1 at assigned time intervals.

For UV irradiation, a UV-C germicidal lamp (Philips UV-C, TUV30W G30T8) was used. The lamp was switched-on for 30 minutes before irradiation to reach the maximum power intensity. Two cultures were prepared as stated above and diluted to OD600 0.2 using fresh LB+kan. 1 ml of each diluted culture was poured into 60 mm sterile Petri dish to form a wide area of homogenous thin culture layer and exposed in duplicates to UV light for different periods. Irradiated cultures were then immediately distributed in triplicate into a 96-well microtiter plate and incubated as previously described. Control cultures were treated based on the same procedure but without UV exposure.

2D Fluorescence imaging

For 2D microscopic imaging, an ApoTome inverted fluorescence microscope (Carl Zeiss Inc.) was used. 10 µl of a stressor-treated culture was loaded on a microscope glass slide and covered by a glass slip then imaged using the compatible three light filter sets corresponding to the three fluorescent proteins (Set 43 HE for RFP, Set 44 for GFP and Set 49 for BFP) as indicated in Supplementary Table 1. Before imaging the stressor-treated cultures, the image acquisition settings were set to the blank using a non-stressed control culture. The three fluorescence channels were imaged for the same field by AxioVision software (Carl Zeiss Inc.) and their fluorescence intensity was displayed in a lookup table (LUT) as a linear gradient created by ImageJ50 (imagej.nih.gov/ij).

Plasmid stability test

Plasmid stability was tested utilizing the same stress assay protocol described above, except for the culture volume, which was modified to 5 ml LB cultures in culture tubes. To indicate the plasmid presence in the cells, all cultures were stressed with 6 µg/ml nalidixic acid as inducer of genotoxicity indicated by GFP signal. Additionally, plasmid presence was confirmed by plating on kanamycin selective agar plates. For aging cultures shown in Supplementary Fig. 5a, b, three independent LB cultures supplemented with the standard kanamycin concentration (50 µg/ml, +Kan) and other three cultures without kanamycin (-Kan) were incubated in 180 rpm shaking at 37 °C for three days. At the start of the experiment as well as at 24 h intervals, the OD600 and GFP fluorescence readouts were measured to check for the plasmid presence. For the diluting cultures shown in Supplementary Fig. 5c, d, identical procedures were utilized, except that the cultures were diluted on daily bases by transferring 20 µl to inoculate a fresh 5 ml LB broth with (+Kan) and without (-Kan) kanamycin. Optical density and fluorescence measurements were documented at the end of each interval, before culture transfer. At the fourth day of subculturing, +Kan and -Kan cultures were diluted and plated on LB+kan agar plates, incubated at 37 °C for 24 h, then the colonies were counted and plotted in Supplementary Fig. 5e.

Fluorescence-activated cell sorting (FACS)

Culture preparation and cell sorting

The RGB-S E. coli strain was treated with 2-propanol 2% (v/v) for 5 h at 37 °C in two cultures of 500 ml each, utilizing the standard stress assay protocol described above. Untreated cultures were prepared under the same conditions as the control. Control cells were then diluted with 1X phosphate buffered saline (PBS) to an approximate concentration of 1 × 106 cells ml−1 and analyzed in the cell sorter to set the background fluorescence signal threshold for the sorting of the treated samples. Afterwards, populations from RGB-S E. coli treated cells were also diluted with PBS and sorted using a MoFlo XDP High-Speed Cell Sorter (Beckman Coulter) equipped with 405 nm, 488 nm, and 561 nm laser lines. Post-acquisition analysis was done with FlowJo software (BD Biosciences). Both non-stressed control sample and subpopulations of stressed mono RFP, mono GFP, dual RFP-GFP, triple RFP-GFP-BFP with stress fluorescence signals higher than the control background threshold were sorted in duplicates. Gating of the aforementioned populations is shown in Supplementary Fig. 10. One millions cells were sorted for each sample (except for RFP-2 and RFP-GFP-2 which received 0.7 and 0.75 million cells, respectively) into 250 µl of RNAPure™ peqGOLD (VWR International GmbH), then immediately vortexed and kept on ice until extraction.

RNA extraction and library preparation

RNA was extracted with the Direct-zol RNA Miniprep Kit (Zymo Research Inc.), following the standard protocol. DNase treatment was applied after extraction using the TURBO DNA-free™ kit (Invitrogen) and the RNA was stored in 1 µl of RNasin® Ribonuclease Inhibitor (Promega Corporation). RNA was quantified with the Qubit™ RNA HS Assay Kit (Invitrogen). Immediately, RNA libraries were prepared using the Zymo-Seq RiboFree® Total RNA Library Kit (Zymo Research Inc.), with some modifications. These included extending the first-strand cDNA synthesis incubation at 48 °C to 1.5 hours, keeping the RiboFree® depletion step to 2 hours even when RNA concentrations were <250 ng, using RNA Clean & Concentrator-5 (Zymo Research Inc.) for the first cleanup after the RiboFree® depletion step (according to Appendix E), and repeating the final bead cleanup step after PCR twice to remove adapter dimers. Library concentration and size was quantified with Qubit™ dsDNA HS Assay Kit (Invitrogen) and Bioanalyzer High Sensitivity DNA kit (Agilent Technologies Inc.). RNA libraries were sequenced using an Illumina NextSeq 550 with the High Output Kit v2.5 -150 Cycles (2 × 75 bp paired-end) (Illumina Inc.).

All RNA extractions and library preparations were done under a laminar flow PCR workbench (STARLAB International GmbH) decontaminated with either RNase AWAY® or DNase AWAY® (Molecular Bio-Products Inc.) and UV.

RNA-seq data processing and analysis

The sequence reads were quality checked using FastQC v0.11.9 (www.bioinformatics.babraham.ac.uk/projects/fastqc) and quality-trimmed using Trim Galore51. The rRNA reads were removed using SortMeRNA v4.3.4 (silva-bac-16s-id90 and silva-bac-23s-id98 databases for reference) with default settings52. The filtered reads were mapped to the E. coli MG1655 (ASM584v2) genome, edited to include the sensor construct sequences, with the STAR aligner v2.7.6a53. Intron alignment was disabled by setting --alignIntronMax 1, and read pairs were kept if the length-normalized alignment score and the length-normalized number of matched bases were at least 0.5. Read counts for each gene were determined using the featureCounts54. Counts were normalized and differentially transcribed genes were analysed (padj = < 0.05) with DESeq2 in R v3.6.355,56. The design for DESeq2 was set to test for variation between the four different RGB-S E. coli subpopulations. The Likelihood Ratio Test (LRT) was used as the statistical test. The control samples were used to calculate the log2 fold changes between all samples, but were not used for determining significant genes between the four subpopulations. Significantly transcribed genes were then used as input for Gene Set Variation Analysis (GSVA) to determine enriched Kyoto Encyclopedia of Genes and Genomes (KEGG) pathways40,57. Here, the number of minimum required genes was set to 5.

Microfluidic biofilm growth and CLSM imaging

For 3D biofilm imaging, the RGB-S E. coli strain was grown in a straight flow-cell microfluidic chip. The gas-permeable microfluidic structure was made of elastomeric polydimethylsiloxane (PDMS) (Sylgard 184, Down Corning) and bonded to a Cyclo Olefin Polymer (COP) film (HJ-Bioanalytik GmbH, Germany) (Supplementary Fig. 12). The biofilm was grown in the chip mounted on the stage of a confocal laser scanning microscopy (CLSM) (ZEISS LSM 880, Carl Zeiss Inc.) under a constant temperature of 37 °C and a continuous LB+kan flow of 10 µl/min using a Nexus 3000 syringe pump (Chemyx Inc.). The initial mature biofilm was grown for 96 h. After biofilm maturation, image acquisition settings were adjusted in order to visualize each basal stress response according to the control biofilm before applying the stressors. After this initial setting, the acquisition parameters were kept identical throughout the entire experiment. LB+kan with SOS inducer nalidixic acid 6 µg/ml was pumped through the chip at the same flow rate for 24 h, followed by LB+kan + glyphosate 2% (w/v) for 24 h, and lastly followed by methanol 8% (v/v) for 24 h. Images were acquired using the software ZEN 2.0 black (Carl Zeiss Inc.) with the fluorescence acquisition spectra shown in the Supplementary Table 1. 3D biofilm images were constructed using the software ZEN 2.3 Blue Edition (Carl Zeiss Inc.).

To generate the fluorescence intensity bars shown in Fig. 5c and Supplementary Fig. 13, an orthogonal xy 2D image summing the Z-stack layers was generated by ZEN 2.3 Blue Edition for a total of 9 field-of-view positions. Each field-of-view was a square of 100 µm2. These regions were used to calculate the integrated fluorescence intensity (IntDen) for the three channels using ImageJ.

Statistics

Microsoft Excel was used for data analysis. IBM SPSS Statistics v.24.0 (IBM Inc.) was used for statistical significances determination. For Figs. 2b, 3a, 5c, and Supplementary Fig. 13, Kolmogorov-Smirnov and Levene tests were used for normality and homogeneity determination, respectively. For Fig. 5c, and Supplementary Fig. 13, parametric 3-colour groups were compared by One-way ANOVA followed by LSD as a post hoc analysis, while nonparametric groups were analysed by Kruskal-Wallis Test. For Figs. 2b and 3a (except starvation experiment), significance of independent normal means was determined by Independent Samples T-Test, and not-normal means by Mann-Whitney U Test. For starvation experiment in Fig. 3a, significance of dependent normal means was determined by Paired Sample T-Test, and not-normal means by Wilcoxon Signed Ranks Test. All tests were done at 95% confidence (p ≤ 0.05) using six replicates, unless otherwise indicated.

Reporting summary

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