Bacterial isolates and growth conditions
Prior to experimentation, all isolates (Table 1) were grown on Isosensitest agar (Oxoid, CM0471) and subjected to ciprofloxacin M.I.C.E. (Oxoid, MA0104F) or Etest (BioMerieux, 412311) to determine baseline ciprofloxacin susceptibility. Isolates were maintained on Isosensitest agar and streaked fresh weekly from frozen stocks. To prepare for imaging experiments, isolates were always inoculated into 10 ml Isosensitest broth (Oxoid, CM0473) from plates, followed by overnight shaking at 37°C for 16–18 h.
GyrA spontaneous mutants
To isolate spontaneous nalidixic acid mutant lines from S. Typhimurium isolates SL1344 and D23580, bacterial cultures were grown overnight in L-broth, and 100 µl of this was spread onto L-agar containing 100 µg/ml nalidixic acid for initial spontaneous mutant generation. After overnight incubation at 37°C, single colonies that had grown were re-plated on L-agar also containing 100 µg/ml nalidixic acid. Any colonies that were present on these agar plates were then streaked serially onto agar plates harbouring increasing concentrations of nalidixic acid up to 400 µg/ml, then these were switched to plates containing ciprofloxacin, harbouring from 0.1 µg/ml ciprofloxacin up to 1.0 µg/ml ciprofloxacin. Once colonies were able to grow stably on 1.0 µg/ml ciprofloxacin, pure cultures were established and saved as frozen stocks. From the frozen stocks, overnight cultures were grown for genomic DNA purification and were purified using the Promega Wizard DNA Purification Kit (Promega, A1120). Following purification, DNA was PCR-amplified to check for single nucleotide polymorphisms (SNP) in the QRDR of gyrA using primers: 5’-GAGATGGCCTGAAGC-3’ for nucleotides 108 to 127 and 5’-TACCGTCATAGTTATCCA CG -3’ for nucleotides 435 to 454, forward and reverse, respectively41. A C◊A SNP change was found was found in gyrA. To evaluate genetic differences between parent and isogenic strains, the isogenic and parent strains were grown for 24 h in Isosensitest broth prior to genomic DNA isolation for whole genome sequencing (detailed below).
Ciprofloxacin susceptibility testing by MIC eTest
Isolates were streaked from frozen stocks on Isosensitest plates and grown at 37°C. Three serial streaks on fresh plates were subsequently performed. For M.I.C.E. or Etest application, a few colonies from each plate were inoculated in ~ 3 ml PBS and vortexed well to create a slightly cloudy solution. 100 µl of the solution was spotted on Isosensitest plates and spread well before gently laying down the MIC test strip. Inoculated and control plates were incubated overnight at 37°C and then visually analysed. Each S. Typhimurium isolate was tested a minimum of two times to ensure an accurate reading.
Time kill curves
Four S. Typhimurium isolates were chosen for the initial time kill curve analysis, performed as in (ref Sridhar et al., 2021). These were D23580, SL1344, SL1344gyrA, VNS2008142–45. Initially, colonies from plates were inoculated into 10 ml of Isosensitest broth, and these were shaken at 200 rpm at 37°C overnight. 10 µl of the subsequent culture was then added to 990 µl of 1x PBS to make a 1:100 dilution for the inoculum. 100 µl of this preparation was added to 10 ml of Isosensitest containing different levels (0x, 1x, 2x, 4x MIC) of ciprofloxacin according to the predetermined MIC of each isolate (µl). The starter inoculum was between 1 and 5 x 105 CFU/ml. Cultures were incubated shaking at 37°C, and aliquots were taken to determine colony forming units (CFU) at 0, 2, 4, 6, 8, and 24 h. For this analysis, serial dilutions were made using samples of each culture, and a total of 50 µl of each dilution was plated using 10 µl spots of inoculum onto L-agar. CFUs were counted and determined as CFU/ml. Means and standard deviations (SD) of three replicates per isolate were calculated.
Bacterial whole genome sequencing
Library preparation for Illumina sequencing was undertaken at the Wellcome Sanger Institute using automated systems using the IHTP WGS NEB Ultra II library kit. Libraries were sequenced on an Illumina HiSeq platform (Illumina, San Diego, USA) using standard running protocols. Illumina adapter content was removed from the reads using Trimmomatic v.0.33. Reads mapping was undertaken using the WSI bacterial mapping pipeline, which uses bwa, and de novo assembly was performed using Velvet46. For SL1344gyrA and D23580gyrA mutants, Illumina HiSeq reads for the isogenic mutants and parental strains were mapped to the parental reference strain: SL1344 (FQ312003.1) and D23580 (FN424405.1), respectively, using SMALT v0.7.4 (sanger.ac.uk/resources/software/smalt/) to produce a BAM file43,47. Briefly, variant detection was performed as detailed here: SAMtools mpileup v0.1.19 with parameters -d 1000 -DSugBf and bcftools v0.1.1948 were used to generate a BCF file of all variant sites. The bcftools variant quality score was set as greater than 50, mapping quality was set as greater than 30, the allele frequency was determined as either 0 for bases called same as the reference or 1 for bases called as a SNP (af1 < 0.95), the majority base call was set to be present in at least 75% of reads mapping at the base (ratio < 0.75), the minimum mapping depth was four reads, a minimum of two of the four had to map to each strand, and strand_bias was set as less than 0.001, map bias less than 0.001, and tail_bias less than 0.001. Bases that did not meet those criteria were called uncertain and removed. A pseudogenome was constructed by substituting the base calls in the BCF file in the reference genome. Recombinant regions in the chromosome, such as prophage regions ,were removed from the alignment and checked using Gubbins v1.4.1049. SNP sites were extracted from the alignment using snp-sites and analysed manually. SNPs in gyrA identified by PCR were confirmed. For SL1344gyrA, a SNP (C◊A) at position 2373805 was found to confer a D87Y mutation in GyrA.
Opera Phenix imaging
Two separate Opera Phenix experiments were performed. The first experiment was a 24-hour evaluation of bacterial growth under four ciprofloxacin concentrations (0\(\times\), 1\(\times\), 2\(\times\), 4\(\times\)MIC) at two-hour increments (2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24) conducted on four isolates SL1344, SL1344gyrA, D23580, and VNS20081, which has been previously described in Sridhar et al.50 Briefly, 150 µl of each isolate was inoculated 1:1000 in 150 ml Isosensitest broth with each appropriate concentration of ciprofloxacin in a 200-ml flask and incubated at 37°C shaking at 200 rpm. Following 2 h of growth, 10 ml of each culture was removed from the flask, and the flask was returned to the incubator. The 10 ml fraction was centrifuged at 3200 x g for 7 min at 4°C, and the supernatant was decanted. The pellet was resuspended in 100 µl PBS, and 50 µl was added to two wells of a vitronectin-coated Opera CellCarrier Ultra-96 well plate (Perkin Elmer, 6055302). The plate was statically incubated at 37°C for 10 min, after which the bacterial cultures were aspirated, fixed in 4% paraformaldehyde (PFA) for 10 minutes, and washed with 1x PBS. After fixation, the plate of fixed bacteria was kept at 4°C until the next time point. The same protocol was followed for each time point with this exception: once there was sufficient bacterial growth (as assessed visually), 10 ml of bacteria was still removed from the flask at each time point; however, the culture was either centrifuged and resuspended in 250 µl or 50 µl dense cultures were added neat to wells. Upon completion of the 24-h period, wells were incubated with 2% bovine serum albumin (BSA) for 30 min and then for 1 h at ambient temperature in the dark with CSA-Alexa Fluor 647 (Novus Biologicals, NB110-16952AF647) at 1:1000 in BSA. Wells were aspirated and then incubated with solutions containing 1:100 4′,6-diamidino-2-phenylindole (DAPI) (Invitrogen, D1306) and 1:200 SYTOX green (Invitrogen, S7020) for 20 min. Wells were washed 1× with PBS; plates were sealed and imaged. Three biological replicates of this experiment were performed for D23580 and VNS20081; two biological replicates were performed for SL1344 and SL1344gyrA.
The second Opera Phenix imaging experiment used 16 of the 17 isolates detailed in Table 1, including all except D23580. Here, the only time point assessed was 22 h, and no ciprofloxacin treatment was used. However, to maintain experimental consistency with the previous experiment, cultures were grown like before in 150 ml Isosensitest, and 10 ml of culture was removed every two hours to mimic the change in growth condition. At the 22 h time point, 50 µl of each culture was added (neat) to two wells of a vitronectin-coated Opera CellCarrier Ultra-96 well plate, and the same fixation and staining protocol as above was used.
Opera Phenix analysis
Analysis was performed using a Perkin Elmer Harmony software analysis pipeline designed for S. Typhimurium, as previously described12,50. Briefly, inputted images were subjected to flatfield correction, and images were calculated using the DAPI and AlexaFluor 647 channels. Image calculations were refined by size and shape characteristics. A linear classifier was applied to the filtered population, single bacteria were identified, and morphology and intensity characteristics were calculated. The output of the Harmony analysis was tabulated by plate and object, and results were further analysed and visualised in R (v 3.6.1)51 using packages ‘dplyr’ and ‘ggplot2’52. Adobe Illustrator was used to format images and graphs for presentation.
AMR in silico analysis
ARIBA (v2.14.6)53 using the Comprehensive Antimicrobial Resistance Database (CARD, v3.1.3)54 with default parameters was used on reads data of all isolates to determine AMR genes. Results were cross-checked using ResFinder55.
Machine Learning data analysis
Averaged morphological data was analysed using Matlab (R2021a), Python (version 3.5), and R (version 4.0.5)51 programming language based on toolbox, package, and library availability. PCoA was performed using ‘vegan’ package56. Heatmap and spider plots were generated with ‘pheatmap’57 and ‘fmsb’58 packages respectively. Other plots were created with ‘ggplot2’59 and ‘ggsci’60 packages in R. Pairwise Kruskal-Wallis tests were performed using ‘ggpubr’ package61. For feature selection, ‘randomForestSRC’ package62 was utilized to train a random forest model with default parameters and 1,000 decision trees. Features were selected and ranked decreasingly by importance index extracted from the random forests.
To assess segregation of the isolates, we defined an index named distance ratio \(r\left({X}_{1},\dots ,{X}_{k},\dots ,{X}_{n}\right)\) as the following equation
$$r\left({X}_{1},\dots ,{X}_{k},\dots ,{X}_{n}\right)=\frac{\mathbb{E}{\left({‖{x}^{\left(i\right)}-{x}^{\left(j\right)}‖}_{2}\right)}_{{x}^{\left(i\right)}\in {X}_{k}, {x}^{\left(j\right)}\in {X}_{k}}}{\mathbb{E}{\left({‖{x}^{\left(i\right)}-{x}^{\left(j\right)}‖}_{2}\right)}_{{x}^{\left(i\right)}\in {X}_{k}, {x}^{\left(j\right)}\notin {X}_{k}}}$$
where \({X}_{k}\) is data group, e.g., resistant versus susceptible, \({x}_{i}\) is a datapoint, \(\mathbb{E}\left(.\right)\) is statistical mean, and \({‖.‖}_{2}\) is Euclidean norm. A low distance ratio indicates data points within one group are closely related while well separated from ones in other groups.
The ‘Statistics and Machine learning’ toolbox on Matlab was used to train the Naïve Bayes classifier, KNN classifier, SVM, and random forest. Neural network and CatBoost were trained with the ‘Neural network’ toolbox on Matlab and ‘CatBoost’ library63 on Python, respectively. Grid-search algorithm was employed to optimize the hyperparameters of all the machine-learning models. Optimal hyperparameters were chosen, on the validation set, corresponding to the highest accuracy defined as
$$ACC=\frac{TP+TN}{P+N}$$
where P was the number of actual resistant isolates in the data, N was the number of actual susceptible isolates, TP was the number of accurately predicted resistant isolate, and TN was the number of accurately predicted susceptible isolate. Other metrics for performance evaluation, including sensitivity (SEN), specificity (\(SPE\)), precision (PRE), and F1 score, can be described as the follows
$$F1=\frac{2PRE\times SEN}{PRE+SEN}$$
where P was number of predicted resistant isolates. ROC AUC was calculated with ‘perfcurve’ function on Matlab. For interpretation of the machine learning models, particularly neural networks, an in-house code was built to generate Partial Dependence Plot (PDP)64 and Individual Conditional Expectation (ICE)65 plot. In the ICE plot, for each datapoint in \({\left\{\left({x}_{S}^{\left(i\right)},{x}_{C}^{\left(i\right)}\right)\right\}}_{i=1}^{N}\), the curve \(\widehat{{f}_{S}^{\left(i\right)}}\) representing models’ output is plotted against \({x}_{S}^{\left(i\right)}\), while \({x}_{C}^{\left(i\right)}\) remains fixed, where \(N\) is the size of the dataset, \(i\) is index of the \(i\)th datapoint, \({x}_{S}\) is the interpreted feature, \({x}_{C}\) is other input features. PDP was defined as average of ICE
$$\widehat{{f}_{{x}_{S}}}\left({x}_{S}\right)={\mathbb{E}}_{{x}_{S}}\left[\widehat{f}\left({x}_{S},{x}_{C}\right)\right]=\int \widehat{f}\left({x}_{S},{x}_{C}\right)d\mathbb{P}\left({x}_{C}\right)$$
In practice, the partial function \(\widehat{{f}_{{x}_{S}}}\) is estimated by calculating averages on the dataset
$$\widehat{{f}_{{x}_{S}}}\left({x}_{S}\right)=\frac{1}{N}{\sum }_{i=1}^{N}\widehat{f}\left({x}_{S},{x}_{C}^{\left(i\right)} \right)$$