Skip to main content
Communications Chemistry logoLink to Communications Chemistry
. 2025 Dec 18;8:398. doi: 10.1038/s42004-025-01791-w

mzLearn as a data-driven LC/MS signal detection algorithm that enables pre-trained generative models for untargeted metabolomics

Leila Pirhaji 1,✉, Jonah Eaton 1, Adarsh K Jeewajee 1, Min Zhang 1, Matthew Morris 1, Maria Karasarides 2
PMCID: PMC12714751  PMID: 41413219

Abstract

Metabolite alterations are linked to diseases, yet large-scale untargeted metabolomics remains constrained by challenges in signal detection and integration of diverse datasets for developing pre-trained generative models. Here, we introduce mzLearn, a data-driven MS¹ signal-detection and alignment method that runs from mzML files without user-set parameters. Across 15 public datasets, mzLearn detects 11,442 signals on average vs 7,100 (XCMS) and 4,655 (ASARI), with higher TP (89.0% vs 77.4% vs 49.6%) and lower FP (12.5% vs 17.3% vs 18.8%), while correcting instrument drifts across large cohorts without experimental QC samples. mzLearn detected 2,736 robust metabolite signals from 22 public studies (20,548 blood samples), enabling the development of pre-trained variational autoencoder for untargeted metabolomics. Learned metabolite representations reflected demographic data and when fine-tuned on unseen renal cell carcinoma data, improved risk stratification and overall survival predictions, while feature-importance analysis (SHAP) highlighted biologically plausible lipid and carnitine signals. By producing a consistent, high-quality MS¹ feature matrix at scale, mzLearn paves the way for developing pre-trained foundation models for untargeted metabolomics.

Subject terms: Metabolomics, Biomarkers, Mass spectrometry, Cheminformatics


Metabolite alterations are crucial for understanding diseases, yet large-scale untargeted metabolomics faces challenges in signal detection and dataset integration. Here, the authors introduce mzLearn, a data-driven MS¹ signal-detection method that that corrects instrumental drift and enhances signal accuracy and consistency, enabling the development of pre-trained models for untargeted metabolomics.

Introduction

Metabolomics, the study of low-molecular-weight metabolites in biological systems, presents a snapshot of the biochemical pathways used by different cells and tissues, with alterations often linked to disease1,2. In recent years, the UK biobank’s metabolomic studies of over 100,000 individuals have linked metabolite profiles with disease outcomes and aging3,4. GLP-1 trials further highlighted the potential of metabolic intervention in reducing cardiovascular, diabetes, and other chronic diseases5,6. While the Human Metabolome Database (HMDB)7 annotates over 220,000 metabolites cataloged in the human body, current identification procedures can reliably recognize only a few hundred metabolites, a fraction of what exists8. Therefore, metabolomic datasets remain largely untapped due to technical challenges of population-level detection and annotation of global or untargeted metabolomic signals9.

Untargeted metabolomic profiling using liquid chromatography coupled with mass spectrometry (LC/MS) can provide high-throughput measurements of thousands of metabolite signals10. Existing signal detection methods lack reproducibility and have high false positive and low true positive rates11,12. The final set of metabolomic features is highly sensitive to initial parameter choices13, with signal overlap between methods as low as 10%14. While methods have been developed to remove noisy signals from detected peaks15, none address the critical issue of low true positive or missing biologically relevant signals. LC/MS signal detection is further limited in large-scale studies due to instrument drifts16, causing molecule-specific intensity drifts17 and non-linear fluctuation in LC retention time (rt)18. These drifts result in misaligned or cross-aligned signals and erroneous downstream inferences19. Experimental methods have been developed to estimate instrument drift, including running quality control samples (QC) at regular intervals during extended runs20,21. There are no standardized protocols, however, and public metabolomics repositories often lack QC data and associated information. Moreover, even with the presence of QC samples, there is no computational method to estimate both rt and intensity drift simultaneously, and existing methods addressing them separately require significant user inputs16,22. As a result, while publicly available untargeted metabolomics datasets are growing rapidly, their utility for combinatory analysis remains limited.

In fields such as single-cell sequencing, standardized data processing methods have already enabled the integration of public datasets to develop pre-trained foundation models23–25. These models have proven invaluable by capturing generalizable patterns that support downstream prediction tasks when finetuned in smaller datasets26. Extending pre-trained models to untargeted metabolomics could similarly enhance metabolomic data utility and uncover clinically meaningful signals. While untargeted metabolomics data contain artifacts and chemical contaminants27, they also harbor a wealth of unannotated metabolites with significant biological relevance28–30. Combinatory analysis of large-scale metabolomics studies measured in different laboratories is essential to identifying robust metabolite features across cohorts despite noise and technical variability11. In addition to technical variabilities, demographic and environmental factors influence metabolomic profiles31. Pre-trained models built on diverse biological cohorts can further learn population-level diversity and aid in identifying disease-relevant signals32.

In this study, we introduce mzLearn, a data-driven LC/MS signal detection algorithm that produces high-quality, robust metabolomic signals at scale while simultaneously estimating and correcting rt and intensity drift. mzLearn requires no user-input parameters and autonomously learns the experimental characteristics of the data through an iterative, data-driven process and estimates and corrects instrument drifts even in the absence of experimental QC samples. Compared to existing methods, mzLearn detects a significantly larger number of LC/MS signals with superior quality. mzLearn’s streamlined process enabled the analysis of 20,548 blood-based untargeted metabolomics datasets from diverse studies, facilitating the development of pre-trained generative models for untargeted metabolomics. These models produced metabolite representations that captured demographic variations and improved downstream prediction tasks when tested on the baseline serum metabolomics data of clear-cell renal cell carcinoma patients (ccRCC). Finally, we show that the learned metabolite representation facilitated joint and adversarial learning to perform complex tasks, including prognostic and predictive stratification. Our models match and potentially surpass current gold standard, clinical grade risk criteria for predicting overall survival and can stratify patients for immunotherapy response based on baseline metabolic profiles. Available at http://mzlearn.com/, mzLearn democratizes using untargeted metabolomics datasets that can pave the way for developing foundation metabolomics models.

Results

method overview

mzLearn is a scalable, non-parametric algorithm for detecting, aligning and normalizing ion-level MS1 signals measured in untargeted LC/MS measurements. It dynamically adapts to diverse datasets by learning parameters directly from the data through an iterative, data-driven process. This enables seamless scaling to thousands of samples while addressing retention time (rt) and intensity drifts caused by extended run orders and batch effects without requiring experimental QC samples (Fig. 1a). We evaluated mzLearn’s performance and scalability by analyzing a total of 36 publicly available datasets with various instrumental settings (Supplementary Tables 1 and 2). Of these, 15 datasets containing targeted metabolomics features served as benchmarks for comparing mzLearn’s signal detection performance against existing methods. mzLearn consistently demonstrated superior signal quality by capturing true positives while minimizing noise. Six of these 36 datasets, each comprising over 150 samples with experimental QC samples available, termed normalization evaluation datasets, were used to validate mzLearn’s ability to estimate and correct instrument drifts without requiring experimental QC inputs. Finally, 22 of the 36 datasets, referred to as pretraining datasets, included serum untargeted metabolomics measured under the same chromatography setting. The pretraining datasets demonstrated mzLearn’s capability to integrate diverse datasets, detect metabolite signals that remain robust across biospecimens despite technical variability, and support the development of pre-trained generative models for untargeted metabolomics (Fig. 1b). The pre-trained learned metabolite representations effectively capture population-level variations driven by demographic factors such as age. The metabolite representations are transferrable and enhance fine-tuning performance, facilitating downstream biological discoveries, including survival analysis and clinical outcome predictions. (Fig. 1c).

Fig. 1. Method overview.

Fig. 1

a Large-scale liquid chromatography–mass spectrometry (LC/MS) measurements lead to retention time (rt) and intensity drifts due to extended run time. The current LC/MS signal detection method fails to estimate these drifts accurately, leading to missed aligning or cross-aligning of signals. They further suffer from low true positives by failing to detect true signals and high false positives by capturing noise. mzLearn overcomes these challenges without requiring user-defined parameters. It produces high-quality signals that are accurately aligned across large datasets, with intensities normalized to account for run-order drift. This ensures the generation of robust, normalized data suitable for downstream analyses. Peaks in blue/green/yellow represent different samples; scatter-plot dots are colored by run order (cool-to-warm gradient). b mzLearn enables the combinations of 22 publicly availed datasets, identifies 2736 peak groups robustly measured across studies and the development of a pre-trained variational autoencoder (VAE) model by minimizing reconstruction and Kullback–Leibler (KL) divergence loss. c The pre-trained models can be utilized through transfer learning to develop fine-tuned VAE models for previously unseen datasets in an unsupervised manner. These fine-tuned VAEs can be further retrained to enhance the prediction of survival or classification tasks.

mzLearn data-driven LC-MS signal detection

mzLearn processes raw LC/MS data, consisting of data points defined by their retention time (rt), mass/charge (m/z), and intensity values33, stored in the open-source mzML format34. An individual peak is a subset of these points with specific m/z, rt, and intensity values. In contrast, a peak group (or feature) is a collection of individual peaks corresponding to the same underlying ion across multiple samples35. mzLearn’s output is a two-dimensional table of feature values defined by median rt and m/z values with normalized intensity across samples (Fig. 2a). mzLearn recursively partition the data into patches, which overcomes the memory constraints of signal extraction across large data sets (Fig. 2b). The patches are then dynamically resized by minimizing the gaps between adjacent points in rt and m/z space, which allows mzLearn to adapt to the shape of the underlying signal, reducing the need for pre-selected input parameters or prior assumptions about the peak shapes (Fig. 2c).

Fig. 2. mzLearn algorithm.

Fig. 2

a .mzML files are recursively partitioned into data patches, which are dynamically resized and filtered to remove noise using autocorrelation. These patches are then cross-correlated across different files to ensure alignment. Stage 1 pins, a subset of data patches with the highest auto- and cross-correlation scores, are identified to guide parameter learning. Candidate peaks are extracted from these correlated patches through a self-improving iterative process. With each iteration, the number of pins increases, improving parameter estimation and ultimately resulting in a high-quality final peak list. b Each .mzML file is recursively subdivided into coarse data patches, which are dynamically resized, split, and combined to form bounding boxes around the underlying signals. These patches are then filtered using autocorrelation to remove noise. c Patches are dynamically resized by analyzing the distances between individual data points. Large gaps are used to split patches, creating smaller, distinct regions, while data points with sufficiently small separations are combined into larger patches. d Auto-correlation of a patch including true signal (left) and a patch including noise (right) with time-shifted versions of themselves; arrows represent an increase (up) or decrease (down) of intensity as time-shift increases (left to right). e mzLearn corrects for retention time (rt) drift by using high-quality signals or pins to estimate the drift between pairs of samples at any coordinate in rt and mass-to-charge ratio (m/z) space (green-red map). These estimates guide the cross-correlation between the reference patch from sample i (blue) to the candidate patch in sample j (orange). Optimal alignment is determined by the convolution of the local cross-correlation information with the global pin-based drift map information. The drift heat map uses green to red shading (negative to positive drift), with the reference patch in blue and the candidate patch in orange. f mzLearn outperforms ASARI and XCMS in average true positive (TP) and false positive (FP) peak detection across fifteen public datasets acquired using diverse LC and MS instruments. The bar plot illustrates the average TP (red) and FP (blue) rates for each algorithm, with standard deviations as black error bars.

