Strains and growth conditions
For all experiments and E. coli strains, cells were grown in a medium (M9gluCAAT) with M9 salts (33.7 mM Na2HPO4, 22 mM KH2PO4, 8.55 mM NaCl, 9.35 mM NH4Cl), 0.2% (w/v) glucose, 0.4% (w/v) casamino acids, 1 mM MgSO4, 0.3 mM CaCl2, 1 μg ml−1 thiamine and trace elements (from a 100× stock containing 13.4 mM ethylene-diamine-tetra-acetic-acid (EDTA), 3.1 mM FeCl3·6H2O, 0.62 mM ZnCl2, 76 μM CuCl2·2H2O, 42 μM CoCl2·2H2O, 162 μM H3BO3, 8.1 μM MnCl2·4H2O). Before every experiment, cells were first inoculated into M9gluCAAT and grown to stationary phase at 37 °C. For all assays except the biofilm experiments, the culture was diluted to 1/10,000 or more in fresh medium and grown at 37 °C (unless stated otherwise) until it reached an optical density at 600 nm (OD) of 0.2–0.4. For the biofilm experiments, cells were grown in M9gluCAAT supplemented with 100 µg ml−1 ampicillin to maintain the GFP-expressing plasmid. The overnight stationary-phase cultures were then diluted into the same medium to an OD of 0.015. See below for details on biofilm growth.
Except for the biofilm experiments, the strains used in this study were derived from MG1655 (ATCC 47076), which was used to estimate the MIC for all the studied peptides (or peptoids) using a microplate reader (Supplementary Table 3). To detect the timing of outer and inner-membrane permeabilization to proteins, strain CJW7845 was constructed to carry two freely diffusing fluorescent proteins: mScarlet-I in the periplasm and mTagBFP2 in the cytoplasm. Construction of CJW7845 was done by transforming pBAD-mTagBFP2 plasmid (Addgene, 34632, a gift from Vladislav Verkhusha50) into an E. coli strain expressing a periplasmic mScarlet-I reporter51, as previously described52. Transformants were restreaked on fresh selection plates and confirmed via microscopy.
Strain CJW7753, which carries chromosomally expressed HupA-mCherry and RplA-GFP along with a plasmid-expressed cytoplasmic mTagBFP2 (ref. 35), was used to simultaneously monitor intracellular perturbations of ribosomes and DNA over time while assessing cell envelope integrity.
For both strains CJW7845 and CJW7753, mTagBFP2 expression was induced by supplementing the medium with 0.2% (w/v) arabinose. Ampicillin (100 μg ml−1) was added to the growth medium of the liquid culture to maintain the mTagBFP2-expressing plasmid but was not present in the microwell medium during the imaging experiment.
Strains CJW7020 (ref. 31) and CJW7859, which express RplA-msfGFP and HupA-msfGFP, respectively, were used to probe the spatial localization of ribosomes and DNA with respect to fluorescently labelled AMPs. Strain CJW7859 was constructed as follows. The monomeric superfolder GFP (msfGFP) coding sequence together with a kanamycin resistance cassette flanked with flippase recognition target (FRT) sites was amplified from a pKD13 vector53 encoding msfGFP without its start codon, preceded with a sequence encoding a glycine/serine-rich linker (GSGSGS) (strain CJW6871 (ref. 31)), using primers 5′-GGCATTTGTTTCTGGCAAGGCACTGAAAGACGCAGTTAAGGGCAGCGGCAGCGGCAGCTC-3′ and 5′-AAACCACCCCTTCGTTAAAACTGTTCACTGCCACGCAATCATCCGTCGACCTGCAGTTCG-3′. Polymerase chain reaction (PCR) was performed to add homologous sequences to the 3′-end region encoding the HupA C terminus and the downstream region and to remove the hupA stop codon, yielding an encoded C-terminal HupA-msfGFP fusion. The amplified product was transformed by electroporation into MG1655 containing pSim6. The plasmid expresses the Red recombineering proteins (encoded by exo, bet and gam) under the control of the native λ phage pL promoter and temperature-sensitive cI857 repressor, whose expression can be induced by heat shock as previously described54. The pSim6 plasmid was kindly provided by the National Cancer Institute. Briefly, cells were grown at 30 °C to mid-exponential phase and the synthesis of the recombineering proteins was induced for 15 min at 42 °C before making cells electrocompetent. Mutants were selected on kanamycin, and the correct integration was verified by PCR and sequencing of the modified genomic region using primers 5′-TGTCGTACCTGGAGTCTTCC-3′ and 5′-TTCAGCAAATCCACTGGCGG-3′. The modification was moved to a clean wild-type MG1655 strain in which no recombineering system was expressed via P1 transduction as previously described55. Transductants were confirmed via PCR and sequencing of the modified region using the same primers as above. A single colony was grown and transformed with temperature-sensitive pCP20, expressing the site-specific Flp recombinase to excise the kanamycin cassette used for initial selection, as previously described56. Briefly, transformants were selected on LB plates containing chloramphenicol (30 μg ml−1) at 30 °C and streaked on LB plates at 42 °C overnight to induce Flp recombinase expression and loss of pCP20 plasmid. Loss of the FRT-flanked kanamycin resistance cassette was confirmed by PCR and the lack of growth in the presence of kanamycin (50 μg ml−1). The loss of pCP20 was confirmed by the lack of chloramphenicol resistance.
Strain ATCC 25922GFP (ATCC), which carries a GFP-expressing plasmid, was selected for biofilm experiments. The strain’s ability to form biofilms was first verified at 37 °C using Congo red staining on an agar plate containing M9gluCAAT. Congo red dye binds curli, a major component of the biofilm extracellular matrix. Strain ATCC 25922 (lacking the GFP-expressing plasmid) was used for MIC determination (to avoid interference from the presence of ampicillin required to maintain the plasmid) following the standard growth protocol described above.
Sources and preparation of antimicrobial peptides, peptoids and chemicals
Lyophilised powders of LL-37 (AS-61302), human β-defensin 3 (AS-60741), magainin-2 (AS-20639), cecropin A (AS-24009), melittin (AS-62366), indolicidin (AS-60999) and protegrin-1 (AS-64819) were purchased from AnaSpec. PR-39 (350590) was purchased from Abbiotec. CRAMP (CRB1000262) was purchased from Biosynth. Tachyplesin-1 (4030734) was purchased from Bachem. Camel bactenecin (71266-2), bactenecin 7 (318782), Tur1A (318733), Tur1B (319842) and DJK-5 (318921) were purchased from NovoPro Bioscience. 5-TAMRA-labelled cecropin A, tachyplesin-1, LL-37, PR-39, Bac7 and DJK-5, were commissioned to NovoPro Bioscience for custom synthesis. Rifampicin (R3501-1G) and spectinomycin (S9007-25G) were purchased from Sigma-Aldrich. SYTOX Green (S7020) and SYTOX Orange (S11368) were purchased from Thermo Fisher. EbbaBiolight 680 was purchased from Ebba Biotech. For all fluorescently labelled peptides, the fluorescent label was conjugated to the N terminus. Peptide powders were resuspended in Milli-Q water to stock concentrations of 1 mM (or 0.5 mM for human β-defensin 3), aliquoted and stored at −20 °C. TM1 peptoid (first described as Peptoid 1), TM4 and TM5 were synthesized on an automated peptide synthesizer and purified by reversed-phase high-performance liquid chromatography, as previously described11,36. Before each experiment, aliquots were diluted in fresh medium to the desired concentration.
Protein sequence analysis and feature extraction
Amino acid sequences of the selected peptides (Supplementary Table 1) were analysed using custom-written functions in Python to extract physicochemical properties (protein_analysis.py). The GRAVY index was computed using the Kyte–Doolittle scale of amino-acid hydropathy values57. Polar and hydrophobic fractions were calculated on the basis of the following classification: serine, glutamine, asparagine, glycine, threonine, proline, tyrosine, lysine, arginine, histidine, aspartic acid and glutamic acid were considered polar amino acids, whereas alanine, isoleucine, leucine, methionine, phenylalanine, tryptophan, cysteine and valine were considered hydrophobic. The net charge was calculated as the number of lysine and arginine residues minus the number of aspartate and glutamate residues (with histidine counted as neutral), plus one for C-terminal amidations when present. Molecular weight was computed starting from the sum of the molecular weights of the n single amino acids, subtracting n−1 water molecules (18.015 g mol−1) resulting from peptide bond formation, weight loss due to C-terminal amidation (0.98 g mol−1, when present) and weight loss due to disulfide bridge formation (2.02 g mol−1 per cysteine pair).
Determination of MICs and maximum growth rates
To determine the MIC of the selected AMPs against either MG1655 or ATCC 25922 E. coli strains, exponentially growing cells were diluted in fresh medium to an OD = 10−6 (~500 cells per ml) and mixed 50:50 with titrated AMP concentrations (which were chosen to be over a range that included the MIC) in a 96-well plate (flat bottom with low-evaporation lid, 3595, Corning). A final OD of 5 × 10−7 corresponds to ~250 cells per ml. OD curves were sampled every 5 min for a total of 48 h using a microplate reader (BioTek Synergy 2, Agilent). Raw data were exported as a text file and analysed using a custom-written Python script (microplate_reader_analysis.py). To measure maximum growth rates, the log(OD) was fitted using a linear regression over a 12-point moving window (60 min), which provides the instantaneous growth rate (log(OD) h−1), from which the global maximum was computed. The MIC was defined as the minimum AMP concentration for which the maximum growth rate was <0.2 log(OD) h−1 within the first 20 h of incubation. For each independent experiment (biological replicate), the MIC was taken as the value shared by the majority of its technical replicates (2 or 3 replicate dilution series; the lower value in case of a tie). The reported MIC is the median MIC of independent experiments (3 for E. coli MG1655 and 3 or 4 for E. coli ATCC 25922). When the number of independent experiments was even, the higher of the two middle values was taken as the MIC.
Fabrication of a multiwell device for single-cell analysis
The multiwell device (Extended Data Fig. 1b) was built as follows. A solution of 9:1 polydimethylsiloxane (PDMS) and curing agent was first mixed and degassed to remove air bubbles. A silicone rubber O-ring (25.8 mm inner diameter, 3.1 mm thickness) was glued onto a glass bottom dish (40 mm diameter, 14026-20, Ted Pella). PDMS solution (1 g) was poured onto the glass dish within the O-ring to form a ~1 mm thin PDMS layer and cured for >3 h at 64.5 °C. An 8 mm biopsy punch was used to perforate the PDMS thin layer and carve out 4 independent ~70-μl wells. The 4 wells were thoroughly rinsed using 70% (v/v) ethanol and 100% isopropanol and blow dried using purified air. Cells were immobilized using a protocol for atomic force microscopy58 with some modifications. The glass surfaces were rendered hydrophilic using air plasma treatment (45 s at 60 W). Then, a Cell-Tak (354240, Corning) solution was prepared by mixing 250 μl 0.1 M sodium bicarbonate (pH 8.0), 10 μl Cell-Tak and 5 μl 1 M NaOH (enough to functionalize 4 wells). This solution (50 μl) was applied to each well for 5 min, rinsed three times with Milli-Q water and blow dried with purified air. Half a microlitre of exponentially growing cells (diluted to OD600 ≈ 0.15) was then spotted into the centre of each well for 5 min to allow for cells to be immobilized on the surface. The small 0.5-μl volume allowed us to immobilize cells only within a small region of the well, thus minimizing cell density effects that may affect the MIC. The wells were then washed three times with fresh medium to remove cells that did not attach to the surface, after which each well was filled with growth medium (70–80 μl). To minimize water evaporation from the wells during the experiments, ~1 ml of medium was added to the region surrounding the O-ring, which aided in maintaining a high local humidity in proximity to the wells. Experiments were carried out with the lid on.
Fabrication of wide-trench microfluidic device
The design of the wide-trench microfluidics was adapted from a published device42. As reported before59, the master mould was manufactured in the clean room of the School of Engineering and Applied Science at Yale University. UV photolithography (EVG 620 Mask Aligner) was applied on Si wafers with SU-8 photoresist to generate two layers of positive patterns. The lower layer contained the bacterial culture chambers (wide trenches) while the upper layer contained the large trench for the flowing culture medium. The large feeding region features a ~200-μm width and ~30-μm height. The wide trenches have a width of 7 μm, a depth of ~34–38 μm and a height of 1.29 μm.
Wide-trench microfluidics chip preparation and experiment
A solution of 9:1 PDMS and curing agent was mixed, degassed to remove air bubbles, poured onto the silicon wafer and cured at 64.5 °C for >3 h. Note that the 9:1 PDMS:curing agent ratio was used instead of the standard 10:1 to reduce the hydrophobicity of the PDMS and mitigate hydrophobic interactions with AMPs. Once hardened, PDMS chips were cut out from the wafer, and a 1.2 mm biopsy punch was used to create inlet and outlet holes. The current chip design features two independent channels per chip. To allow for a higher temperature during PDMS–glass bonding, the glass bottom part of the dish was used during the following steps (without the plastic support glued to it). Both glass slide and PDMS surfaces were subsequently rinsed with 70% (v/v) ethanol and isopropanol to remove dust and debris and blow dried with purified air. The glass slide was then placed on a 95 °C hot plate for further drying for ~2–3 min. Subsequently, the PDMS chip and glass slide were plasma treated (for 20 s at 60 W), immediately bonded, placed on a 95 °C hot plate for 5 min and baked at 75 °C for ~2 h. The bonded chip was then left to equilibrate at room temperature, and a solution of M9gluCAAT supplemented with 0.08% Pluronic F-108 was perfused through the channels, which served to wet the dry PDMS and glass surfaces and to render them more hydrophilic by passivating with Pluronic (which has amphiphilic properties). Pluronic (0.08%) was also supplemented into the growth medium to improve the hydrophilicity of the cell outer membranes, with the intent to reduce cell aggregates. Exponentially growing cells (3 ml) were spun at 6,500 r.p.m. for 5 min, resuspended in 50–100 μl (to increase cell density) and loaded into the channels. The cells-loaded chip was then spun at 500 × g for 3 min using a three-dimensional (3D)-printed holder (design gifted by Dr Johan Paulsson) to facilitate entry of the cells into the trenches. Before every experiment, all tubing was sterilized and cleaned by flowing 20% (v/v) bleach, 20% (v/v) ethanol and Milli-Q water, and then perfused with 0.08% Pluronic-supplemented medium. Experiments were carried out at 37 °C unless indicated otherwise. Flow was achieved by a peristaltic pump (T60-S2&WX10-14-H, Langer Instrument), which was set to deliver a constant flow rate of ~35 μl min−1, which was maintained for the whole duration of the experiment, including the AMP treatment.
Biofilm growth and sample preparation
For the biofilm experiments, ATCC 25922GFP was grown overnight to stationary phase at 37 °C in M9gluCAAT supplemented with 100 µg ml−1 ampicillin (to maintain the GFP-expressing plasmid). The overnight culture was then diluted into fresh, pre-warmed (37 °C) M9gluCAAT containing 100 µg ml−1 ampicillin to OD = 0.015, and 300 µl of the diluted culture was added to each well of an 8-well chambered cover glass (#1.5H high-performance cover glass, 0.17 mm, C8-1.5H-N, Cellvis). Biofilms were grown statically for 3 h at 37 °C. Biofilms were then washed once by gently removing the medium, adding 400 µl of fresh pre-warmed medium, removing it and replacing it with 300 µl of fresh pre-warmed medium (without ampicillin). This step served two purposes: it removed most planktonic cells and floating cell clusters that would otherwise deposit on the biofilm during acquisition and, by decreasing the overall cell density of the well, it prolonged the growth phase of the biofilm before its maturation and cell dispersal. When extracellular matrix formation was monitored, the fluorogenic optotracer EbbaBiolight 680 (Ebba Biotech), which labels bacterial amyloids such as curli as well as certain matrix polysaccharides, was added to the medium at a 1:500 dilution. When present, SYTOX Orange, which stains permeabilized cells, was added at a final concentration of 50 nM.
Microscopy
Images were acquired using a Nikon Ti2-E inverted microscope equipped with a Photometrics Prime BSI back-illuminated sCMOS camera (2,048 × 2,048 px, 6.5 μm pixel size), a ×100 Plan Apo 1.45NA Ph3 oil objective (with type N immersion oil by Nikon), a Lumencor Spectra III LED (light emitting diode) engine, a Perfect Focus System (PFS), temperature-controlled Okolab enclosure and a polychroic mirror (FF-409/493/596-Di02 by Semrock) combined with a triple-pass emitter (FF-1-432/523/702-25 by Semrock) for mTagBFP2/GFP/mCherry. mTagBFP2, GFP (or SYTOX Green), mCherry (or mScarlet-I) were imaged using excitation at 365 nm, 488 nm and 594 nm, exposure of 300 ms, 200 ms and 200 ms, and a LED power of 75%, 20% and 30%, respectively (see ref. 35 for power measurements for the different light sources). A 5% transmission neutral density filter was also used to lower the LED power and reduce photobleaching and phototoxicity. All experiments were carried out at 37 °C unless indicated otherwise.
The microscope was controlled using NIS Elements software (Nikon), and an N-dimensional (ND) acquisition module was used to set and acquire the time-lapse images. Phase and fluorescence images were acquired every 1 min for the single-cell and wide-trench analyses or 10 min for some of the experiments with fluorescently labelled AMPs.
For experiments with PDMS microwells, cells were allowed to grow for ~30 min in the temperature-controlled enclosure before imaging. A 10× concentrated AMP solution was spiked in (at 1/10 the volume of the well) and mixed well by pipetting after ~20 min from the start of the image acquisition, without interrupting the time-lapse sequence. When the uptake of SYTOX Green was monitored, SYTOX Green was included in the AMP solution and spiked in during the experiment to obtain a final concentration of SYTOX Green of 50 nM in the well. This allowed us to monitor healthy cell growth before AMP treatment, to rapidly set the desired AMP (or SYTOX Green) concentration from one frame to the next (unlike for flow-controlled injection systems), and to resolve the AMP-induced phenotype in real time. The current design allows for testing up to 4 independent conditions in parallel.
For the biofilm imaging experiments, images were acquired on the same Nikon Ti2-E microscope described above, but using a ×40 Plan Apo 0.95NA air objective. As for the other experiments, a 5% transmission neutral density filter was kept in the light path to limit photobleaching and phototoxicity. Excitation intensities and exposures differed from the single-cell experiments: GFP was imaged using 488 nm excitation at 10% power, whereas the SYTOX Orange or amyloid stain EbbaBiolight 680 was imaged using 594 nm excitation at 50% power; images from both channels were acquired with a 100 ms exposure. To capture the 3D structure of the biofilm, z-stacks of 73 planes were acquired with a 0.6 µm step size (~43 µm total range), and the PFS was used to maintain focus over the course of the time lapse. Z-stacks were collected every 30 min for 45 frames (~22 h total) at 37 °C. The imaging enclosure was pre-warmed to 37 °C and a 50 ml water bath was placed inside it to mitigate evaporation.
In 5-TAMRA–AMP enrichment experiments (Fig. 4a and Extended Data Fig. 7a) that used strain MG1655, unlabelled AMPs at 2× MIC were supplemented with 50 nM of the corresponding 5-TAMRA–AMP conjugate to have an equal bulk concentration of the fluorescent label for quantifying intracellular fluorescence increase over time. In co-localization experiments that used strains CJW7020 and CJW7859 (Fig. 4c), unlabelled AMPs at concentrations equivalent to 2× MIC (or 1.5× MIC for PR-39) were supplemented with 5% of the corresponding 5-TAMRA-labelled AMP. Only for PR-39 and Bac7 and only for estimating the SCF* (Fig. 4c), the labelled:unlabelled concentration ratio was increased to 25:75 and 50:50, respectively, to increase the fluorescent signal and improve the calculation of the SCF*. Selected images in Fig. 4b,d and Extended Data Fig. 7b–d were chosen at times where both signal intensities from fluorescently labelled AMPs and cytoplasmic macromolecules (DNA or ribosomes) were the highest to aid visualization of both molecules. The different timepoints for the different fluorescently labelled AMPs or macromolecules reflect the difference in uptake kinetics or stability of the label over time (for example, HupA-msfGFP signal under Tac1 treatment exhibited a fast decay as a result of cell permeabilization).
In wide-trench microfluidics experiments, CJW7753, CJW7845 or CJW7859 cells were allowed to grow for >1 h with running fresh medium in the temperature-controlled enclosure to reach steady-state conditions before imaging. When present, SYTOX Green was added with the AMPs at 5 nM.
Image processing and analysis of PDMS-microwells single-cell data
To analyse the single-cell experiments in microwells, OmniSegger software (https://github.com/tlo-bot/omnisegger), which combines SuperSegger MATLAB-based suite60 for cell analysis with Omnipose segmentation61, was used to first process the microscopy images by performing drift correction, cell segmentation and cell linking. Given that AMP-treated cells can display extreme phenotypes, such as exceedingly bright and/or heterogeneous phase-contrast signal (probably a result of the widely changing intracellular density upon AMP treatment) and that the software’s pre-trained model ‘bact_phase_omni’61 tended to split cells before cell division was completed, a new Omnipose model was trained from scratch starting from ‘bact_phase_omni’-generated masks that were further corrected and curated using custom-made Python scripts (screening_good_bad.py and generate_training_dataset.py). Details on the Omnipose model retraining can be found in a previous publication62. The final model (omnipose_phase_microwells_model) and corresponding training datasets are available at https://github.com/JacobsWagnerLab/published/tree/master/Fragasso_et_al_2025 and BioImage Archive (accession number S-BIAD1823), respectively.
MATLAB files of the linked cell trajectories output from OmniSegger were then imported, background subtracted using ‘background_subtraction.py’ (adapted from a previous study35) and converted to Python data structures (import_processing_code.py), from which cell features such as cell area, nucleoid area, mean fluorescence intensity and so on were extracted for each cell at each frame. The exported dataframes were further processed to estimate instantaneous growth rates and were run through a series of functions to perform curation based on cell areas and instantaneous growth rates over time (post_processing_curation_functions.py). Cell trajectories that: (1) were too short (<30 min), (2) exhibited exceedingly large or small values in normalized (by area) instantaneous growth rate (>0.04 min−1 or <−0.02 min−1), (3) had first 10 frames not featuring normal healthy growth (<0.005 min−1) or (4) had last 10 frames not featuring growth arrest (>0.005 min−1), were removed from further analysis. In this way, only cells that exhibited healthy growth followed by growth arrest were analysed, that is, those cells for which the growth arrest-associated AMP phenotype was fully resolved.
Estimation of the timing of membrane permeabilization events relative to the growth rate inhibition
Analysis of strain CJW7845 proceeded by extracting the timings of permeabilization of the outer and inner membranes based on the mean fluorescence intensities of mScarlet-I and/or mTagBFP2 fluorescent proteins (using the function ‘get_permeabilization_time.py’), cell growth arrest and the initiation time of growth inhibition. To obtain accurate timings underlying membrane permeabilization events, information from both the signal intensity itself as well as its derivative were combined, which enabled us to accurately resolve the relevant changes in fluorescent protein signal beyond the intrinsic high-frequency noise and low-frequency photobleaching. Inner-membrane permeabilization to proteins can result in two possible phenotypes when simultaneously monitoring freely diffusing periplasmic and cytoplasmic probes, depending on which membrane (outer or inner) becomes permeabilized first. When the outer membrane is permeabilized first, mScarlet-I signal is lost first, followed by mTagBFP2 when the inner membrane becomes also permeabilized. Conversely, when the inner membrane is permeabilized first, mScarlet-I diffuses into the cytoplasm and mixes with mTagBFP2. To detect inner-membrane permeabilization when the outer membrane remained intact (that is, mScarlet-I leaks into the cytoplasm), the difference between periplasmic and cytoplasmic contributions of the mScarlet-I signal was computed, where periplasmic contribution corresponded to the mean fluorescence intensity of mScarlet-I within the 5-pixel thick outermost layer of the cell mask, while the cytoplasmic contribution was calculated by averaging pixel fluorescence intensities within a 7-pixel eroded mask. This way, the obtained difference Δ(peri,cyto)mScarlet-I remains overall positive when mScarlet-I is localized in the periplasm and becomes rapidly negative when the inner membrane becomes permeabilized as mScarlet-I diffuses into the cytoplasmic region. Detection of the permeabilization event relied on both Δ(peri,cyto)mScarlet-I and its normalized first derivative, which was computed by using a 5-point moving window to evaluate the local slope across the signal and dividing it by the signal itself.
When IM was permeabilized after the OM, detection of such event relied on detection of the rapid decrease of the mScarlet-I signal first (OM permeabilization), followed by the loss of the mTagBFP2 (IM permeabilization). Both signals were treated in the same way as Δ(peri,cyto)mScarlet-I for detecting permeabilization events, that is, by using information from both the signal itself as well as their normalized first derivative.
The time marking the initiation of growth inhibition and the growth arrest were obtained by defining a multiscale instantaneous growth rate with weights (multi_scale_derivative.py). Specifically, this function computes the weighted average of the first derivatives of differently smoothened cell areas, where these were computed using a Savitzky–Golay filter with varying moving windows. The normalized growth rate \({\mathrm{GR}}_{\mathrm{norm}}\left(t\right)\) can be expressed as
$${\mathrm{GR}}_{\mathrm{norm}}\left(t\right)=\frac{1}{\sum _{i=1}^{N}{w}_{i}}\sum _{i=1}^{N}\frac{{w}_{i}}{{A}_{i,\mathrm{smooth}}\left(t\right)}\frac{d{A}_{i,\mathrm{smooth}}\left(t\right)}{{dt}},\,N=5,$$
(1)
$${A}_{i,\mathrm{smooth}}\left(t\right)=\mathrm{SG}({A\left(t\right),\mathrm{window}}_{i})$$
(2)
where \({w}_{i}\) is the ith weight, \({A}_{i,\mathrm{smooth}}\left(t\right)\) is the ith smoothened area signal, SG is the Savitzky–Golay filter63 (implemented using the Python function ‘scipy.signal.savgol_filter’), \({\mathrm{window}}_{i}\) is the ith moving window size for smoothing and \(A\left(t\right)\) is the original cell area signal. For the current implementation, window sizes were set to be 3, 5, 7, 9 and 11, with corresponding weights of 5, 8, 10, 8 and 5, which were found by empirical optimization to capture growth arrest both in the case of fast cell shrinking events (induced by class I AMPs), where growth rate changes abruptly between one frame and the next one, as well as when growth is slowly inhibited (for example, induced by class II AMP treatment). As displayed in Extended Data Fig. 2a, the start of growth inhibition is defined as the first frame where \({\mathrm{GR}}_{\mathrm{norm}}\left(t\right)\le 0.01\) min−1 and remains stably below 0.012 min−1 for at least 30 consecutive frames. Growth arrest is defined as the first frame where \({\mathrm{GR}}_{\mathrm{norm}}\left(t\right)\le 0\) min−1 and remains stably below 0.005 min−1 for at least 30 consecutive frames. The use of a higher threshold to evaluate stability over consecutive frames was necessary to account for noise fluctuations of the \({\mathrm{GR}}_{\mathrm{norm}}\left(t\right)\) signal. Scatterplots presented in Figs. 1e, 2c and 3d,g, and in Extended Data Figs. 5b,d and 6b,f were obtained using these different metrics.
Computation of the single-cell kymographs
To compute the kymographs (Fig. 2d,e, and Extended Data Figs. 3 and 5e,f), a function was first used to compute the medial axis (smooth line longitudinally crossing the mid-cell) from each cell mask (get_medial_axis.py). Briefly, the medial axis was computed by first upsampling the cell mask by 20-fold in both x and y. Upon smoothing of the cell mask boundary, the Python function ‘skeletonize’ (from ‘skimage.morphology’) was then used to trace the cell skeleton, which roughly corresponds to the set of pixels that are the farthest away from the cell boundary. To find the cell poles, linear regressions were fitted to the computed skeleton’s extremities, specifically to the first and last three-eighths of its length, and the intersections between the extrapolated lines and the cell boundary were identified as the cell poles. Finally, a third-order polynomial function was fit to the skeleton points and the poles to compute the medial axis.
Upon defining the medial axis, cell pixel (x,y) coordinates could then be mapped into medial axis coordinates (l,d, where l is the length along the medial axis and d is the minimum distance from the medial axis; get_1D_proj_medial.py). Mean intensity projections along the medial axis length of the pixels with d < 4 px were computed by averaging together the pixels with the same l coordinate (kymograph_single_cell.py). Given that medial axis coordinates were computed with subpixel resolution using a 20× augmentation factor, the medial axis length was binned using equal bins with the original pixel size (0.065 μm px−1). The resulting mean intensity projections along the medial axis length were then plotted over time to obtain the final kymographs.
Analysis of intracellular perturbations upon AMP uptake
To analyse strain CJW7753, the signal correlation factor (SCF) was computed by estimating the pixel-based Spearman correlation between the RplA-GFP and HupA-mCherry signal over a 4-px eroded cell mask. Exclusion of the outer 4-px cell layer was necessary to remove the effect of cell curvature in the proximity of the cell edge, which causes both fluorescence signals to decrease in intensity (thus causing an artefactual positive correlation). To calculate the nucleocytoplasmic (NC) ratio (the ratio between nucleoid length and cell length), a mask was applied to the HupA-mCherry signal to determine the nucleoid region (nucleoid_mask.py). Then, projections of the nucleoid pixel coordinates onto the cell medial axis were computed to estimate the arc length, that is, the nucleoid length obtained by calculating the Euclidean distance between consecutive pairs of pixels along the nucleoid projections. The arc length of the full medial axis, that is, the cell length, was estimated using the same approach (nucleoid_cell_length.py). Cell trajectories were then aligned by the SCF peak using a multistep alignment approach (time_alignment.py). Given that the SCF signal can generally have multiple local maxima during the evolution of the phenotype after growth arrest (due to, for example, progressive loss of cell biomass, which decreases de-mixing between DNA and ribosomes, thus increasing SCF), cell trajectories for class I peptides (which featured a global peak in area that is time associated with the SCF peak) were first aligned by peak area (here the maximum value of the area), which allowed us to first roughly synchronize the trajectories by growth arrest. Then, the maximal SCF value (max SCF) within a narrow time window (±5–10 min) from the peak area was used to align the trajectories by the peak SCF value, resulting in all cells being synchronized by the start of their intracellular perturbations (peak SCF). For class II peptides, since the area global maximum is not generally associated with cell growth arrest, the minimum NC ratio was first used to align trajectories, and then the max SCF value was searched within a narrow time window (±5–10 min) to obtain the peak SCF value. Given that for class II AMPs (PR-39, Bac7, Tur1A and CamBac), the SCF peak is broad (tens of minutes) compared to noise fluctuations, a smoothened SCF (using a 12-point moving average window) was used for both determining the peak SCF (which improved robustness against noise) and computing the ensemble curves in Fig. 3f and Extended Data Fig. 4. The time alignment step resulted in a new time axis that featured an SCF peak at t = 0 and which was used to generate the ensemble plots in Fig. 3c,f and Extended Data Fig. 4. From this, the timing of peak SCF could also be extracted and was used in the scatterplots in Fig. 3d,g.
Analysis of fluorescently labelled AMP uptake and spatial localization
For Fig. 4a and Extended Data Fig. 7a, images of MG1655 cells were acquired every 1 min to enable accurate cell tracking (using OmniSegger) and probe the intracellular 5-TAMRA–AMP enrichment as a function of time aligned by the start of growth inhibition. The analysis steps for single-cell analysis were performed as explained in the ‘Image processing and analysis of PDMS-microwells single-cell data’ section.
In contrast, to analyse the localization of fluorescently labelled AMPs (Fig. 4c) in CJW7020 cells (expressing RplA-msfGFP) or CJW7859 cells (expressing HupA-msfGFP), images were acquired every 10 min to increase the number of fields of view, and thereby the n value, per condition since the focus of this experiment was to correlate the fluorescently labelled AMPs’ spatial localization with fluorescently labelled cytoplasmic macromolecules (ribosomes and DNA) after uptake, without the need to track single cells over time. For this reason, OmniSegger was used here only to perform drift correction and cell segmentation, whereas mask labelling, cropping of individual cell regions and feature extraction were performed using a custom-made Python script (import_processing_no_linking_code.py). Since no single-cell growth rate information was obtained, the curation of badly segmented or out-of-focus cells was performed using a different strategy. First, hard thresholds on cell area removed objects that were too large (>2,000 px) or too small (<500 px) to be cells. Second, out-of-focus cells were removed by computing the average of the pixel intensities in the 40th percentile of the pixel intensities in the peripheral region of the phase-contrast signal, where the peripheral region corresponded to the outermost 1-px-thick layer of the mask, computed from a 1-px eroded mask (the outer 1-px-thick layer of the original mask was thus removed to avoid cell curvature effects). Third, cells that displayed low mean fluorescence values for either fluorescently labelled AMPs (<100 a.u. for 5-TAMRA-labelled AMPs) or msfGFP-tagged macromolecules (<100 a.u.) were filtered out to include mostly cells that were sufficiently enriched with fluorescently labelled AMPs. To compute the spatial correlation between fluorescently labelled AMPs and the ribosomes or DNA markers (Fig. 4c), a modified version of SCF (SCF*) was defined to suppress the contributions from the region of the cell where both signals were low in intensity. Starting from a 1-px eroded mask, pixel-based Spearman correlation was computed between the pixel intensities in the 50th percentile of both channels. The resulting SCF* appears to represent more strongly the visually observed anti-co-localization between fluorescently labelled AMPs and the DNA marker HupA-msfGFP, while providing positive correlation values when the signals are co-localized (as reported in Fig. 4c for SCF* between fluorescently labelled AMPs and the ribosome marker RplA-msfGFP). The timepoints for evaluating the SCF* were chosen on the basis of having a sufficiently high signal for both fluorescent reporters. The timepoints (relative to addition of the AMP mixture) were 10 min, 50 min, 100 min, 30 min, 40 min and 80 min for 5-TAMRA–CecA, 5-TAMRA–Tac1, 5-TAMRA–LL-37, 5-TAMRA–PR-39, 5-TAMRA–Bac7 and 5-TAMRA–DJK-5, respectively, for RplA-msfGFP-expressing CJW7020, and 0 min (first frame after AMP addition), 50 min, 100 min, 30 min, 40 min and 120 min for 5-TAMRA–CecA, 5-TAMRA–Tac1, 5-TAMRA–LL-37, 5-TAMRA–PR-39, 5-TAMRA–Bac7 and 5-TAMRA–DJK-5, respectively, for HupA-msfGFP-expressing strain CJW7859.
Omnipose model training for segmentation of wide-trench data
To quantify single-cell growth rates in wide-trench microfluidics experiments, dedicated Omnipose models were trained for this imaging format using information from both phase-contrast and ribosome-fluorescence images. First, an initial training set was generated by applying the pre-trained ‘bact_fluor_omni’ model to the ribosome channel, manually curating the resulting masks and pairing these masks with the corresponding phase-contrast images. This dataset was used to train a preliminary phase-contrast wide-trench model from scratch using 353 images, 4,000 epochs, a learning rate of 0.1, GPU acceleration and 224 × 224 px training tiles.
This preliminary model was then applied to wide-trench images from multiple AMP treatments to expand the training set across AMP-induced phenotypes. After manual curation against the ribosome signal, a final ribosome-channel model (omnipose_ribo_wide-trench_model) was generated by fine-tuning bact_fluor_omni using 592 curated images, each containing 4 wide trenches, with the same training parameters. Finally, an improved phase-contrast model (omnipose_phase_wide-trench_model) was trained from scratch using 868 curated images generated by applying the ribosome-channel model to a subset of wide-trench data and screening the resulting masks against phase-contrast images. Although both phase-contrast and ribosome-channel models were generated, the final ribosome-channel model was used for the single-cell segmentation in Fig. 5c–f,i, Extended Data Fig. 8a,b, and Supplementary Videos 5 and 6 because it performed more robustly across treatment conditions and cellular phenotypes. The phase-contrast model was instead used to define the cell-containing regions for generating the SYTOX Green and LL-37 kymographs (Fig. 5g,h and Extended Data Fig. 8c,d,g). The final models and corresponding training datasets are available at https://github.com/JacobsWagnerLab/published/tree/master/Fragasso_et_al_2025 and BioImage Archive (accession number S-BIAD1823), respectively.
Wide-trench single-cell analysis of growth rate
To analyse wide-trench time-lapse images, drift correction was first performed using OmniSegger, followed by a custom Python script (drift_correction_wide_trenches.py) to correct for the slow residual drift that remained after the first correction step. The resulting drift-corrected time-lapse data were analysed with the OmniSegger pipeline using the ribosome-fluorescence wide-trench Omnipose model described above, allowing cell segmentation and cell linking to be performed in the same general manner as for the PDMS-microwell experiments.
The MATLAB files containing linked cell trajectories were imported and pre-processed using custom Python code (import_processing_code_wide-trench.py). Cell trajectories were then curated using ‘post_processing_curation_code_wide-trench.py’ to remove trajectories that: (1) were too short (<15 min), (2) exhibited exceedingly large or small values in normalized-by-area instantaneous growth rate (>0.04 min−1 or <−0.03 min−1) or (3) displayed large instantaneous centre-of-mass displacements (>50 px). This curation step was used to retain cells that were tracked for a sufficient number of frames to estimate meaningful growth rates, while excluding poorly linked trajectories or incorrectly segmented cells.
To compute the multitrench kymographs for growth rate (Fig. 5d–f,i and Extended Data Fig. 8a,b) from the curated single-cell trajectories, instantaneous growth rates were estimated and pooled across multiple trenches and/or biological replicates. Time was offset relative to the start of AMP injection, such that t = 0 min corresponded to AMP addition. To visualize spatially resolved growth dynamics inside the wide trenches, kymographs were computed using custom Python code (compute_kymo_growth_rate_wide-trench.py). For each cell at each timepoint, the y coordinate of the cell-mask centre of mass was binned into 12 px (0.79 µm). To remove isolated spurious cells or poorly supported bins from the kymographs, occupied time–position bins were pruned using an iterative neighbourhood filter. The resulting kymographs were plotted as the median normalized growth rate as a function of time and position along the trench. To generate the single-trench images or videos (Fig. 5c, and Supplementary Videos 5 and 6), the script ‘plot_single_trench_growth_rate.py’ was used to import single-cell growth rate data from individual trenches and combine with image sequences of the corresponding trenches. Generation of mp4 videos was carried out with the custom Python script ‘export_mp4_wide-trench.py’.
Kymograph generation and analysis of SYTOX Green and LL-37 fluorescence in wide trenches
Kymographs of SYTOX Green and LL-37 fluorescence in wide trenches (Fig. 5g,h and Extended Data Fig. 8c,d,g) were generated using a custom Python script (compute_kymo_fluor_wide-trench.py, plot_kymo_fluor.py) that relies on a shared functions library (quantify_fluor_kymo_functions.py). After applying drift correction (as described above), fluorescence and phase-contrast images were first background subtracted. To identify and restrict the phase-contrast signal to cell-containing regions, dilated Omnipose-derived masks were used. Wide trenches were detected from phase-contrast images by analysing the mean projection of the phase-contrast signal onto the x axis and using a peak detection algorithm to identify the trench vertical edges. Similarly, the top and bottom of the trench were also detected. These trench coordinates were then used to define the region of interest (ROI) for extracting fluorescence and phase-contrast signal intensities from each frame.
For each trench and timepoint, fluorescence and phase-contrast signals were projected onto the trench’s y axis by averaging pixel intensities, excluding 50 px from each side of the detected trench to avoid edge artefacts. Stacking these one-dimensional profiles over time generated kymographs showing signal intensity as a function of time and position along the trench. Single-trench kymographs (Fig. 5g,h) were generated by linking trenches across frames based on their x-centre position and retaining tracks present for at least 20 frames. Ensemble kymographs (Extended Data Fig. 8c,d,g) were generated by averaging y profiles across multiple trenches and/or positions at each frame. Time was aligned relative to AMP injection, with t = 0 min corresponding to AMP addition. Fluorescence kymographs were plotted overlaid on matched phase-contrast kymographs.
To estimate the time when LL-37 fluorescence reached the bottom of the wide trench, the same single-trench tracking approach was used to quantify fluorescence intensity in a bottom ROI of three individual empty trenches using the script ‘quantify_LL-37_fluor_empty_trench.py’. Mean LL-37 fluorescence was quantified in a 40 px band at the bottom of selected tracked trenches (Extended Data Fig. 8e), background corrected using a matched region outside the trench, aligned to AMP injection and plotted in Extended Data Fig. 8f.
Biofilm data processing and quantification
For the biofilm experiments, widefield fluorescence z-stacks were first deconvolved using Deconwolf 64 (https://deconwolf.fht.org/). Theoretical point-spread functions were generated with Deconwolf using an xy pixel size of 162.286 nm, a z-step size of 600 nm, 145 z-slices, NA = 0.95, refractive index = 1, and channel-specific emission wavelengths of 525 nm for GFP, 610 nm for SYTOX Orange and 640 nm for EbbaBiolight 680, and are available at the BioImage Archive (accession number S-BIAD1823). Deconvolution was performed for 50 iterations with GPU acceleration. To quantify biofilm fluorescence, Deconwolf outputs were analysed using custom Python scripts (quantify_biofilm_stats.py). The scaling factors reported in the Deconwolf log files were used to rescale each deconvolved stack before quantification. For each position and timepoint, the first 3 z-planes were excluded to remove slices below or immediately adjacent to the glass surface, and the subsequent 40 z-planes were retained for analysis. Total GFP and SYTOX Orange fluorescence signals were calculated by summing voxel intensities across the retained 3D volume and are displayed in Fig. 6c and Extended Data Fig. 9c, respectively. For the 3D renderings shown in Fig. 6a,b, Extended Data Fig. 9b and Supplementary Videos 10–17, deconvolved single-timepoint stacks were first bundled into 5D OME-TIFF, with dimensions corresponding to time, 2 fluorescence channels and 3 spatial dimensions, using a custom Python script (export_ome-tiff_from_dw_zstack.py). During OME-TIFF generation, Deconwolf scaling factors were applied, voxel-size metadata were stored using the physical pixel sizes in x, y and z, the first 4 z-planes were removed, and the central 50% of the field of view in x and y was retained. These OME-TIFF files were then converted to .ims files using ImarisFileConverter 11.0.1 (Oxford Instruments), imported into Imaris 10.2 (Oxford Instruments), rendered in 3D and exported as TIFF image sequences with one file per frame. A separate Python script (export_3D_imaris_montage.py) was used to generate the video montages showing combined top and side views of the different fluorescence channels.
Calculation of correlation coefficients
All Spearman’s correlations, used for SCF and SCF* calculations, were computed using the Python function ‘spearmanr’ in the scipy.stats library.
Analysis software and hardware
Drift correction and cell linking were performed with OmniSegger (https://github.com/tlo-bot/omnisegger), a modified version of SuperSegger, in MATLAB R2021a (www.mathworks.com). Omnipose61 (v.0.5.1; https://github.com/kevinjohncutler/omnipose) was installed in a local Miniconda environment. Omnipose retraining and segmentation, 3D deconvolution with Deconwolf64 (https://deconwolf.fht.org/), and computationally intensive tasks that involved operations on large arrays (background_subtraction.py; get_medial_axis.py) were accelerated by parallel processing on an NVIDIA A40 GPU utilizing compute unified device architecture (CUDA) to enhance performance. All custom-written code was developed using Python 3.10 (www.python.org). The following packages were employed in the analysis: numpy65, cupy66, pytorch67, pandas68, scipy69, matplotlib70, seaborn71 and scikit-image72 (versions are listed in the ‘Reporting Summary’). Interactive curation steps in the Omnipose retraining pipeline used the ‘keyboard’ package for key-press input. For 3D rendering, OME-TIFF files were converted to .ims files using ImarisFileConverter 11.0.1 (Oxford Instruments) and rendered using Imaris 10.2 (Oxford Instruments) on a workstation at the Stanford University Cell Sciences Imaging Facility (CSIF). Final figures were assembled using Adobe Illustrator 2022. Schematics in Fig. 5a were partially created in BioRender (https://BioRender.com/k9dmspd). Supplementary Videos 1–4 were exported as AVI files using Fiji/ImageJ73 v.1.54p and converted to mp4 using HandBrake 1.9.2 (https://handbrake.fr); for all the other videos, a Python script that made use of ‘imageio-ffmpeg’ was employed instead.
Statistics and reproducibility
The n values in the figure legends refer to the following units. In single-cell time-lapse experiments, n is the number of individual cells analysed. In wide-trench microfluidic experiments, n is given both as the number of trenches and as the number of cells they contain, pooled into each kymograph. In biofilm experiments, each well contained biofilms; the two fields of view acquired per well in each experiment were averaged, and statistics were computed across n = 3 independent experiments.
A biological replicate was defined as an independent experiment performed from an independent overnight culture. Imaging runs of the same culture on the same day (separate wells of the multiwell device) were treated as technical replicates and pooled. The number of independent experiments (biological replicates) for each condition and the number of cells, trenches or wells analysed are given in the figure legends.
Some conditions were imaged in a single independent experiment (Figs. 1c–e, 4b–d and 5e–i; Extended Data Figs. 2, 5, 6, 7b–d and 8). For these conditions, the statistics describe cell-to-cell variability within one biological replicate rather than variability between experiments. We consider this appropriate here for two reasons. First, each of these datasets contains many independent single-cell or single-trench measurements: from ~20 to several hundred cells per condition in the time-lapse experiments, and 12–32 trenches (2,590–7,730 cells) per condition in the wide-trench experiments, which are shown as ensemble kymographs averaged across trenches so that they report the typical behaviour rather than individual examples. Second, no conclusion rests on a single condition: each phenotype that defines a class was observed for several AMPs or PMs of that class, at 2× and 10× MIC, and with different strains and readouts.
Unless stated otherwise, time-course experiments show the mean across cells and a 95% CI obtained by bootstrap resampling of cells (1,000 resamples, ‘seaborn’; a fixed random seed was used so that the plotted intervals match the Source data). Absolute residuals (Extended Data Figs. 2b and 6c) are shown as mean and 95% bootstrap CI, and delays between start of growth inhibition and growth arrest (Extended Data Figs. 2c and 6d) as median and interquartile range (25th–75th percentile). Wide-trench microfluidic kymographs show, for each minute and 0.79 µm pixel, the median normalized growth rate of all cells in that pixel across all trenches of the condition. Biofilm quantifications (Fig. 6c and Extended Data Fig. 9c) are mean ± s.e.m. of n = 3 biological replicates, each from a separate well imaged on a different day. Within each biological replicate, 2 fields of view were acquired at different positions in the same well (technical replicates) and averaged into one value before the mean and s.e.m. were calculated. Points show individual biological replicates. MIC values were calculated as described above.
Micrographs, single-cell kymographs and single-cell traces shown as examples are representative of the cells quantified in the corresponding panels; the number of cells and experiments from which they were drawn is stated in each legend. No statistical tests were performed; data are presented descriptively. No statistical method was used to predetermine sample size; all cells that passed the segmentation, tracking and curation criteria described above were included. Investigators were not blinded to experimental conditions during data collection or analysis. Blinding was not feasible because each condition was prepared and imaged by the same investigator, and AMP treatments produce visibly distinct phenotypes. To limit bias, all quantitative analyses were performed with automated pipelines that applied the same segmentation, tracking, curation criteria and parameters to every condition.
For single-cell experiments, sample sizes were chosen to capture cell-to-cell variability (typically >100 cells per condition). Wide-trench conditions included 12–32 trenches, and biofilm and MIC experiments were performed in 3 or 4 biological replicates. Experiments were not randomized; within each experiment, a single clonal culture was split across the conditions, which were then imaged or measured under identical settings.
Reporting summary
Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.