Code repository for the paper: Multi-tissue metabolomic analysis of male UM-HET3 mice treated with five longevity interventions using a convergence-stabilized XGBoost pipeline.
├── Tissue Metabolomic Predictions/
│ ├── Metabolomics_Pipeline/ # Core analysis pipeline (steps 1-12)
│ │ ├── step1_find_hyperparameters.py
│ │ ├── step2_perform_10kCV.py
│ │ ├── step3_perform_NIT.py
│ │ ├── step4_compute_feature_importance.py
│ │ ├── step5_plot_feature_importance_sparkplots.R
│ │ ├── step6_plot_NIT_figures.R
│ │ ├── step7_plot_10kCV_figures.R
│ │ ├── step8_create_cross_tissue_summary.py
│ │ ├── step9_perform_GHRKO_SD_analysis.py
│ │ ├── step10_metabolite_classification_binomial.R
│ │ ├── step11_plot_lipid_category_analysis.R
│ │ ├── step12_supplementary_PC_table.py
│ │ ├── ergothioneine_boxplot/ # Figure 6: ergothioneine across tissues
│ │ ├── config.py # Pipeline configuration
│ │ ├── shared_funcs.py # Shared utility functions
│ │ └── test/ # Unit tests
│ ├── Data/
│ │ └── Cleaned Log2 and na set to zero/ # Cleaned input data (7 tissues)
│ ├── output_files/ # Pipeline outputs
│ └── 1_clean_and_prepare_data/ # Data cleaning provenance
│
├── benchmarking/ # Feature importance convergence analysis
│ ├── benchmark_feature_importance_iterations.py
│ ├── normalization_methods_paper.py # Convergence algorithm
│ ├── analyze_normalization_methods.py
│ ├── create_xgboost_gain_convergence_table.py
│ ├── create_tissue_feature_count_table.py
│ └── *_1000_iterations_*.csv # Per-tissue iteration results
│
└── Aug2025_Lipid_Analysis/ # Lipid deconvolution (used by step 11)
The pipeline uses XGBoost regression to predict lifespan increase from metabolomic data across seven tissues (brain, liver, kidney, muscle, perigonadal fat, inguinal fat, plasma) in male UM-HET3 mice treated with rapamycin, acarbose, 17alpha-estradiol, canagliflozin, or caloric restriction.
| Step | Script | Description |
|---|---|---|
| 1 | step1_find_hyperparameters.py |
Tissue-specific XGBoost hyperparameter grid search |
| 2 | step2_perform_10kCV.py |
10-fold cross-validation (20 iterations) |
| 3 | step3_perform_NIT.py |
Novel Intervention Test (leave-one-intervention-out) |
| 4 | step4_compute_feature_importance.py |
XGBoost Gain feature importance (1000 iterations) |
| 5 | step5_plot_feature_importance_sparkplots.R |
Sparkplot figures (Figures 1-4, Panel B) |
| 6 | step6_plot_NIT_figures.R |
NIT figures (Figures 1-4, Panel A) |
| 7 | step7_plot_10kCV_figures.R |
10-fold CV result plots |
| 8 | step8_create_cross_tissue_summary.py |
Cross-tissue feature importance summary (Supp Table 5) |
| 9 | step9_perform_GHRKO_SD_analysis.py |
GHRKO/Snell Dwarf validation analysis |
| 10 | step10_metabolite_classification_binomial.R |
Metabolite class enrichment tests (Supp Table 1) |
| 11 | step11_plot_lipid_category_analysis.R |
Lipid C-vs-DB scatterplots (Figure 5) |
| 12 | step12_supplementary_PC_table.py |
Phosphatidylcholine ratio table (Supp Table 4) |
| Fig 6 | ergothioneine_boxplot/figure6_ergothioneine_boxplot.R |
Ergothioneine boxplots across tissues |
The benchmarking/ directory contains the convergence-stabilized feature ranking method described in the paper. The algorithm determines the minimum number of XGBoost iterations needed for stable feature rankings by computing Spearman rank correlation and total variation distance at successive iteration budgets.
cd "Tissue Metabolomic Predictions/Metabolomics_Pipeline"
# Run the Python pipeline steps
python step1_find_hyperparameters.py
python step2_perform_10kCV.py
python step3_perform_NIT.py
python step4_compute_feature_importance.py
python step8_create_cross_tissue_summary.py
python step9_perform_GHRKO_SD_analysis.py
python step12_supplementary_PC_table.py
# R plotting steps (see Metabolomics_Pipeline/README.md for full arguments)
Rscript step5_plot_feature_importance_sparkplots.R <args>
Rscript step6_plot_NIT_figures.R <args>
Rscript step7_plot_10kCV_figures.R <args>See Metabolomics_Pipeline/README.md for detailed usage instructions.
- pandas, numpy, scikit-learn, xgboost, shap, matplotlib, scipy
- dplyr, ggplot2, openxlsx, tidyr, patchwork, purrr, scales
Input data files are log2-transformed, cleaned metabolomic measurements for seven tissues. Files ending in _FM contain filtered metabolites (MSI level <= 3); files ending in _AM contain all metabolites. The pipeline operates on _FM files; the ergothioneine boxplot uses _AM files.
_FM= Filtered Metabolites (MSI level <= 3)_AM= All MetabolitesM_prefix = Male groupsCont_12= 12-month controlRapa,Aca,17aE2,Cana,CR= intervention groups