mzLearn distinguishes true signals from noise by 1) auto-correlating the signal with a time-shifted version of itself and 2) cross-correlating the signal with different files, combined with an iterative parameter-learning approach. In the auto-correlation step, mzLearn identifies patterns indicative of true peaks by calculating the similarity of each signal patch to its time-shifted counterpart. Signal patches with high autocorrelation are retained, while those with low autocorrelation are filtered out (Fig. 2d). The cross-correlation procedure aligns the signal across different files by sliding a reference patch over a larger candidate region until the optimal overlap between the two regions can be found (Fig. 2e). Correlated patches may contain several candidate peaks. These candidate peaks are extracted from correlated patches through a multi-step scissoring process by first splitting them based on the gaps in rt-m/z space and then at the valleys between intensity local maxima (Supplementary Fig. 1, Online Methods). mzLearn learns the parameters of the above steps through an iterative process. In each iteration, mzLearn defines a subset of the highest-quality correlated patches, termed “pins,” which are used to estimate the auto- and cross-correlation thresholds (Fig. 2a). Initially, more conservative thresholds are used due to limited information. As the quality of detected peaks improves with each iteration, the number of pins increases, enabling more accurate estimation of thresholds and drift corrections.

mzLearn overcomes rt drifts in large-scale metabolomics studies by calculating an rt-drift map. The drift in retention time between two files is quantified by calculating the weighted average and standard deviation in the rt-drift among neighboring pins (Fig. 2e). The rt-drift map defines the bounding box of cross correlation between file pairs, where the data patches with the highest cross-correlation within the defined bounds are aligned (Fig. 2e). By updating thresholds and drift maps in each iteration, mzLearn searches for potential missing signals that may have been overlooked in previous steps (Supplementary Fig. 2, Online Methods). mzLearn converges after three iterations, producing a final high-quality list of features with minimal missing values and features aligned across thousands of samples.

We evaluated the performance of mzLearn in detecting true positive and false positive signals against XCMS11,36, the most widely used method among parameter-intensive approaches such as mzMine37 and MSDial38, and Asari39, a newer approach that minimizes reliance on key parameters. Using the benchmarking datasets, we evaluated these methods in terms of the number of identified peaks, at least in the 20% of input samples, their true positive (TP) rate, defined as the number of targeted metabolites present in the samples found by each method, and their false positive (FP) rates, where we manually labeled 100 randomly selected peaks as “good” or “bad” signals based on peak shape, signal to noise ratio, and peak alignment (Supplementary Fig. 3). We demonstrated that mzLearn outperformed other methods in both signal quantity and quality. On average, mzLearn identified the most LC/MS signals (N = 11,442) compared to XCMS (N = 7100) and ASARI (N = 4655), absolute feature counts per dataset and associated database details are listed in Supplementary Table 3. Importantly, mzLearn achieved the highest signal quality, with an average true positive (TP) rate of 89.0% and a false positive (FP) rate of 12.5%, outperforming XCMS (77.4% TP, 17.3% FP) and ASARI (49.6% TP, 18.8% FP) (Fig. 2f, Supplementary Table 3). Per-study feature–intensity matrices with feature-level metadata (detection frequency, median m/z, median RT) are provided as Supplementary Data 1.

mzLearn corrects signal intensity drift in large-scale studies

mzLearn generates synthetic QC samples and calculates feature-specific intensity drift maps to mitigate intensity drift often caused by extended run orders and batch effects. Synthetic QCs are generated through an iterative process, where samples are clustered based on both their low-dimensional intensity representations and run order, allowing only consecutive samples to form clusters. In each iteration, the synthetic QC is defined as the average intensity of each cluster (Fig. 3a), and an intensity drift map is created by interpolating the drift of neighboring pins in rt and m/z dimensions to estimate missing values (Fig. 3b). Given the diverse chemical properties of metabolites, each feature exhibits a unique drift pattern; therefore, the peak intensities are normalized against the same peak identified in the nearest synthetic QC in the run sequence. The iterative process stops when additional clusters can no longer be consistently formed within consecutive sample orders (Fig. 3a).

Fig. 3. mzLearn ameliorates intensity drift.

Fig. 3

a Synthetic quality control (QC) normalization overcomes signal drift. The synthetic QC samples are identified as iterative processes and normalization in each iteration. The operation is stopped where no run order-based effect on sample clustering is observable. b For missing signals in QC or synthetic QC samples, the feature-specific intensity drift is estimated by interpolating the intensity drifts of neighboring pins. Drift maps use red (positive) and blue (negative) shading; 0 denotes no drift. c, Relative standard deviation (RSD) of hidden pools across methods (Raw, total ion current or TIC, QC-based, Synthetic QC); bars show mean with grey error bars. d 4013 peaks identified in ≥60% of samples in the combined dataset of ST001236 and ST001237 were used in the following principal component analysis (PCA) plots. Each dot represents a sample, colored according to sample run order. Stars denote experimental QC samples present in the original data. PCA of the raw data without any normalization shows pronounced batch and run order effects. TIC normalization does not meaningfully address the batch effects in the data. Both the QC- and synthetic QC-based normalization applied by mzLearn largely eliminate batch and run-order effects, where QC and synthetic QC samples are now clustered closely together, and individual samples are intermixed based on their run order. run order shown by a blue to green to yellow, and to red gradient; black stars are QC samples, while filled circles represent primary samples.

We assessed the synthetic QC normalization method in overcoming signal intensity drifts using the normalization evaluation datasets, where we withheld a subset of experimental QC samples and calculated the relative standard deviation (RSD) of peak intensities in the hidden QC sample. Synthetic QC normalization performance (17% RSD) is comparable to the performance where the peak intensities are normalized using experimental QC samples (16% RSD). It further greatly outperforms total ion concentration (TIC) normalization (23% RSD), a standard data-driven normalization method with the absence of QC samples40, as well as raw unnormalized data (25% RSD) (Fig. 3c, Supplementary Table 4). Specifically, we showed that mzLearn can identify peaks from a large cohort of ccRCC patients in Phase I (n = 91) and Phase III (n = 741) clinical trials (Metabolomic Workbench ids: ST001236 and ST001237)41,42, where the serum metabolomics data were measured in 3 distinct batches over 3 months. mzLearn successfully processes samples from two trials, combined 1,650 serum samples, detecting 4,016 untargeted features in ≥60% of samples, estimates, and corrects rt (Supplementary Fig. 4) and intensity drifts (Fig. 3d).

mzLearn enables the combination of public untargeted metabolomics datasets to develop pre-trained generative models

mzLearn enables the development of pre-trained generative models for untargeted metabolomics by integrating data from the pretraining dataset of 22 public LC/MS serum untargeted metabolomics conducted with hydrophilic interaction liquid chromatography or HILIC in positive ion mode in several laboratories (Supplementary Table 5). Initially, LC/MS signals from each study were extracted by mzLearn and normalized individually to address intensity drift and intra-study batch effects. To further reduce batch effects across studies, the datasets were normalized using standard scaling. (Fig. 4a). Next, we aligned peaks across studies using m/z values, scaled rt projections, and standard-scaled intensities (Fig. 1b). While m/z values are comparable between studies, rt values could be dramatically different because of the various experimental settings. The scaled rt projection between studies was learned using the combination of subalignment and graph aggregation, Eclipse43, and non-linear spline fitting between rt values, metabCombiner10 methods (Supplementary Fig 5 and online method). We calculated a robustness score to assess measurement consistency, filtering out low-scoring peaks, and identified 2,736 robust peak groups across 22 datasets (Supplementary Fig. 6). Only 155 targeted metabolites (5.6% of untargeted features) were consistently detected, spanning diverse classes like amino acids, lipids, nucleotides, energy metabolites.

Fig. 4. Latent space visualization of pre-trained VAE models.

Fig. 4

Uniform Manifold Approximation and Projection (UMAP) visualization of the raw input data (n = 20,548 samples), color-coded by age and disease groups, where the samples appear mixed across these categories. Visualization of the latent space from the pre-trained VAE models, where samples naturally separate by age and disease groups, indicating that the model has captured meaningful biological distinctions. Top row shows raw inputs, while the bottom row displays VAE latent space. The left column are color coded by age groups (orange is pediatric, blue - adult); whereas right column = disease groups (green = adult-cancer, orange = adult-other, red = pediatric-cardio-metabolic disease (CMD), blue = pediatric-other).

We then learned metabolite representation by developing an unsupervised, pre-trained Variational Autoencoder (VAE) model that optimizes reconstruction and KL divergence losses44.VAE is a generative modeling approach45,46 that learns compact, latent representations of identified peak groups or metabolite signals across trained on the mzLearn MS¹ feature matrix obtained from 20,548 blood-based samples using mini-batch stochastic gradient descent (Fig. 1b). Although exact metadata for each public study were unavailable, we manually labeled the studies based on disease categories and age groups of the samples (Supplementary Fig 7). The UMAP plot of raw data shows the mixing of samples based on age and disease labels (Fig. 4). Interestingly, even without supervision, the VAE model learned representations clustered samples with similar disease and age characteristics in the latent space (Fig. 4). While the standard-scaled intensities of the input data exhibited mixing of samples based on study labels, in the latent space, samples became further separated according to their disease and age labels (Supplemental Fig. 8). We further attempted to mitigate batch effects during pre-training using adversarial learning. However, due to the diverse disease profiles across studies, this approach reduced fine-tuning performance by compromising the representation of biologically meaningful features (data not shown). Depending on the specific goals of fine-tuning, the pre-trained models can be further reparametrized using a subset of samples with available metadata to create models tailored to specific clinical variables, such as gender (Supplemental Fig. 9, online method). This adaptability supports the model’s use across diverse clinical applications.

Transferable metabolite representations enable fine-tuned VAE models to outperform traditional and randomly initialized models

We assessed the transferability of pre-trained metabolite representations on downstream performance by fine-tuning a VAE model using unseen baseline blood metabolomics data of ccRCC patients in the CheckMate025 Phase III clinical trial42, where patients were treated with an ICI (n = 392) and an mTOR inhibitor (n = 349). We split the samples to train (n = 543), validate (n = 149), and test (n = 149) sets, ensuring that treatment groups, as well as clinical variables such as risk groups, age, gender, portioner therapy, etc., were balanced within each set (Supplementary Table 6). The fine-tuned VAE was developed unsupervised using transfer learning, while a randomly initialized VAE was created for comparison. We used Optuna, which employs a Bayesian optimization framework47, to fine-tune hyperparameters. Notably, the fine-tuned VAE model using transfer learning reached optimal parameters within fewer trials (n = 38) compared to the randomly initialized model (n = 43) (Supplementary Fig. 10) and achieved lower validation loss with fewer training epochs (Supplementary Fig. 11).

We developed these models in an unsupervised manner, enabling rapid adaptation to new clinical questions without the need for retraining the entire model. To make specific predictions, we retrain only the final layer of the encoder and the prediction head following the latent space (Fig. 1C). We evaluated model performance on three distinct task types: binary classification, multi-class classification, and survival analysis. For classification tasks, we predicted IMDC (International Metastatic RCC Database Consortium) risk groups48, where the binary classification involved distinguishing “poor” versus “favorable” risk groups, while the multi-class classification provided a more granular prognostic categorization of “poor” vs. “intermediate” vs. “favorable.” For survival analysis, we predicted overall survival (OS) across both treatment arms, assessing model performance using the concordance index (C-index). Fine-tuned models with transfer learning consistently outperformed randomly initialized and traditional machine learning models (Table 1).

Table 1.

Fine-tuned VAE models with transfer learning outperform both traditional models and VAE models with random initialization

Performance on unseen test set Number of test samples Task
type
Metrics Fine-tune VAE model with transfer learning VAE model with random initialization Traditional ML models
Poor vs favorable IMDC groups 57 Binary classifier AUC 93.48 82.86 91.78
Poor, favorable, and intermediate IMDC risk groups 143 Multi-class classifier F1 Score 59.55 54.78 58.29
Overall survival 149 Survival tasks C-index 67.39 64.45 64.61

