Early use of effective antimicrobial treatments is critical for the outcome of infections and the prevention of treatment resistance. Antimicrobial resistance testing enables the selection of optimal antibiotic treatments, but current culture-based techniques can take up to 72 hours to generate results. We have developed a novel machine learning approach to predict antimicrobial resistance directly from matrix-assisted laser desorption/ionization–time of flight (MALDI-TOF) mass spectra profiles of clinical isolates. We trained calibrated classifiers on a newly created publicly available database of mass spectra profiles from the clinically most relevant isolates with linked antimicrobial susceptibility phenotypes. This dataset combines more than 300,000 mass spectra with more than 750,000 antimicrobial resistance phenotypes from four medical institutions. Validation on a panel of clinically important pathogens, including Staphylococcus aureus, Escherichia coli and Klebsiella pneumoniae, resulting in areas under the receiver operating characteristic curve of 0.80, 0.74 and 0.74, respectively, demonstrated the potential of using machine learning to substantially accelerate antimicrobial resistance determination and change of clinical management. Furthermore, a retrospective clinical case study of 63 patients found that implementing this approach would have changed the clinical treatment in nine cases, which would have been beneficial in eight cases (89%). MALDI-TOF mass spectra-based machine learning may thus be an important new tool for treatment optimization and antibiotic stewardship.
This is a preview of subscription content, access via your institution
Access Nature and 54 other Nature Portfolio journals
Get Nature+, our best-value online-access subscription
$29.99 per month
cancel any time
Subscribe to this journal
Receive 12 print issues and online access
$189.00 per year
only $15.75 per issue
Rent or buy this article
Get just this article for as long as you need it
Prices may be subject to local taxes which are calculated during checkout
The full datasets generated during and analyzed during the current study are available in the Dryad repository, https://doi.org/10.5061/dryad.bzkh1899q.
All R and Python scripts can be found in https://github.com/BorgwardtLab/maldi_amr under a BSD 3-Clause License.
World Health Organization. Global Action Plan on Antimicrobial Resistance (WHO, 2016).
Wise, R. et al. Antimicrobial resistance. Is a major threat to public health. BMJ 317, 609–610 (1998).
Cassini, A. et al. Attributable deaths and disability-adjusted life-years caused by infections with antibiotic-resistant bacteria in the EU and the European Economic Area in 2015: a population-level modelling analysis. Lancet Infect. Dis. 19, 56–66 (2019).
Kumar, A. et al. Duration of hypotension before initiation of effective antimicrobial therapy is the critical determinant of survival in human septic shock. Crit. Care Med. 34, 1589–1596 (2006).
Seymour, C. W. et al. Time to treatment and mortality during mandated emergency care for sepsis. N. Engl. J. Med. 376, 2235–2244 (2017).
Huang, A. M. et al. Impact of rapid organism identification via matrix-assisted laser desorption/ionization time-of-flight combined with antimicrobial stewardship team intervention in adult patients with bacteremia and candidemia. Clin. Infect. Dis. 57, 1237–1245 (2013).
Osthoff, M. et al. Impact of MALDI-TOF-MS-based identification directly from positive blood cultures on patient management: a controlled clinical trial. Clin. Microbiol. Infect. 23, 78–85 (2017).
Banerjee, R. et al. Randomized trial of rapid multiplex polymerase chain reaction-based blood culture identification and susceptibility testing. Clin. Infect. Dis. 61, 1071–1080 (2015).
Kommedal, Ø., Aasen, J. L. & Lindemann, P. C. Genetic antimicrobial susceptibility testing in Gram-negative sepsis: impact on time to results in a routine laboratory. APMIS 124, 603–610 (2016).
Centers for Disease Control and Prevention. Core Elements of Antibiotic Stewardship https://www.cdc.gov/antibiotic-use/core-elements/index.html (2019).
Bourdon, N. et al. Rapid detection of vancomycin-resistant enterococci from rectal swabs by the Cepheid Xpert vanA/vanB assay. Diagn. Microbiol. Infect. Dis. 67, 291–293 (2010).
Huh, H. J., Kim, E. S. & Chae, S. L. Methicillin-resistant Staphylococcus aureus in nasal surveillance swabs at an intensive care unit: an evaluation of the LightCycler MRSA advanced test. Ann. Lab. Med. 32, 407–412 (2012).
Cury, A. P. et al. Diagnostic performance of the Xpert Carba-RTM assay directly from rectal swabs for active surveillance of carbapenemase-producing organisms in the largest Brazilian University Hospital. J. Microbiol. Methods 171, 105884 (2020).
van Belkum, A., Welker, M., Pincus, D., Charrier, J. P. & Girard, V. Matrix-assisted laser desorption ionization time-of-flight mass spectrometry in clinical microbiology: what are the current issues? Ann. Lab. Med. 37, 475–483 (2017).
Croxatto, A., Prod’hom, G. & Greub, G. Applications of MALDI-TOF mass spectrometry in clinical diagnostic microbiology. FEMS Microbiol. Rev. 36, 380–407 (2012).
Dierig, A., Frei, R. & Egli, A. The fast route to microbe identification: matrix assisted laser desorption/ionization-time of flight mass spectrometry (MALDI-TOF MS). Pediatr. Infect. Dis. J. 34, 97–99 (2015).
Hou, T.-Y., Chiang-Ni, C. & Teng, S.-H. Current status of MALDI-TOF mass spectrometry in clinical microbiology. J. Food Drug Anal. 27, 404–414 (2019).
Kim, J.-M. et al. Rapid discrimination of methicillin-resistant Staphylococcus aureus by MALDI-TOF MS. Pathogens 8, 214 (2019).
Weis, C. et al. Topological and kernel-based microbial phenotype prediction from MALDI-TOF mass spectra. Bioinformatics 36, i30–i38 (2020).
Vervier, K., Mahé, P., Veyrieras, J.-B. & Vert, J.-P. Benchmark of structured machine learning methods for microbial identification from mass-spectrometry data. Preprint at https://arxiv.org/abs/1506.07251 (2015).
Weis, C. V., Jutzeler, C. R. & Borgwardt, K. Machine learning for microbial identification and antimicrobial susceptibility testing on MALDI-TOF mass spectra: a systematic review. Clin. Microbiol. Infect. 26, 1310–1317 (2020).
Wang, H.-Y. et al. A large-scale investigation and identification of methicillin-resistant Staphylococcus aureus based on peaks binning of matrix-assisted laser desorption ionization–time of flight MS spectra. Brief. Bioinform. 22, bbaa138 (2021).
World Health Organization (WHO). WHO publishes list of bacteria for which new antibiotics are urgently needed. https://www.who.int/news-room/detail/27-02-2017-who-publishes-list-of-bacteria-for-which-new-antibiotics-are-urgently-needed (2017).
Centers for Disease Control and Prevention. Antibiotic resistance threats in the United States, 2019. https://doi.org/10.15620/cdc:82532 (2019).
Zhang, H. et al. An empirical framework for domain generalization in clinical settings. In CHIL '21: Proceedings of the Conference on Health, Inference, and Learning 279–290 (Association for Computing Machinery, 2021) https://doi.org/10.1145/3450439.3451878
Bevan, E. R., Jones, A. M. & Hawkey, P. M. Global epidemiology of CTX-M β-lactamases: temporal and geographical shifts in genotype. J. Antimicrob. Chemother. 72, 2145–2155 (2017).
Pietsch, M. et al. Molecular characterisation of extended-spectrum β-lactamase (ESBL)-producing Escherichia coli isolates from hospital and ambulatory patients in Germany. Vet. Microbiol. 200, 130–137 (2017).
Kim, Y.-K. et al. Bloodstream infections by extended-spectrum beta-lactamase-producing Escherichia coli and Klebsiella pneumoniae in children: epidemiology and clinical outcome. Antimicrob. Agents Chemother. 46, 1481–1491 (2002).
Potron, A., Poirel, L., Rondinaud, E. & Nordmann, P. Intercontinental spread of OXA-48 beta-lactamase-producing Enterobacteriaceae over a 11-year period, 2001 to 2011. Euro Surveill. 18, 20549 (2013).
Pereira, L. A., Harnett, G. B., Hodge, M. M., Cattell, J. A. & Speers, D. J. Real-time PCR assay for detection of blaZ genes in Staphylococcus aureus clinical isolates. J. Clin. Microbiol. 52, 1259–1261 (2014).
Long, S. W. et al. PBP2a mutations causing high-level Ceftaroline resistance in clinical methicillin-resistant Staphylococcus aureus isolates. Antimicrob. Agents Chemother. 58, 6668–6674 (2014).
Shapley, L. S. 17. A value for n-person games. In Contributions to the Theory of Games (AM-28), Vol. II (eds Kuhn, H. W. & Tucker, A. W.) 307–318 (Princeton University Press, 1953) https://doi.org/10.1515/9781400881970-018
Cuénod, A., Foucault, F., Pflüger, V. & Egli, A. Factors associated with MALDI-TOF mass spectral quality of species identification in clinical routine diagnostics. Front. Cell. Infect. Microbiol. 11, 646648 (2021).
Camoez, M. et al. Automated categorization of methicillin-resistant Staphylococcus aureus clinical isolates into different clonal complexes by MALDI-TOF mass spectrometry. Clin. Microbiol. Infect. 22, 161.e1–161.e7 (2016).
Josten, M. et al. Identification of agr-positive methicillin-resistant Staphylococcus aureus harbouring the class A mec complex by MALDI-TOF mass spectrometry. Int. J. Med. Microbiol. 304, 1018–1023 (2014).
Josten, M. et al. Analysis of the matrix-assisted laser desorption ionization–time of flight mass spectrum of Staphylococcus aureus identifies mutations that allow differentiation of the main clonal lineages. J. Clin. Microbiol. 51, 1809–1817 (2013).
Østergaard, C., Hansen, S. G. K. & Møller, J. K. Rapid first-line discrimination of methicillin resistant Staphylococcus aureus strains using MALDI-TOF MS. Int. J. Med. Microbiol. 305, 838–847 (2015).
Rhoads, D. D., Wang, H., Karichu, J. & Richter, S. S. The presence of a single MALDI-TOF mass spectral peak predicts methicillin resistance in staphylococci. Diagn. Microbiol. Infect. Dis. 86, 257–261 (2016).
Sauget, M., van der Mee-Marquet, N., Bertrand, X. & Hocquet, D. Matrix-assisted laser desorption ionization–time of flight mass spectrometry can detect Staphylococcus aureus clonal complex 398. J. Microbiol. Methods 127, 20–23 (2016).
Sogawa, K. et al. Use of the MALDI BioTyper system with MALDI–TOF mass spectrometry for rapid identification of microorganisms. Anal. Bioanal. Chem. 400, 1905–1911 (2011).
Wolters, M. et al. MALDI-TOF MS fingerprinting allows for discrimination of major methicillin-resistant Staphylococcus aureus lineages. Int. J. Med. Microbiol. 301, 64–68 (2011).
Zhang, T. et al. Analysis of methicillin-resistant Staphylococcus aureus major clonal lineages by matrix-assisted laser desorption ionization–time of flight mass spectrometry (MALDI–TOF MS). J. Microbiol. Methods 117, 122–127 (2015).
Chatterjee, S. S. et al. Distribution and regulation of the mobile genetic element-encoded phenol-soluble modulin PSM-mec in methicillin-resistant Staphylococcus aureus. PLoS ONE 6, e28781 (2011).
Hu, Y., Huang, Y., Lizou, Y., Li, J. & Zhang, R. Evaluation of Staphylococcus aureus subtyping module for methicillin-resistant Staphylococcus aureus detection based on matrix-assisted laser desorption ionization time-of-flight mass spectrometry. Front. Microbiol. 10, 2504 (2019).
Ludden, C. et al. Genomic surveillance of Escherichia coli ST131 identifies local expansion and serial replacement of subclones. Microb. Genom. 6, e000352 (2020).
Nakamura, A. et al. Identification of specific protein amino acid substitutions of extended-spectrum β-lactamase (ESBL)-producing Escherichia coli ST131: a proteomics approach using mass spectrometry. Sci. Rep. 9, 8555 (2019).
Lafolie, J., Sauget, M., Cabrolier, N., Hocquet, D. & Bertrand, X. Detection of Escherichia coli sequence type 131 by matrix-assisted laser desorption ionization time-of-flight mass spectrometry: implications for infection control policies? J. Hosp. Infect. 90, 208–212 (2015).
Oberle, M. et al. The technical and biological reproducibility of matrix-assisted laser desorption ionization–time of flight mass spectrometry (MALDI-TOF MS) based typing: employment of bioinformatics in a multicenter study. PLoS ONE 11, e0164260 (2016).
UniProt. Beta-lactam-inducible penicillin-binding protein. https://www.uniprot.org/uniprot/P07944
UniProt. Beta-lactamase OXA-1. https://www.uniprot.org/uniprot/P13661
UniProt. Beta-lactamase TEM. https://www.uniprot.org/uniprot/P62593
UniProt. Beta-lactamase SHV-24. https://www.uniprot.org/uniprot/Q9S169
UniProt. Beta-lactamase CTX-M-1. https://www.uniprot.org/uniprot/P28585
UniProt. ompC: outer membrane porin C. https://www.uniprot.org/uniprot/P06996
Pickens, C. et al. A multiplex polymerase chain reaction assay for antibiotic stewardship in suspected pneumonia. Diagn. Microbiol. Infect. Dis. 98, 115179 (2020).
European Committee on Antimicrobial Susceptibility Testing (EUCAST), European Society of Clinical Microbiology and Diseases. Clinical Breakpoints and Dosing of Antibiotics http://www.eucast.org/clinical_breakpoints/ (2021).
Schmidt, A. et al. The quantitative and condition-dependent Escherichia coli proteome. Nat. Biotechnol. 34, 104–110 (2016).
Gibb, S. & Strimmer, K. MALDIquant: a versatile R package for the analysis of mass spectrometry data. Bioinformatics 28, 2270–2271 (2012).
Ke, G. et al. LightGBM: a highly efficient gradient boosting decision tree. In Advances in Neural Information Processing Systems 30 (eds Guyon, I. et al.) 3146–3154 (Curran Associates, Inc., 2017).
Pedregosa, F. et al. Scikit-learn: machine learning in Python. J. Mach. Learn. Res. 12, 2825–2830 (2011).
The authors thank O. Grüninger, J. Reist, Y. Mahiddine, D. Lang, C. Straub and M. Schneider for excellent technical assistance in accessing the mass spectra and antimicrobial resistance data at the University Hospital Basel; and B. Rodríguez-Sánchez (Hospital General Universitario Gregorio Marañón, Madrid, Spain), H. Seth-Smith (University Hospital Basel), C. Kaufmann (University Hospital Basel), and V. Pflüger (MabritecAG, Riehen, Switzerland) for valuable advice, technical consultation and feedback throughout the project. The authors also thank X. He (ETH Zurich) for fruitful discussions, and D. Chen (ETH Zurich) and Jacques Schrenzel (Geneva University Hospitals) for assistance with the manuscript and for providing valuable feedback. This study was supported by the Alfried Krupp Prize for Young University Teachers of the Alfried Krupp von Bohlen und Halbach-Stiftung (K.B.), by the two Cantons of Basel through a D-BSSE-Uni-Basel Personalised Medicine grant from the ETH Zurich (PMB-03-17, K.B. and A.E.) and a Doc.Mobility fellowship (A.C.) by the Swiss National Science Foundation (P1BSP3-184342). This study received ethics approval through the local ethics review board (EKNZ number: IEC 2019-00729, 2019-01860 and 2019-00748).
The authors declare no competing interests.
Peer review information
Nature Medicine thanks Roman Yelensky and the other, anonymous, reviewer(s) for their contribution to the peer review of this work. Alison Farrell was the primary editor on this article and managed its editorial process and peer review in collaboration with the rest of the editorial team.
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Extended Data Fig. 1 Comparison turnaround times between MALDI-TOF MS and resistance.
Time from the entry of a patient sample at the diagnostic laboratory at the DRIAMS-A collection site to species identification by MALDI-TOF MS and phenotypic resistance testing for three clinically relevant species: E. coli (n = 54), K. pneumoniae (n = 66), and S. aureus (n = 57). Boxplot shows median and interquartile time ranges in hours, whiskers indicate adjacent values.
Extended Data Fig. 2 Improved antimicrobial resistance prediction based on MALDI-TOF mass spectra combining all species compared to species information alone.
AUROC values of logistic regression classifiers trained on data combining all samples with labels available for each antimicrobial prediction task in DRIAMS-A. The blue bars depict predictive performance using spectral data as features. The red bars show the predictive performance when using species label information only. The fractions of resistant/intermediate samples in the training data are indicated in brackets after the antibiotic name. Reported metrics and error bars are the mean and standard deviation of 10 repetitions with different random train–test-splits. The asterisks indicate a statistically significant difference between the reported metrics between all species and species information alone of a two-sided Welch’s t-test (not assuming equal population variance) and a significance level of <0.05.
Extended Data Fig. 3 Flowchart inclusion of cases into the retrospective clinical study.
We reviewed 416 clinical cases which had a severe bacterial infection with K. pneumoniae, E. coli or S. aureus between April and August 2018. Cases were excluded if (i) cases were treated external to the DRIAMS-A collection site, (ii) no consultation note by a infectious diseases specialist was available within 5 days (for cases with a positive blood culture) or 1 day (for cases with a positive deep tissue sample), (iii) the general research consent was rejected, (iv) the species identified by the Bruker database did not match the species in the laboratory report, (v) the antibiotic resistance profile was already present at the at the time of the infectious diseases consultation and (vi) if the consultation note was written without the knowledge of the species identity. 63 clinical cases were included.
Extended Data Fig. 4 Barplot of feature importances of LightGBM and MLP model.
Importance values larger than two times absolute standard deviation are colored in either blue (LightGBM) or orange (MLP). The sign of each feature importance value of the MLP model indicates the association with the positive (positive sign) or negative class. The LightGBM values indicate the contribution to the prediction without direction of association. All three models indicate that a large number of features are relevant for an accurate antimicrobial resistance prediction. The scenario abbreviations follow Fig. 2a.
Extended Data Fig. 5 Temporal validation including sample size of training window.
Supplementary Tables 1 and 3–6
Rights and permissions
About this article
Cite this article
Weis, C., Cuénod, A., Rieck, B. et al. Direct antimicrobial resistance prediction from clinical MALDI-TOF mass spectra using machine learning. Nat Med 28, 164–174 (2022). https://doi.org/10.1038/s41591-021-01619-9
This article is cited by
Expanding the search for small-molecule antibacterials by multidimensional profiling
Nature Chemical Biology (2022)