The variational autoencoder (VAE) models were evaluated across binary classification, multi-class classification, and survival analysis tasks. Performance metrics included AUC for binary classification, F1 score for multi-class classification, and C-index for survival analysis. Traditional machine learning (ML) models, such as logistic regression for classification and L1-penalized Cox regression for survival analysis, served as baselines for comparison. Fine-tuned VAE models with transfer learning consistently outperformed both traditional ML models and randomly initialized VAEs.

IMDC International Metastatic Renal-Cell Carcinoma Database Consortium, AUC area under the ROC curve, C-index concordance index.

Prognostic and predictive patient stratification via joint and adversarial learning

We further evaluated whether learned metabolite representation could facilitate the development of advanced architectures for prognostic and predictive patient stratification. To develop a prognostic model capable of identifying features associated with a patient’s overall survival (OS) independent of treatment, we re-trained the final layer of the fine-tuned VAE and added a task-specific layer. We implemented two models: one trained exclusively on baseline data from patients treated with immune checkpoint inhibitors (ICIs) and the other on patients treated with mTOR inhibitors. These models were trained jointly, while the training objective combined each model’s loss, optimizing the total loss to strengthen learning across both tasks (Fig. 5a). This joint training setup enables the models to learn OS-associated patterns in a treatment-independent manner, resulting in a prognostic model. We further evaluated the performance our prognostic models against the IMDC groups, established clinical grade parameters that define RCC patient sub-groups into variable prognostic risk groups48. Based on the predicted OS from our models, we stratified samples into poor, intermediate, and favorable risk groups, matching the number of patients in each category to the IMDC-reported distributions for a fair comparison. When tested on unseen data (n = 143), the prognostic VAE models significantly outperformed the clinically defined IMDC risk groups in predicting patient OS. While only the IMDC poor versus favorable groups showed a statistically significant difference in OS, all risk groups predicted by the prognostic VAE demonstrated significantly distinct OS distributions and improved hazard ratios (Fig. 5b).

Fig. 5. Joint and adversarial learning to develop prognostic and predictive models.

Fig. 5

a Joint learning approach to retrain the last layer of two fine-tuned variational autoencoder (VAE) models, developed through transfer learning, with the addition of a task-specific layer to predict overall survival (OS) for Drug A (immune-checkpoint inhibitor or ICI) and Drug B (mTOR inhibitor). Both models jointly learn features associated with overall survival (OS) that are independent of treatment, forming a prognostic model. Patients are subsequently stratified into three risk groups (favorable, intermediate, and poor) based on the predicted OS. In contrast, a predictive model specific to Drug A is developed through adversarial learning. Here, one VAE model learns to predict OS for Drug A while competing with another VAE model that predicts OS for Drug B, isolating features unique to Drug A’s response and reducing confounding effects. Patients with above-average predicted OS are considered responders, while those below average are classified as non-responders. b Performance evaluation of the prognostic model on an unseen test set, N = 143. The prognostic VAE model outperformed clinical-grade IMDC (International Metastatic Renal-Cell Carcinoma Database Consortium) risk groups (a standard prognostic system for ccRCC), effectively refining risk stratification based on OS predictions. groups show distinct OS distributions. Colored survival curves correspond to favorable, intermediate, and poor; shaded bands indicate 95% confidence intervals; vertical dashed lines mark median OS. c, Evaluation of the ICI-specific predictive model on an unseen test set, N = 79, blue curve shows responders survival, while orange curve show survival of non-responders; shaded areas are 95% CIs; log-rank p-value = 2.1 × 10⁻³.demonstrating exclusive stratification of responders to ICI with a log-rank p-value of 2.1e−3 d, The adversarial model cannot accurately predict OS in the mTOR arm, on an unseen test set, N = 70 (log-rank p-value = 0.61). e Top-20 SHAP (SHapley Additive exPlanations) ion features of Prognostic VAE (treatment-agnostic OS risk across all patients). f Top-20 SHAP ion features of ICI-specific predictive model. Beeswarm plots show SHAP values computed on held-out baseline samples, using the training set as the background. Features are ordered by mean absolute SHAP values within each model. Each dot is one patient; color encodes the measured feature value (red = higher, blue = lower), and position on the x-axis indicates the feature’s impact on the model output. Positive SHAP increases the model score (e: higher prognostic risk; f: higher probability of nivolumab response); negative SHAP decreases it. Labeled metabolites are annotated features, while the rest are untargeted LC/MS features.

We also developed an adversarial VAE model to exclusively predict overall survival (OS) for ICI therapy. As for the prognostic model, we re-trained two VAE models: one to predict OS for ICI response and the other as an adversarial model for OS in mTOR-treated patients (Fig. 5a). While the main VAE aims to capture features specific to ICI response, the adversarial model prevents it from learning features associated with OS independent of the treatment. Therefore, the predictive VAE model captures drug-specific effects, reducing confounding variables and isolating biomarkers that are uniquely predictive of ICI response. We evaluated the model’s performance on unseen test data (n = 143). Using the predicted OS from the predictive VAE, we labeled patients as responders if their OS was above the cohort average and non-responders if below average. The predictive VAE was trained with an adversarial objective to learn ICI-specific survival signal while suppressing any representation that also predicts outcomes in the everolimus (mTOR) arm. Accordingly, Accordingly, Kaplan–Meier (KM) survival analysis showed significant stratification in the for ICI-treated patients (log-rank p-value = 2.1e−3, Fig. 5c) but no stratification in the for mTOR inhibition (log-rank p-value = 0.61, Fig. 5d)

To identify the most influential metabolic features for each VAE model prediction, we computed SHAP values49 on held-out baseline samples using a training-set background and ranked features by mean SHAP values to capture global importance and used the cohort-average signed SHAP to assign direction relative to the model’s output (protective vs harmful). We then formed Top-20 lists per model, prognostic VAE across all patients (Fig. 5e), and ICI-predictive VAE within the Nivolumab arm (Fig. 5f). While the majority of Top-20 features are unannotated ion features, several map to targeted analytes measured in the original CheckMate025 metabolomics dataset42. Only three of the top-20 (15%) overlap across lists, including FT8656 and FT8665, an +1.003 Da isotopic pair at identical RT (i.e., the same underlying molecule) and FT4553 (C6 carnitine). The remaining Top-20 features are model-specific. The prognostic list contains three phosphatidylethanolamine (PE) plasmalogens (C38:6, C38:7, C36:3) and one polyunsaturated Lyso-PE (LPE, C18:2), whereas the ICI predictive model list contains four acyl-carnitines (C6, C8, C12:1, C18:1) and Lyso-phosphatidylcholine (LPC, C16:1). Together, these patterns indicate complementary baseline metabolic programs with only a small, shared core signal.

Discussion

mzLearn is a deterministic, non-parametric algorithm that iteratively learns internal thresholds and drift maps from the data and addresses key challenges in LC/MS signal processing by offering a streamlined, user-friendly method that requires no input parameters or metabolomics expertise. mzLearn was tested on 36 public datasets with diverse experimental settings (i.e., reversed-phase, HILIC, Orbitrap, QTOF, in positive and negative modes) and consistently outperformed current algorithms in the highest number of detected MS1 LC-MS peaks, achieving the highest true positive rate and maintaining the lowest number of false positives, while effectively mitigating instrument drifts. Existing LC/MS signal detection methods often rely on assumptions about peak shape and require numerous input parameters50, making them highly sensitive39 with non-reproducible outcomes across different algorithms51. While combining peak lists from multiple methods has been shown to increase the true positive rate52, this approach can be cumbersome and still fails to address fundamental issues of low true positives and reproducibility. In contrast, mzLearn dynamically adapts to varying peak shapes, enabling the detection of over 60% more signals (on average) compared to existing methods. Unlike other algorithms, where a higher number of detected signals has been shown to produce higher false positives53, mzLearn produces high-quality signals as it iteratively refines signal characteristics and filters out the noise to identify the missing true peaks.

Instrument drifts in large-scale metabolomics studies, caused by extended run orders and batch effects, significantly hinder untargeted signal detection16. Large-scale LC/MS experiments spanning months often lead to substantial retention time (rt) and intensity drifts, obscuring biologically relevant features. mzLearn tackles these challenges by generating synthetic QC samples and constructing intensity and rt drift maps through a dynamic, iterative, data-driven learning process that continuously estimates and corrects instrument drifts. By eliminating the need for experimental QC inputs, mzLearn streamlines workflows and enables the robust and scalable analysis of large-scale public datasets.

We deployed mzLearn on 22 studies with HILIC positive mode, encompassing 20,548 blood samples, using the resulting MS1ion-feature matrices to pre-trained a VAE model. Pre-trained generative models using diverse metabolomics data from various cohorts are essential for learning metabolite representation associated with demographic variables across defined patient populations. When many batches are combined, stronger correction reduces site effects but can dampen the true signal, whereas lighter correction preserves biology yet leaves some batch structure. Future large-scale deployments may need to incorporate batch covariates or domain-invariant regularization if needed.

Importantly, pre-trained learned metabolite representations are transferable and improve clinical and survival prediction tasks when finetuned on baseline serum metabolomics data of ccRCC patients. In our analysis focusing on the prognostic stratification of ccRCC patients, we show that the fine-tuned model can match and potentially outperform the predictive value of the gold standard IMDC criteria to predict patients’ survival. This is biologically plausible in ccRCC, as previous studies have reported genes involved in metabolic regulation associated with overall survival in ccRCC patients54, and the loss of the frequently mutated VHL activates hypoxia-inducible factor (HIF) signaling55 that rewires lipid metabolism, suppresses fatty acid oxidation (FAO), increasing lipid uptake/storage, and remodeling membranes56. Consistent with this, the prognostic model’s Top-20 ion features are enriched for PE plasmalogens (C38:6, C38:7, C36:3) and a polyunsaturated LPE (C18:2), a membrane redox axis in which plasmalogens buffer lipid peroxidation (vinyl-ether antioxidant), influence ferroptosis sensitivity57, and often mark a less aggressive state, while polyunsaturated lyso-phospholipids reflect active membrane remodeling58.

Metabolic adaptation has been associated with immunotherapy reports42,59, but large-scale untargeted metabolomic data have yet to be extensively utilized for cancer subtyping or patient stratification. In the fine-tuned adversarial model of ICI response, we can successfully classify ICI responders based on their baseline metabolic profiles, showing potential for further clinical application in treatment decision-making with additional validation. The Top-20 feature list is enriched for acyl-carnitines (C6, C8, C12:1, C18:1) and LPC (C16:1), indicating mitochondrial and FAO readiness plus an immunomodulatory lysolipid axis60. Acyl-carnitines report carnitine-shuttle flux and FAO capacity that support T-cell fitness61 and anti-tumor immunity under PD-1 blockade62, while LPCs can modulate immune tone63 and support CD8⁺ T-cell memory via major facilitator superfamily domain-containing 2 A (MFSD2A)-mediated uptake64. The two Top-20 lists show limited overlap (3/20), but include C6 carnitine, suggesting a shared favorable metabolic tone that links lower baseline risk with greater ICI readiness. All results are at the MS¹ ion level; they provide prioritized, biologically coherent candidates for downstream de-isotoping, annotation, and MS/MS confirmation.

While mzLearn offers substantial advantages, it’s important to discuss its limitations and potential future developments. mzLearn results are at the ion MS¹ level, and it does not perform de-isotoping or MS/MS identification. Mapping ion features to MS/MS spectra and performing compound identification should be carried out with downstream workflows; integrating MS/MS into pretraining is an important direction for future work. Furthermore, while mzLearn’s memory efficiency allows it to scale to large sample sizes, tested processing 2,075 files in a single run, the iterative learning approach increases computational time, with analysis taking up to 2.5 days in a single machine. This highlights the rising computational demands and parallel processing on multiple compute nodes as datasets expand. Additionally, the current pre-trained model was developed specifically for HILIC positive mode. Because LC–MS experiments constitute distinct data modalities (matrix, LC chemistry, polarity, etc.), indiscriminate mixing can dilute signal. While the method could be extended to other metabolomics measurements, integrating various LC types and modes requires the development of multi-modal learning. Future work includes processing larger datasets, leveraging transformer architectures, and testing models on multiple fine-tuning datasets to ensure generalizability.

Foundation models are advancing rapidly, with demonstrated success across diverse fields65–67, including single-cell sequencing. Like the genomics field, public metabolomics repositories are expanding rapidly; for instance, the MetaboLights database68 now includes 11,000 studies with over 1.7 million samples. Despite this growth, fully leveraging these data is challenging due to the absence of standardized QC samples to estimate instrument drift, the non-reproducibility of current peak-picking algorithms, and the need for manual parameter tuning across multiple methods to select peaks and correct drifts. mzLearn addresses these major technical problems that have not been previously solved in metabolomics. By enabling reliable and reproducible analysis of large-scale untargeted datasets, mzLearn facilitates the creation of generative models that support population-level research into clinically meaningful metabolites, which can be used for biomarker-driven drug discovery. Throughout this work, targeted metabolites constituted only 5% of the metabolomics features extracted by mzLearn. Increased depth of features detected by mzLearn, combined with available pathway enrichment analyses69 and network-based inference70 tools for untargeted metabolic data, could enable the discovery of metabolomic features associated with disease and treatment response, along with their underlying mechanisms. These advancements will further lead to foundation model development for untargeted metabolomics, positioning mzLearn at the forefront of tools for harnessing large-scale untargeted metabolomic datasets and enhancing its clinical.

Methods

The mzLearn algorithm

The mzLearn algorithm operates on centroided LC/MS data in the open source .mzML format across Ntot samples in a cohort. Each sample file has a collection of data points, {x}, described by their retention time (rt), mass/charge (m/z), and intensity values (u): x=(rt,m/z,u). An individual peak is a subset of these points from a single sample file that have almost-identical m/z values corresponding to the same ion and whose intensities form a bell-like shape along the rt axis. If this ion is present in multiple samples, then its peaks across samples will typically have a similar shape71, nearly equal m/z values with small differences due to machine precision, and a non-linear drift along the rt axis. mzLearn captures an individual peak p from sample k when the data points that characterize the peak in the sample, {x(k)}p, are contained in the bounding box Xpk. A peak group (or feature) {Xpk}k∈Np is a collection of individual peaks that correspond to the same underlying ion across Np sample files. The output of mzLearn is a two-dimensional table of features, with each row pertaining to one feature that was found across Np samples and each column corresponding to the intensity of the feature in those samples.

The mzLearn algorithm consists of six parts: (A) First, mzLearn partitions each sample file into non-overlapping dynamically resized patches that enclose all the potential peak signals in the sample and removes noisy patches via an auto-correlation process. (B) It then aligns the patches across samples using a cross-correlation process to form correlated-patch groups. (C) mzLearn estimates rt drift among samples and re-aligns the correlated-patch groups via the learned rt drift-map. (D) mzLearn extracts peaks from correlated-patch groups. (E) mzLearn improves and refines candidate peak groups using updated learned parameters and drift-map. (F) Finally, mzLearn estimates an intensity drift map and normalizes the feature intensities to correct for instrument drifts.

A. Creating patches of potential peaks

In the first step, mzLearn partitions each sample file into non-overlapping bounding boxes that enclose all the potential peaks in the sample. We define a patch Xp to be one such bounding box that is dynamically resized to adapt to the shape of one underlying potential peak.

Coarse patching

mzLearn recursively chunks the data into coarse patches that tile the retention time (rt) and m/z space for each sample file with a narrow m/z bin (MZcoarse) and a generous rt bin (RTcoarse). The recursive algorithm overcomes the memory requirements for downstream analysis, reducing the computational complexity of the algorithm from O(M) to O(log(M)), where M is the number of data points {x} in a single LC/MS file, where x=(rt,m/z,u).

We initialize the MZcoarse value to be 2 × mztol×MZmax, where mztol is the reported machine m/z tolerance in Daltons from the .mzML metadata information, and MZmax is the maximum reported m/z value across all the samples. We initialize the RTcoarse value to be (RTmax)/5, where RTmax is the maximum reported retention time across all sample files.

Dynamic resizing of patches

Patches are then dynamically resized to ensure that each patch contains only potential peaks, and empty patches are discarded. Within every non-empty patch, points are sorted along the rt axis, and the distances between successive points along the rt and m/z directions are measured as drt and dmz. We define Drt and Dmz as the acceptable lower bounds for distances between successive points in a patch along the rt and m/z axes:

Drt=μdrt+0.1σdrt
Dmz=μdmz+0.1σdmz

Where μdrt, μdmz,σdrt and σdmz are the mean and standard deviation of the distances between successive points along the rt and m/z axes, respectively. The inferred Drt and Dmz allow us to adapt to different machine precisions and prevent the issue of peak fragmentation (referred to as “bleeding” in ref. 11) without requiring any prior knowledge about the instruments or hard assumptions about the data. A non-empty patch is then split into two separate patches if any distance between successive points along the rt or m/z axes exceeds the Drt and Dmz pads, while patches with either differences along the rt or m/z axes smaller than Drt and Dmz are combined.

Removing noisy patches by calculating the autocorrelation

Next, the noisy patches are filtered by calculating an autocorrelation score. A resized patch, Xp, is correlated with a time-shifted version of itself. The M data points in a patch are sorted along the rt axis, Xp=x0,x1,x2,...,xM, such that rt0≤rt1≤rt2≤...≤rtM. The autocorrelation for a patch, Xp, is calculated as:

ACX=1M−2∑i=1M−1(ui−1−μ−1)σ−1(ui+1−μ+1)σ+1

where μ−1 and σ−1 are the mean and standard deviation of the intensities for the data points x0 through xM−2. Similarly, μ+1 and σ+1 are the mean and standard deviation of the intensities for the data points x2 through xM. While a patch with a well-defined smooth peak shape will correlate strongly with itself, a noisy patch has a low autocorrelation score. We filter patches whose autocorrelation scores do not exceed a certain threshold. We seed the filter with Tac(0)=0.5 for a single pre-learning pass. After Stage-1 pin discovery and re-alignment, we set the autocorrelation cutoff to the 5th percentile of per-peak autocorrelation among pins and recompute it once more after Stage-2 (three iterations total).

B. Aligning patches across samples using cross-correlation

mzLearn uses the cross-correlation primitive, an important concept that uses a similar peak-shape assumption to align and group peaks across samples. This operation is performed between a reference patch (Xp) from sample k, and a candidate bounding box (X′) in sample k’. If the limits of the reference patch X are defined as rtmin,rtmax×mzmin,mzmax, then the limits of the candidate bounding box X′ are rtmin+lbd,rtmax+ubd×mzmin−mztol,mzmax+mztol, where lbd and ubd are lower and upper bound drift estimates between samples k to k’. Initially, we use default values for the bounds: lbd=−RTmax/50, and ubd=RTmax/50. The lower and upper bound estimates are associated with the drift in rt and are updated later by the rt-drift map (Section C.2).

To calculate the cross-correlation between the reference patch (Xp) and the candidate bounding box (X′), the data must be binned along the rt axis to form arrays of intensities. The rt axes in each bounding box are binned with bins of size Δ, considered as μdrt/10. Bins with more than one data point have their intensities averaged. If the distance between rt-consecutive data points is greater than Drt, then bins between those points are imputed with the minimum intensity value. Otherwise, the empty bins are filled with interpolated intensity using the nearby non-empty bins. The output of this step is the array FΔX[rt], which is the binned interpolated data of patch X and is defined to be zero when rt is outside the range of FΔX.

The reference patch is aligned to the candidate bounding box at the rt-displacement (d), which maximizes the alignment function between their bounding boxes. The alignment function (AL) is defined as:

AL(Xp,X′,d)=wμd,σd[d]⋅FΔXp⋆FΔ(X′)[d],
(FΔXp⋆FΔX′)[d]=∑nMFΔXp[rtmin+nΔ]⋅FΔX′[rtmin+nΔ+d]

Where d is the rt-displacement between Xp and X′, rtmin is minimum rt of the reference bounding box, M is the length of FΔ(Xp), and wμd,σd[d] is the expected drift function. Initially, the expected drift function wμd,σd[d] is 1 for all values of d. Later, the expected drift function is determined by the rt-drift map (Section C.2) using the expected rt-drift (μd) and the rt-drift uncertainty (σd) between samples k to k’. With rt-drift map information, wμd,σd[d] is 1 for d in the 2σd neighborhood of μd, and decays to 0 for d beyond this neighborhood.

The limits of the candidate patch X′p are defined as rtmin+d*,rtmax+d*×mzmin−mztol,mzmax+mztol, where d* is the rt-displacement that maximized AL(Xp,X′,d). The candidate patch and the reference patch form a patch-group pair {Xpk,Xpk′}. After alignment of the patches, we calculate the cross-correlation score, which is the zero-mean normalized cross-correlation, to return values between -1 and 1:

XCXp(X′p)=1M∑n=1MFΔXp[rtmin+nΔ]−μXpσXpFΔX′p[rtmin+nΔ+d*]−μX′pσX′p

where μX and σX are the mean and standard deviation of FΔX for patch X, and M is the length of FΔ(Xp). Patch pairs above the cross-correlation threshold are kept as correlated patches. We seed with Tcc(0)=0. After Stage-1, the cross-correlation cutoff is set to the 5th percentile of per-peak cross-correlation among pins and is recomputed once after Stage-2; these learned cutoffs replace the seeds for all subsequent filtering.

After we obtain pairs of cross-correlated patches, all pairs that share the same referential patch are combined into a cohort wide patch-group {Xpk}k∈Np, where Np is the number of patch pairs.

C. Estimating rt Drift

To estimate the rt drift between pairs of correlated patched, we define “pins” as a subset of the correlated patches found in most sample files with above-average autocorrelation and cross-correlation scores. Pins are updated at each stage of mzLearn (via updated filtering parameters and drift information) and are used for the next stage of the peak improvement process.

Stage-1 Pins and rt-Drift Map

The stage-1 pins are patches that cross-correlate across all samples (no missing values) with initial group-average cross-correlation scores exceeding 0.8 and are used to obtain rt-drift map information. Stage 1 pins, the set of T robust patches h1, …, hT spanning the entire cohort of files, are then used to generate non-linear drift maps between any desired pair of samples. Specifically, the drift d→k→k′x from any sample k to k′ at the desired coordinates x=rt,m/z can be interpolated by computing the weighted average (μd) of the rt-drift of pins, where pins closer to the coordinate of interest are given a higher weight and pins further away are given a lower weight. The weighted standard deviation (σd) of the rt drift is used to measure the error tolerances in the drift. The weighted 1st and 99th percentiles of the pin drifts are the lower (lbd) and upper bounds (ubd) of the drift at x in sample k, respectively.

Re-alignment of patches via the rt-drift map

We repeat the cross-correlation primitive for every file pair in the data set using the inferred rt-drift map. Unlike the cross-correlation used to find stage-1 pins, the stage-1 drift map d→k→k′x is now available to guide the cross-correlation procedure. The relevant rt-drift information for the cross-correlation of patch p in file k to sample k’ is obtained by considering the stage-1 drift map at the peak position of the patch:

d→k→k′Pkrt(Xpk),Pkmz(Xpk),

where Pkrt(Xpk) and Pkmz(Xpk) are the rt and m/z coordinates of the patch Xpk maximum intensity. The rt-drift information is then used to guide the alignment of Xpk with the corresponding signal in sample k’ via the cross-correlation primitive (Section B).

D. Peak extraction via multi-step scissors

While most patch groups include data from one peak, some patch groups may contain multiple peaks with similar m/z and rt values, for example, peaks from isomeric metabolites. To separate multiple peaks in the same patch group, we apply a procedure named “scissors” according to the following steps:

  1. Patch groups are split by gaps in rt. The reference sample (k0) adjusted rt data points rtp(ki→k0) are collected from the individual patches in the patch group, ∪irtp(ki→k0). If there is a gap between consecutive rt values that is greater than Drt, the group is split at the gap.

  2. Patch groups are split by gaps in m/z. The reference sample (k0) adjusted rt and m/z data points rtp(ki→k0),mzp(ki→k0) are collected from the individual patches in the patch group. If the group-wide m/z-width is greater than 10*mztol(Da), the patch group is split by k-means clustering. The number of clusters for k-means clustering is chosen using DBSCAN, which maximizes the density of points within each cluster while minimizing the density between clusters72. New groups are created from each cluster of data points.

  3. Patch-groups are split at the rt position of the local intensity minima. mzLearn searches for the rt-locations of the intensity minima, Minrt, in a patch group, {Xpk}k∈Np, with two strategies: In the first strategy, the intensity minima are measured from the combined patch group signal, Minrt[FΔ(∪iXp(ki→k0))]. In the second strategy, the intensity minima are determined by consensus: Intensity minima are found in each individual patch, and those locations are averaged, Avg({Minrt[FΔ(Xp(ki→k0))]}k∈Np).

The result of the multi-step scissor procedure is an expanded set of candidate peak-groups.

E. Improving and refining peak groups

Peak groups are further filtered to remove noisy and mis-aligned peaks, based on the improved parameters learned from Stage-2 pins, which are a subset of candidate peak groups with high quality. Here, we consider the candidate peaks that are found in Ntot0.8+0.2log(Ntot) samples, where Ntot is the total number of samples. Features that have above-average autocorrelation scores and above-average cross-correlation scores are selected as stage-2 pins. Stage-2 pins are used to obtain a more accurate stage-2 drift map and to calculate quality thresholds.

Alignment reliability score

The alignment reliability score, AR{Xp}(Xp) of an individual peak Xp, with respect to its peak group, {Xp}, as a measure of the consistency of the peak rt-location across all samples in the peak group. The adjusted peak coordinate, Pkrt(Xp(k→k0)), is the rt-coordinate of the kth sample’s maximum intensity value in the reference (sample k0) coordinate system. The alignment reliability score compares this adjusted peak coordinate to the rest of the patches in the group to identify any outliers:

ARXpXp=e[−Pkrt(Xp(k→k0))−μr]2/2σr2

where μr=Avg({Pkrt(Xp(k→k0))}k∈Np) and σr=Max(Std({Pkrt(Xp(k→k0))}k∈Np),Drt). The alignment reliability score ARXp is 1 if the patch’s peak rt-location appears in a location consistent with the rest of the group, and 0 if the peak location is an outlier.

Peak quality filtering

Stage-2 pins are used to learn the numerical thresholds for quality features. We define g(X) as a function that acts on an individual peak from a peak-group, X∈{Xp(k)}k∈Np, and returns a quality score between -1 and 1. We define an individual-level score threshold, thg, such that if g(X)<thg, then the peak is removed from the peak-group. We define a feature-level score threshold, th{g}, such that if Q75%({g(Xp(k))}k∈Np)<th{g}, then the full peak-group is removed from the list of possible features. We learn th{g} from the set of pins, H, by taking the 5th percentile of the g(X) for all the individual peaks from the pin groups:

th{g}=Q5%⋃p∈Hg(Xpk)k∈Np

Then, the individual-level thresholds are defined from the feature-level thresholds:

thg=th{g}/3

We use the above formula to define the minimum acceptable autocorrelation score for a peak-group and individual peak (g=AC), and the minimum acceptable cross-correlation score for a peak-group and individual peak (g=XCX(k0)), as well as the minimum acceptable alignment reliability score for an individual peak (g=ARXp,Drt).

Missing peak search

After filtering, the original patches have passed through many different operations that used conservative filters to remove potential peaks and less-accurate drift maps to conduct the alignment. Therefore, the filtered peaks, while more trustworthy, have a high number of missing values due to the algorithm’s learning process. We can recover the missing peaks using the more accurate Stage-2 drift map.

We consider a peak group with individual peaks found in Np samples, {Xp(k)}k∈Np, and choose a file, k′∉Np, that is not included in the peak group. We survey the individual peaks from the peak group, and for each surveyed peak, we estimate the position in file k′ where we would expect to find the corresponding peak. The bounding box estimates from all surveyed files are averaged together to create a final estimate of the expected peak location, Xpk′, in sample k′. The data in the expected peak location Xp(k′) is added to the peak group if it passes the individual peak quality thresholds defined above. After the missing peaks have been added to their respective peak groups, the merging, scissor, and filtering operations discussed previously are repeated.

F. Estimating intensity drift and normalization

mzLearn is equipped with a normalization method that estimates signal intensity drift caused by extended run order and batch effects. The first step, pin normalization, removes sample-wide technical variations, such as those due to differences in the sample concentration or sample injection volume. Where no pool or QC samples are interspersed between the primary LC/MS samples in large-scale cohorts, mzLearn creates synthetic QC through an iterative process and normalizes the data in each iteration. Finally, it estimates the intensity drifts for the cases of missing values in pool or synthetic pool samples.

Pin normalization

Pin normalization corrects the sample-wide technical variations in the data. Peaks are normalized sample-by-sample by dividing by the total intensity of the stage-3 pins. Stage-3 pins are defined as those features found in ≥60% of the sample files with auto-correlation and cross-correlation scores above the 10th percentile.

Creating synthetic pool samples

mzLearn creates Synthetic QC samples from the primary samples that approximate experimental QC samples, which can be used to estimate the feature-specific intensity drift when no QC samples are available in the public domain datasets. First, primary samples are clustered based on a low-dimensional representation of their current feature intensity profile, with each cluster constrained to include only consecutive samples in the run order. The number of clusters is chosen to maximize the Silhouette Coefficient while maintaining at least 20 samples in each cluster. Second, Synthetic pools are created by averaging the feature intensity of all samples within a cluster. Then, peaks are partially normalized to the intensity of their corresponding synthetic pool, where the silhouette coefficient of the clustering modulates the normalization factor. This clustering, synthetic QC generation, and modulated normalization process iterates until run-order consecutive clusters have a consistent near-zero silhouette coefficient.

Feature-specific intensity drift-map

QC samples (or their synthetic equivalents) can be used to estimate the intensity drift for a specific feature. In the case when a feature, f, has no missing values in the QC samples, mzLearn computes the normalization of its intensity in sample file k, uf(k), as:

Norm(uf(k))=uf(k)/∑i4uf(qk,i)∣tk−tqk,i∣∑i4∣tk−tqk,i∣,

where tk is the experiment run time associated with sample k, tqk,i is the experiment run time associated with pool sample qk,i, and qk,1,qk,2,qk,3,qk,4 are the four pool samples closest to sample file k in the experiment run time. When uf(qk) is a missing value; mzLearn estimates the value of uf(qk) using nearby existing features in the QC sample.

mzLearn can correct feature-specific intensity drift, even when features have missing values. mzLearn considers the set of features with ≥60% sample frequency in the set of QC or synthetic QC pins, Hpool. For each QC or synthetic QC sample, we compare the intensity of the identified features with the QC- or synthetic QC-wide mean μf to create an intensity drift map for that QC or synthetic QC sample. This intensity drift map, du(q)(rt,m/z), is used to estimate the intensity for the missing feature, uf(q) using its rt-m/z coordinates:

uf(q)=μfdu(q)(rtf(q),mzf(q)),

where rtf(q) and mzf(q) are the rt and m/z coordinates of the missing feature in the qth QC or synthetic QC sample. The drift map du(q)(rt,m/z) is created by interpolation using the existing (not-missing) features hϵHpool in the qth QC or synthetic QC sample, du(q)(rth(q),mzh(q))=uh(q)/μh.

G. Data-driven threshold learning and update schedule

initialization (Stage 0)

We apply a one-time seed of TAC(0)=0.5, to filter obviously noisy patches and TXC(0)=0, to retain non-negative cross-correlations.

Stage-1 pins and drift map

We define pins as correlated patch groups present in all samples whose group-average cross-correlation ≥0.8 and whose average autocorrelation exceeds the cohort average. The 0.8 coherence anchor yields high-precision alignment landmarks; percentile bounds make the search window data-adaptive and robust to outliers. Pins generate a non-linear rt-drift map by weighted averaging of local pin drifts (weights decrease with rt–m/z distance). The lower/upper bounds of expected drift are the weighted 1st/99th percentiles and restrict the search window for cross-correlation in later stages.

Learning thresholds from pins (Stages 2–3)

For each quality metric g∈{AC, XC, AR}, we compute the empirical distribution of per-peak scores across the current pin set and set the feature-level cutoff to the 5th percentile. A 5th-percentile quantile policy is scale-free and controls tail noise while preserving recall; three passes are sufficient to reach a stable feature set and drift map. A candidate feature passes if its group-level score if it is more than the cutoff; a member peak is retained if its individual score is higher than the same cutoff. Thresholds are relearned after each re-alignment; mzLearn converges in three iterations.

Normalization sets and synthetic-QC stopping

For pin normalization, we define Stage-3 pins as features found in ≥60% of samples whose autocorrelation and cross-correlation exceed the cohort 10th percentile. Synthetic-QC clustering is constrained to run-order-contiguous groups (≥20 samples), iterated until the silhouette coefficient approaches 0 (no residual run-order structure). These thresholds are conservative—high enough to avoid noisy anchors, low enough to ensure sufficient coverage for normalization and drift control.

The sensitivity analysis by varying the learned quantiles and the iteration count, the detected feature sets and alignment residuals changed minimally, and downstream conclusions were unchanged. Each run writes a machine-readable CSV (params_overall.csv) with instrument precision, MZcoarse, RTcoarse, and global m/z–RT bounds/dispersion used to initialize patching and alignment; this file is deposited alongside results to document the learned and initialized settings at run time.

mzLearn implementation and runtime

mzLearn is implemented in Python. The detector/alignment engine uses the scientific stack (NumPy/SciPy/pandas) for correlation-based operations and ingests centroided MS¹ from mzML via a Python parser. The software environment is provided as a version-pinned Docker image with a matching requirements.txt for reproducibility. Runtime is dominated by cross-sample correlation and iterative drift-aware re-alignment and therefore increases with the number of mzML files in a cohort; the memory footprint remains modest due to tiling and batched processing. For larger studies, we recommend multi-core parallelism and, when available, multi-node execution.

Evaluation datasets and sources

We evaluated mzLearn on publicly available LC–MS datasets. Each dataset is referenced in text by repository and accession Supplementary Table 2, including MassIVE: MSV000086486⁵¹, MSV00008743473, MetaboLights: MTBLS112474, MTBLS60675, MTBLS62076, MTBLS73377, Metabolomics Workbench: ST00038778, ST00038879, ST00042280, ST00060181, ST00090982, ST00123542, ST00123642, ST00123742, ST00138578, ST00140883, ST00142284, ST00142384, ST00142885, ST00151986, ST00152087, ST00171087, ST00184988, ST00191889, ST00193178, ST00193278, ST00202790, ST00211290, ST00223339, ST00224491, ST00225192, ST00233193, ST00271190, ST00277394, ST00281795, and Stanford-iPOP96.

Peak picking evaluation

To evaluate peak-picking performance across different methods, we selected a database from Metabolomics Workbench featuring diverse experimental settings and the availability of targeted metabolomic measurements, where each target has recorded m/z and rt values Supplementary Table 3 provides a detailed list of datasets and their associated IDs, which were obtained from the Metabolomics Workbench and MetaboLights databases. All .raw files were centroided and converted to .mzML format using the Microsoft Windows software MSConvert. Each data set was submitted individually to mzLearn, XCMS (version 3.18), and ASARI. No parameter needs to be provided to mzLearn. To run XCMS11, we used “Isotopologue Parameter Optimization” (XCMS-IPO)97 to learn the parameters of each model, and default parameters were used for ASARI.

As XCMS’s output can vary depending on the input parameters, we used “Isotopologue Parameter Optimization” (XCMS-IPO)73, which aims to learn the parameters using a multi-stage optimization guided by 13C isotope peaks and a default mass resolution of 5 ppm was used for ASARI. To evaluate model performance, we focused on peaks identified by each method that met a minimum frequency threshold of 20%. Targeted metabolite peaks were identified and considered true positives (TP%) among detected peaks by comparing reported m/z and rt values from each dataset and matching them with reference values for each method.

Benchmarking with targeted references

For datasets with targeted measurements, we used the target lists provided by the original studies (repository-reported m/z and RT) as ground truth (Supplementary Table 3). After running each method, we considered features present in  ≥ 20% of samples and counted a targeted metabolite as detected (TP) when a feature matched within |Δm/z | ≤ 0.005 Da and |ΔRT | ≤ 2% of the total RT span (identical windows for all methods). False-positive (FP) rates were estimated by manual QC of 100 randomly selected detections per dataset (peak shape, SNR, alignment).

Evaluation of the normalization

To assess the effectiveness of our normalization method in mitigating run order effects, we selected public datasets with a minimum of 150 primary and at least 20 QC samples (Supplementary Table 4). For each dataset, 10% of QC samples were withheld to evaluate the normalization performance. We applied three normalization approaches: Total Ion Current (TIC) normalization, QC-based normalization, and synthetic QC normalization. In TIC normalization, each sample is scaled by the total sum of the intensities of all detected ions, while in QC-based and synthetic QC normalization, each feature is adjusted each feature was scaled by (i) the sample’s TIC, (ii) the ratio to the closest pooled QC, or (iii) the ratio to the closest synthetic QC in the run order. After normalization, we calculated the Relative Standard Deviation (RSD) of the hidden QC samples, which serves as a metric for evaluating each normalization approach in compensating for run-order effects.

Pretraining datasets

The pretraining data consisted of 22 publicly available datasets, including 20,827 samples, as detailed in Supplementary Table 5. Each dataset was manually labeled according to age groups (adult versus pediatric) and disease categories, including adult cancer, adult other, pediatric cardiometabolic, and pediatric other. Additionally, metadata was parsed for a subset of samples to capture specific information such as exact age and BMI. We included only datasets focused on blood-based metabolomics analyzed by HILIC in positive ion mode to maintain analytical consistency. Each dataset was individually processed using mzLearn, resulting in a normalized peak intensity matrix for each study.

To identify peak groups common across these cohorts, we applied retention time (RT) alignment and scaling adjustments using Eclipse43 and metabCombiner10 methods. We first selected combined ST0001236 and ST0001237 datasets as the reference study due to their high-quality peak data, characterized by high true positive rates, low false positive rates, known target information, and a larger number of detected peaks across 1,650 samples. Each pre-trained study was then aligned to the reference study using both methods. The alignment parameters for Eclipse and metabCombiner were optimized using the known targeted metabolite information. The goal was to maximize the number of common targets retained after alignment compared to those detected before alignment. We found that a union of both methods provided the highest number of aligned targeted metabolites across studies, prioritizing alignments identified by metabCombiner when the two methods disagreed and performed best based on this metric.

We then calculated a robustness score for each peak group, factoring in the frequency of detection within each cohort, the cohort sample size, and the number of studies in which the peak was consistently detected as:

Robusstnesssocre(Pi)=∑s=122frequncy(Pi,s)×log(Ns)∑s=122log(Ns)

Where Pi is the i-th peak group, frequency (Pi,s) represents the frequency of detection of Pi in study S, and Ns is the number of samples in Study S. Peaks with a minimum robustness score of 0.15 were selected, resulting in a final set of 2,736 peak groups shared across datasets. For each study, the identified peak groups were standardized using z-score scaling while missing values within were imputed by averaging.

We then split the pretraining data (n = 20,548) into training (n = 17,465), validation (n = 2055), and test (n = 1028) sets, where the available metadata, study cohorts, age, and disease groups were balanced across splits.

Pre-trained VAE models

Using the pretraining data, we developed an unsupervised Variational Autoencoder (VAE) model to learn meaningful low-dimensional representations in the latent space. To ensure a balanced model architecture, hidden layer sizes were scaled according to input and latent sizes, creating an efficient structure for both encoding and decoding complex data patterns. The hidden layer size is calculated as:

layersizei=inputsize×ri
r=latentsizeinputsize1numhiddenlayers

The model was trained using a composite loss function that included reconstruction loss to capture accurate data representation and Kullback-Leibler (KL) divergence loss to enforce latent space regularization:

Totalloss=reconstructionloss+KLweight×KLloss

KL-annealing was applied to gradually increase the weight of the KL loss during training, allowing the model to first focus on reconstructing input features accurately before imposing latent space constraints. To prevent overfitting, early stopping was incorporated by monitoring validation loss. Additionally, the model’s hyperparameters—including learning rate, number of layers, and dropout rates—were optimized using Optuna, a Bayesian optimization framework, to enhance model performance by finding the best possible hyperparameter configuration.

To adapt the pre-trained VAE model for clinical variable representation, such as age and BMI, we retrain only the last layers of the encoder, preserving the rest of the network structure and pre-trained parameters. This approach allows the VAE to retain its foundational biological representations learned during pretraining while specializing in clinical tasks. In this step, we applied a targeted grid search rather than full hyperparameter optimization, focusing on a limited set of parameters, specifically the learning rate and number of layers to train in the final stage. Learning rates and layer configurations (1–2 layers) were explored to balance training efficiency with performance. This strategy allowed the VAE to effectively represent clinical attributes such as age, BMI, and disease type, providing a flexible yet reliable foundation for clinical prediction and exploration

For all model development stages, the best hyperparameters were chosen based on validation set performance. The top-performing model on the validation set was then tested on an independent test set, and the final model was selected based on its test set performance, ensuring generalizability and robustness. After training, we used the average latent space across all samples to create a UMAP (Uniform Manifold Approximation and Projection) visualization, providing an interpretable, low-dimensional data view.

Fine-tune VAE models

We developed fine-tuned VAE models using metabolomics data from the serum of ccRCC patients at baseline (n = 741, with n = 392 receiving ICI and n = 349 receiving mTOR inhibition). First, the baseline patients were split into training (n = 443), validation (n = 149), and test (n = 149) sets, with clinical variables including sex, age, study region, prognosis, and prior treatment regimens balanced across splits and within treatment arms.

Then, we fine-tuned the VAE model on this dataset in an unsupervised manner, using the pre-trained weights to retain the general biological representations learned during pretraining. In parallel, we developed a comparison model without transfer learning, reinitializing the VAE with random weights. In parallel, we trained a comparison model without transfer learning, reinitializing the VAE with random weights. For both configurations, we used Optuna to optimize hyperparameters, including learning rate, dropout rate, and KL weight, aiming to minimize the total of reconstruction loss and KL divergence on the validation set.

After fine-tuning the VAE on the baseline ccRCC dataset, we adapted it for three distinct tasks: binary classification, multi-class classification, and survival analysis. For each task, only the last layer of the fine-tuned VAE was retrained to retain core latent representations, with a grid search used to tune the learning rate. The model configurations achieving the highest validation AUC for binary classification, F1 score for multi-class classification, and C-index for survival analysis were selected. These top-performing models were then evaluated on an unseen test set to compare the effectiveness of VAE models with and without transfer learning against traditional machine learning models.

Joint learning for prognostic model development

To develop a robust prognostic model for identifying features associated with overall survival (OS) independent of treatment, we used two fine-tuned VAE models that had already undergone unsupervised fine-tuning on baseline ccRCC data. For each treatment group—immune checkpoint inhibitors (ICIs) and mTOR inhibitors—we retrained only the last layer of the fine-tuned VAE and added a task-specific output layer to predict OS.

In this joint training setup, each VAE was dedicated to one treatment group and trained to learn OS-related features unique to its respective cohort. Both models shared the core latent space from the unsupervised fine-tuning, allowing them to retain foundational biological representations while specializing in treatment-specific OS prediction. The training objective combined the individual OS prediction losses from each VAE into a total loss, defined as:

Totalloss=LossICI+λ×LossmTOR

Where LossICI and LossmTOR are the OS prediction losses for the ICI and mTOR models, respectively and λ is a weighting factor. This combined loss encouraged both models to jointly learn OS-associated features in a treatment-agnostic manner by aligning their representations in the latent space. To optimize the model, we used grid search to tune the learning rate, while the regularization parameters and the number of epochs were fixed to prevent overfitting and monitor performance metrics on validation data.

Adversarial learning for predictive model development

To develop a treatment-specific model for predicting overall survival (OS) in response to immune checkpoint inhibitor (ICI) therapy, we implemented an Adversarial VAE model designed to isolate features unique to ICI treatment. The approach involved two VAE models trained in parallel: a primary VAE to capture OS-associated features for ICI-treated patients, and an adversarial VAE to capture OS-related features for mTOR-treated patients. Both models were initialized from the previously fine-tuned VAE, with only the last layer retrained to specialize for their respective tasks.

The main VAE was trained to predict OS for ICI patients, aiming to learn biomarkers specific to ICI response. Concurrently, the adversarial VAE was trained to predict OS for patients treated with mTOR inhibitors. The adversarial component introduced a competing objective, discouraging the main VAE from learning treatment-independent features by capturing only OS-associated patterns unique to ICI therapy. This adversarial setup was implemented by setting the total loss as the difference between the ICI-specific loss and the adversarial loss, defined as:

Totalloss=LossICI−λ×LossmTOR

where LossICI and LossmTOR are the OS prediction losses for the ICI and mTOR VAEs, respectively, and λ is a weighting factor that balances the adversarial effect. This formulation enables the main VAE to retain only ICI-specific features by minimizing the confounding influence of treatment-independent survival factors. Similar to joint learning, we use grid search to tune the learning rate and consider fixed regulation parameters to prevent overfitting and monitor the model performance metrics on validation data.

SHAP computation

We interpreted two baseline VAEs, a prognostic VAE (outcome risk across all patients) and a predictive VAE (ICI-specific outcome risk). For each model, we computed SHAP49 on the held-out baseline test set using PyTorch models, shap.GradientExplainer (expected gradients) with a training-set background (fixed random subset, ~200 samples; same background reused within each model to avoid leakage).

For a sample x with model output f(x), SHAP assigns feature attributions ϕj(x) satisfying local additivity:

f(x)-E[f(X)]=∑jϕj(x).

We summarized each feature j by importance

Ij=Ex[∣ϕj(x)∣]

(used for ranking) and direction

Dj=Ex[ϕj(x)]

(mean signed attribution). Direction was mapped to biology according to the model’s output: if higher output means higher risk, then Dj<0= protective and Dj>0= harmful (reversed if the output encodes poor or favorable). We also report auxiliary summaries (SD of ϕj, fraction of positive/negative attributions, and a consistency index ∣Dj∣/Ij). Top-20 lists per model were formed by sorting on Ij. Putative metabolite annotations were for display only and did not affect SHAP computation or ranking.

Traditional machine-learning models

For comparison with the VAE models, we implemented traditional machine-learning approaches to perform classification and survival analysis tasks. Binary classification tasks were performed using logistic regression, with model performance evaluated using the Area Under the Curve (AUC) metric. For multi-class classification, we extended logistic regression using a one-vs-rest approach, where the model independently predicts each class against all others, creating a multi-class framework. Model performance for multi-class classification was assessed using the F1 score, which captures a balance between precision and recall.

For survival analysis, we applied the Kaplan-Meier (KM) estimator, a non-parametric method, to estimate survival functions from right-censored data. The Kaplan-Meier model provided an estimate of overall survival (OS) probabilities over time, allowing us to compare survival distributions across risk groups. Statistical significance in survival differences between groups was evaluated using the log-rank test. The concordance index and hazard ratios associated with survival predictions in different groups were evaluated by Cox proportional hazards models.

Supplementary information

42004_2025_1791_MOESM3_ESM.docx (13.3KB, docx)

Description of Additional Supplementary Files

Supplementary Data 1 (34.4MB, xlsx)

Acknowledgements

We thank ReviveMed’s scientific advisors, including professors Ernest Fraenkel, Matthew Vander Heiden, and Clary Clish, and previous employees Yen Lin and Julian Montagut.

Author contributions

L.P., J.E. and A.K.J. designed the mzLearn algorithm. J.E. and A.K.J. implemented it. L.P. developed pre-trained and finetuned algorithms and implemented the models. M.Z. prepared the input datasets and developed the web app to run mzLearn. L.P., M.M. and M.K. interpreted biological findings and wrote the manuscript. All the authors approved the final version.

Peer review

Peer review information

: Communications Chemistry thanks the anonymous reviewers for their contribution to the peer review of this work.

Data availability

This study uses LC–MS datasets obtained from public repositories. Raw data are available from MassIVE, MetaboLights, Metabolomics Workbench, and the HMP2/Stanford portal. Repository accession codes and short citations with DOIs/PMIDs for every dataset used for benchmarking, normalization, and pretraining are listed in Supplementary Table 2 and described in the Methods subsection “Evaluation datasets and sources.”. Derived benchmarking outputs are included as Supplementary Data 1. Additional aggregated/processed files are available from the corresponding author (L.P.) upon reasonable request. Apart from the source repositories’ terms of use, there are no additional access restrictions.

Code availability

A beta release of mzLearn, including peak picking, alignment, and intensity-drift normalization, is available for non-profit academic use via a hosted, versioned Docker pipeline at mzlearn.com. Each submitted job authenticates, pulls a pinned image (e.g., mzlearn/public:v4.5), and executes with a unique JOB_CODE; users can set CPU count, and the input mzML directory is mounted read-only to ensure reproducibility. The scripts used to pretrain the variational autoencoder (VAE) and to fine-tune on target cohorts are available for non-profit academic use at GitHub (ReviveMed/mzEmbed, release v1.0.0) and are archived with a citable DOI at Zenodo: 10.5281/zenodo.17460245.

Competing interests

L.P. is a co-founder and shareholder of ReviveMed, Inc. J.E., A.K.J., M.M., M.Z. and M.K. have stock options for ReviveMed Inc.

Footnotes

Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Supplementary information

The online version contains supplementary material available at 10.1038/s42004-025-01791-w.

References

  • 1.Jin, Q. & Ma, R. C. W. Metabolomics in diabetes and diabetic complications: insights from epidemiological studies. Cells10, 2832 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 2.Hussain, H., Vutipongsatorn, K., Jiménez, B. & Antcliffe, D. B. Patient stratification in sepsis: using metabolomics to detect clinical phenotypes, sub-phenotypes and therapeutic response. Metabolites12, 376 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 3.Buergel, T. et al. Metabolomic profiles predict individual multidisease outcomes. Nat. Med.10, 1–12 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 4.Lassen, J. K. et al. Large-Scale metabolomics: Predicting biological age using 10,133 routine untargeted LC–MS measurements. Aging Cell22, e13813 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 5.Boland, M. L. et al. Resolution of NASH and hepatic fibrosis by the GLP-1R/GcgR dual-agonist Cotadutide via modulating mitochondrial function and lipogenesis. Nat. Metab.2, 413–431 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 6.Angelidi, A. M. et al. Early metabolomic, lipid and lipoprotein changes in response to medical and surgical therapeutic approaches to obesity. Metabolism138, 155346 (2023). [DOI] [PubMed] [Google Scholar]
  • 7.Wishart, D. S. et al. HMDB 5.0: the Human Metabolome Database for 2022. Nucleic Acids Res.50, D622–D631 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 8.Gertsman, I. & Barshop, B. A. Promises and pitfalls of untargeted metabolomics. J. Inherit. Metab. Dis.41, 355–366 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 9.Schrimpe-Rutledge, A. C., Codreanu, S. G., Sherrod, S. D. & McLean, J. A. Untargeted metabolomics strategies-challenges and emerging directions. J. Am. Soc. Mass Spectrom.27, 1897–1905 (2016). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 10.Habra, H. et al. metabCombiner: Paired untargeted LC-HRMS metabolomics feature matching and concatenation of disparately acquired data sets. Anal. Chem.93, 5028–5036 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 11.Smith, C. A., Want, E. J., O’Maille, G., Abagyan, R. & Siuzdak, G. XCMS: Processing mass spectrometry data for metabolite profiling using nonlinear peak alignment, matching, and identification. Anal. Chem.78, 779–787 (2006). [DOI] [PubMed] [Google Scholar]
  • 12.Pluskal, T., Castillo, S., Villar-Briones, A. & Orešič, M. MZmine 2: Modular framework for processing, visualizing, and analyzing mass spectrometry-based molecular profile data. BMC Bioinforma.11, 395 (2010). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 13.Tautenhahn, R., Böttcher, C. & Neumann, S. Highly sensitive feature detection for high resolution LC/MS. BMC Bioinforma.9, 504 (2008). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 14.Hohrenk, L. L. et al. Comparison of software tools for liquid chromatography–high-resolution mass spectrometry data processing in nontarget screening of environmental samples. Anal. Chem.92, 1898–1907 (2020). [DOI] [PubMed] [Google Scholar]
  • 15.Kantz, E. D., Tiwari, S., Watrous, J. D., Cheng, S. & Jain, M. Deep neural networks for classification of LC-MS spectral peaks. Anal. Chem.91, 12407–12413 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 16.Watrous, J. D. et al. Visualization, quantification, and alignment of spectral drift in population scale untargeted metabolomics data. Anal. Chem.89, 1399–1404 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 17.Lu, W. et al. Metabolite measurement: pitfalls to avoid and practices to follow. Annu. Rev. Biochem.86, 277–304 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 18.Gomari, D. P. et al. Variational autoencoders learn transferrable representations of metabolomics data. Commun. Biol.5, 1–9 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 19.Lange, E., Tautenhahn, R., Neumann, S. & Gröpl, C. Critical assessment of alignment procedures for LC-MS proteomics and metabolomics measurements. BMC Bioinforma.9, 375 (2008). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 20.Dunn, W. B. et al. Procedures for large-scale metabolic profiling of serum and plasma using gas chromatography and liquid chromatography coupled to mass spectrometry. Nat. Protoc.6, 1060–1083 (2011). [DOI] [PubMed] [Google Scholar]
  • 21.Fan, S. et al. Systematic error removal using random forest for normalizing large-scale untargeted lipidomics data. Anal. Chem.91, 3590–3596 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 22.Sysi-Aho, M., Katajamaa, M., Yetukuri, L. & Orešič, M. Normalization method for metabolomics data using optimal selection of multiple internal standards. BMC Bioinforma.8, 93 (2007). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 23.Cui, H. et al. scGPT: Towards Building a Foundation Model for Single-Cell Multi-Omics Using Generative AI. (2023) 10.1101/2023.04.30.538439. [DOI] [PubMed]
  • 24.Rosen, Y. et al. Universal Cell Embeddings: A Foundation Model for Cell Biology. 2023.11.28.568918 Preprint at 10.1101/2023.11.28.568918 (2024).
  • 25.Hao, M. et al. Large-scale foundation model on single-cell transcriptomics. Nat. Methods21, 1481–1491 (2024). [DOI] [PubMed] [Google Scholar]
  • 26.Zhou, C. et al. A comprehensive survey on pretrained foundation models: a history from BERT to ChatGPT. Int. J. Mach. Learn. Cybern. (2024) 10.1007/s13042-024-02443-6.
  • 27.Mahieu, N. G. & Patti, G. J. Systems-level annotation of a metabolomics data set reduces 25000 features to fewer than 1000 unique metabolites. Anal. Chem.89, 10397–10406 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 28.Chen, Z.-Z. et al. Nontargeted and targeted metabolomic profiling reveals novel metabolite biomarkers of incident diabetes in African Americans. Diabetes71, 2426–2437 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 29.Tahir, U. A. et al. Whole Genome Association Study of the plasma metabolome identifies metabolites linked to cardiometabolic disease in Black individuals. Nat. Commun.13, 4923 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 30.Vatanen, T. et al. Mobile genetic elements from the maternal microbiome shape infant gut microbial assembly and metabolism. Cell185, 4921–4936.e15 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 31.Tolstikov, V., Moser, A. J., Sarangarajan, R., Narain, N. R. & Kiebish, M. A. Current status of metabolomic biomarker discovery: impact of study design and demographic characteristics. Metabolites10, 224 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 32.Menestrel, T. L., Craig, E., Tibshirani, R., Hastie, T. & Rivas, M. Using pre-training and interaction modeling for ancestry-specific disease prediction in UK Biobank. Preprint at 10.48550/arXiv.2404.17626 (2024). [DOI] [PMC free article] [PubMed]
  • 33.A Comprehensive Workflow of Mass Spectrometry-Based Untargeted Metabolomics in Cancer Metabolic Biomarker Discovery Using Human Plasma and Urine. https://www.mdpi.com/2218-1989/3/3/787. [DOI] [PMC free article] [PubMed]
  • 34.Martens, L. et al. mzML—a Community Standard for Mass Spectrometry Data *. Mol. Cell. Proteom.10, R110.000133 (2011). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 35.Gorrochategui, E., Jaumot, J., Lacorte, S. & Tauler, R. Data analysis strategies for targeted and untargeted LC-MS metabolomic studies: Overview and workflow. TrAC Trends Anal. Chem.82, 425–442 (2016). [Google Scholar]
  • 36.Huan, T. et al. Systems biology guided by XCMS Online metabolomics. Nat. Methods14, 461–462 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 37.MZmine: toolbox for processing and visualization of mass spectrometry based molecular profile data | Bioinformatics | Oxford Academic. https://academic.oup.com/bioinformatics/article/22/5/634/206500. [DOI] [PubMed]
  • 38.Tsugawa, H. et al. MS-DIAL: data-independent MS/MS deconvolution for comprehensive metabolome analysis. Nat. Methods12, 523–526 (2015). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 39.Li, S., Siddiqa, A., Thapa, M., Chi, Y. & Zheng, S. Trackable and scalable LC-MS metabolomics data processing using asari. Nat. Commun.14, 4113 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 40.Misra, B. B. Data normalization strategies in metabolomics: Current challenges, approaches, and tools. Eur. J. Mass Spectrom.26, 165–174 (2020). [DOI] [PubMed] [Google Scholar]
  • 41.Motzer, R. J. et al. Nivolumab versus Everolimus in advanced renal-cell carcinoma. N. Engl. J. Med.373, 1803–1813 (2015). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 42.Li, H. et al. Metabolomic adaptations and correlates of survival to immune checkpoint blockade. Nat. Commun.10, 4346 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 43.Hitchcock, D. S. et al. Eclipse: a Python package for alignment of two or more nontargeted LC-MS metabolomics datasets. Bioinformatics41, btaf290 (2025). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 44.Auto-Encoders in Deep Learning––A Review with New Perspectives. https://www.mdpi.com/2227-7390/11/8/1777.
  • 45.Ruthotto, L. & Haber, E. An introduction to deep generative modeling. GAMM-Mitteilungen44, e202100008 (2021). [Google Scholar]
  • 46.Asperti, A. & Tonelli, V. Comparing the latent space of generative models. Neural Comput. Appl.35, 3155–3172 (2023). [Google Scholar]
  • 47.Akiba, T. et al. Optuna: A next-generation hyperparameter optimization framework. Proc. 25th ACM SIGKDD Int. Conf. Knowl. Discov. Data Min. 2623–2631 (2019).
  • 48.Heng, D. Y. et al. External validation and comparison with other models of the International Metastatic Renal-Cell Carcinoma Database Consortium prognostic model: a population-based study. Lancet Oncol.14, 141–148 (2013). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 49.Lundberg, S. M. & Lee, S.-I. A unified approach to interpreting model predictions. Adv. Neural Inf. Process. Syst.30, 4765–4774 (2017).
  • 50.McLean, C. & Kujawinski, E. B. AutoTuner: high fidelity and robust parameter selection for metabolomics data processing. Anal. Chem.92, 5724–5732 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 51.Delabriere, A., Warmer, P., Brennsteiner, V. & Zamboni, N. SLAW: A scalable and self-optimizing processing workflow for untargeted LC-MS. Anal. Chem.93, 15024–15032 (2021). [DOI] [PubMed] [Google Scholar]
  • 52.Ju, R. et al. A graph density-based strategy for features fusion from different peak extract software to achieve more metabolites in metabolic profiling from high-resolution mass spectrometry. Anal. Chim. Acta1139, 8–14 (2020). [DOI] [PubMed] [Google Scholar]
  • 53.Myers, O. D., Sumner, S. J., Li, S., Barnes, S. & Du, X. Detailed investigation and comparison of the XCMS and MZmine 2 Chromatogram construction and chromatographic peak detection methods for preprocessing mass spectrometry metabolomics data. Anal. Chem.89, 8689–8695 (2017). [DOI] [PubMed] [Google Scholar]
  • 54.Liu, M. et al. A cluster of metabolism-related genes predict prognosis and progression of clear cell renal cell carcinoma. Sci. Rep.10, 12949 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 55.Du, W. et al. HIF drives lipid deposition and cancer in ccRCC via repression of fatty acid metabolism. Nat. Commun.8, 1769 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 56.Mazumder, S., Higgins, P. J. & Samarakoon, R. Downstream targets of VHL/HIF-α signaling in renal clear cell carcinoma progression: mechanisms and therapeutic relevance. Cancers15, 1316 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 57.Cui, W., Liu, D., Gu, W. & Chu, B. Peroxisome-driven ether-linked phospholipids biosynthesis is essential for ferroptosis. Cell Death Differ.28, 2536–2551 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 58.Shindou, H., Hishikawa, D., Harayama, T., Eto, M. & Shimizu, T. Generation of membrane diversity by lysophospholipid acyltransferases. J. Biochem. (Tokyo)154, 21–28 (2013). [DOI] [PubMed] [Google Scholar]
  • 59.Li, Y. et al. Histopathologic and proteogenomic heterogeneity reveals features of clear cell renal cell carcinoma aggressiveness. Cancer Cell41, 139–163.e17 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 60.Schooneman, M. G., Vaz, F. M., Houten, S. M. & Soeters, M. R. Acylcarnitines. Diabetes62, 1–8 (2013). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 61.Pearce, E. L. et al. Enhancing CD8 T cell memory by modulating fatty acid metabolism. Nature460, 103–107 (2009). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 62.Boussiotis, V. A. & Patsoukis, N. Effects of PD-1 signaling on immunometabolic reprogramming. Immunometabolism4, e220007 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 63.Knuplez, E. & Marsche, G. An updated review of pro- and anti-inflammatory properties of plasma Lysophosphatidylcholines in the vascular system. Int. J. Mol. Sci.21, 4501 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 64.Piccirillo, A. R. et al. The Lysophosphatidylcholine transporter MFSD2A is essential for CD8+ memory T cell maintenance and secondary response to infection. J. Immunol. Baltim. Md 1950203, 117–126 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 65.Li, M. M. et al. Contextual AI models for single-cell protein biology. Nat. Methods21, 1546–1557 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 66.Burkhart, J. G. et al. Biology-inspired graph neural network encodes reactome and reveals biochemical reactions of disease. Patterns4, 100758 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 67.Huang, K. et al. A foundation model for clinician-centered drug repurposing. Nat. Med. (2024) 10.1038/s41591-024-03233-x. [DOI] [PMC free article] [PubMed]
  • 68.MetaboLights: open data repository for metabolomics | Nucleic Acids Research | Oxford Academic. https://academic.oup.com/nar/article/52/D1/D640/7424432. [DOI] [PMC free article] [PubMed]
  • 69.Li, S. et al. Predicting network activity from high throughput metabolomics. PLOS Comput. Biol.9, e1003123 (2013). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 70.Pirhaji, L. et al. Revealing disease-associated pathways by network integration of untargeted metabolomics. Nat. Methods13, 770–776 (2016). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 71.Domingo-Almenara, X., Montenegro-Burke, J. R., Benton, H. P. & Siuzdak, G. Annotation: a computational solution for streamlining metabolomics analysis. Anal. Chem.90, 480–489 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 72.Ester, M., Kriegel, H.-P., Sander, J. & Xu, X. A density-based algorithm for discovering clusters in large spatial databases with noise. in Proceedings of the Second International Conference on Knowledge Discovery and Data Mining 226–231 (AAAI Press, Portland, Oregon, 1996).
  • 73.Chen, L. et al. Metabolite discovery through global annotation of untargeted metabolomics data. Nat. Methods18, 1377–1385 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 74.Cai, Y. et al. Sex differences in colon cancer metabolism reveal a novel subphenotype. Sci. Rep.10, 4905 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 75.Shen, X. et al. Metabolic reaction network-based recursive metabolite annotation for untargeted metabolomics. Nat. Commun.10, 1516 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 76.Cruickshank-Quinn, C. I. et al. Metabolomics and transcriptomics pathway approach reveals outcome-specific perturbations in COPD. Sci. Rep.8, 17132 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 77.Goodrich, J. A. et al. Metabolic signatures of youth exposure to mixtures of Per- and Polyfluoroalkyl substances: a multi-cohort study. Environ. Health Perspect.131, 027005 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 78.Tanes, C. et al. Role of dietary fiber in the recovery of the human gut microbiome and its metabolome. Cell Host Microbe29, 394–407.e5 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 79.Barry, E. L. et al. Plasma metabolomics analysis of aspirin treatment and risk of colorectal adenomas. Cancer Prev. Res. Phila. Pa15, 521–531 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 80.Dutta, T. et al. Impact of long-term poor and good glycemic control on metabolomics alterations in Type 1 diabetic people. J. Clin. Endocrinol. Metab.101, 1023–1033 (2016). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 81.Sindelar, M. et al. Longitudinal metabolomics of human plasma reveals prognostic markers of COVID-19 disease severity. Cell Rep. Med.2, 100369 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 82.Rothman, N. et al. Metabolome-wide association study of occupational exposure to benzene. Carcinogenesis42, 1326–1336 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 83.Lancaster, S. M. et al. Global, distinctive, and personal changes in molecular and microbial profiles by specific fibers in humans. Cell Host Microbe30, 848–862.e7 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 84.McGlinchey, A. J. et al. Metabolic signatures across the full spectrum of non-alcoholic fatty liver disease. JHEP Rep.4, 100477 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 85.Vykoukal, J. et al. Caveolin-1-mediated sphingolipid oncometabolism underlies a metabolic vulnerability of prostate cancer. Nat. Commun.11, 4279 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 86.Roberts, I. et al. Untargeted metabolomics of COVID-19 patient serum reveals potential prognostic markers of both severity and outcome. Metabolom. J. Metabolom, Soc.18, 6 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 87.Valdés, A. et al. Metabolomics study of COVID-19 patients in four different clinical stages. Sci. Rep.12, 1650 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 88.Thomas, T. et al. COVID-19 infection alters kynurenine and fatty acid metabolism, correlating with IL-6 levels and renal status. JCI Insight5, e140327 (2020). 140327. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 89.Páez-Franco, J. C. et al. Metabolomics analysis reveals a modified amino acid metabolism that correlates with altered oxygen homeostasis in COVID-19 patients. Sci. Rep.11, 6350 (2021). [DOI] [PMC free article] [PubMed]
  • 90.Caterino, M. et al. The Serum metabolome of moderate and severe COVID-19 patients reflects possible liver alterations involving carbon and nitrogen metabolism. Int. J. Mol. Sci.22, 9548 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 91.Xiao, N. et al. Integrated cytokine and metabolite analysis reveals immunometabolic reprogramming in COVID-19 patients with therapeutic implications. Nat. Commun.12, 1618 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 92.Li, T. et al. Longitudinal metabolomics reveals Ornithine cycle dysregulation correlates with inflammation and coagulation in COVID-19 Severe Patients. Front. Microbiol.12, 723818 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 93.Dei Cas, M. et al. Link between serum lipid signature and prognostic factors in COVID-19 patients. Sci. Rep.11, 21633 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 94.Ansone, L. et al. Amino acid metabolism is significantly altered at the time of admission in hospital for severe COVID-19 patients: findings from longitudinal targeted metabolomics analysis. Microbiol. Spectr.9, e0033821 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 95.Buyukozkan, M. et al. Integrative metabolomic and proteomic signatures define clinical outcomes in severe COVID-19. iScience25, 104612 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 96.Lloyd-Price, J. et al. Multi-omics of the gut microbial ecosystem in inflammatory bowel diseases. Nature569, 655–662 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 97.Libiseller, G. et al. IPO: a tool for automated optimization of XCMS parameters. BMC Bioinforma.16, 118 (2015). [DOI] [PMC free article] [PubMed] [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Supplementary Materials

42004_2025_1791_MOESM3_ESM.docx (13.3KB, docx)

Description of Additional Supplementary Files

Supplementary Data 1 (34.4MB, xlsx)

Data Availability Statement

This study uses LC–MS datasets obtained from public repositories. Raw data are available from MassIVE, MetaboLights, Metabolomics Workbench, and the HMP2/Stanford portal. Repository accession codes and short citations with DOIs/PMIDs for every dataset used for benchmarking, normalization, and pretraining are listed in Supplementary Table 2 and described in the Methods subsection “Evaluation datasets and sources.”. Derived benchmarking outputs are included as Supplementary Data 1. Additional aggregated/processed files are available from the corresponding author (L.P.) upon reasonable request. Apart from the source repositories’ terms of use, there are no additional access restrictions.

A beta release of mzLearn, including peak picking, alignment, and intensity-drift normalization, is available for non-profit academic use via a hosted, versioned Docker pipeline at mzlearn.com. Each submitted job authenticates, pulls a pinned image (e.g., mzlearn/public:v4.5), and executes with a unique JOB_CODE; users can set CPU count, and the input mzML directory is mounted read-only to ensure reproducibility. The scripts used to pretrain the variational autoencoder (VAE) and to fine-tune on target cohorts are available for non-profit academic use at GitHub (ReviveMed/mzEmbed, release v1.0.0) and are archived with a citable DOI at Zenodo: 10.5281/zenodo.17460245.


Articles from Communications Chemistry are provided here courtesy of Nature Publishing Group

RESOURCES