A metabolomics analysis pipeline investigating urinary biomarkers of Type 2 Diabetes Mellitus (T2DM) using NMR spectroscopy data. This project applies epidemiological and machine learning methods to identify metabolites that are significantly altered in T2DM patients compared to healthy controls.
Type 2 Diabetes Mellitus (T2DM) is a metabolic disorder affecting over 400 million people worldwide. Metabolomics — the large-scale study of small molecules in biological samples — offers a powerful approach to understanding the metabolic disruptions associated with the disease and identifying potential urinary biomarkers.
This project uses NMR-based urinary metabolomics to:
- Identify metabolites significantly different between T2DM patients and healthy controls
- Build a machine learning classifier to distinguish the two groups
- Discover robust biomarker candidates confirmed by multiple analytical methods
- Source: MetaboLights MTBLS1
- Study: A metabolomic comparison of urinary changes in type 2 diabetes in mouse, rat, and human (Salek et al., 2007)
- Technology: NMR spectroscopy (Bruker DRX700, 700 MHz)
- Samples: 132 urine samples
- 84 healthy controls
- 48 T2DM patients (diet-controlled, unmedicated)
- Features: 220 NMR spectral bins (metabolite abundance values)
| File | Description |
|---|---|
s_MTBLS1.txt |
Sample metadata (subject IDs, condition, gender) |
m_MTBLS1_metabolite_profiling_NMR_spectroscopy_v2_maf.tsv |
Metabolite abundance matrix |
- Transposed the metabolite matrix (samples × features)
- Log-transformation (
log1p) to normalise right-skewed abundance values - Auto-scaling (z-score standardisation) to place all features on equal footing
- Principal Component Analysis reduced 220 dimensions to 2
- Visualised group separation between T2DM and Control samples
- Univariate logistic regression for each of the 220 metabolite features
- Benjamini-Hochberg FDR correction to control for multiple testing
- Effect sizes calculated as mean difference between groups (scaled)
- Ensemble classifier with 200 trees and balanced class weights
- 5-fold stratified cross-validation for honest performance evaluation
- Feature importances extracted to identify most predictive metabolites
- Cross-validated ROC curve for unbiased AUC estimation
- Overlapping top features between ExWAS and Random Forest identified
- Dual-method agreement used to prioritise robust biomarker candidates
| Method | Result |
|---|---|
| PCA | Partial group separation visible along PC1 (16.8% variance) |
| ExWAS | 87 / 220 metabolites significant after FDR correction (q < 0.05) |
| Random Forest | Cross-validated AUC = 0.985 ± 0.022 |
| Method overlap | 13 metabolites confirmed by both ExWAS and Random Forest |
| Metabolite | Biological Relevance |
|---|---|
2-oxoisovalerate |
Valine/leucine catabolism — altered amino acid metabolism |
ethanol |
Gut bacteria fermentation marker |
unknown_m_8.335 |
Unidentified aromatic compound — warrants further investigation |
| Metabolite | Biological Relevance |
|---|---|
isoleucine |
Branched-chain amino acid — well-established T2DM marker |
hippurate |
Gut microbiome health marker — consistently reduced in T2DM |
N-acetylglutamate |
Urea cycle intermediate — reflects altered nitrogen metabolism |
These findings are consistent with published T2DM metabolomics literature, supporting disruption of amino acid metabolism, gut microbiome function, and energy metabolism.
pandas
numpy
matplotlib
seaborn
scikit-learn
statsmodels
scipy
Partial separation between T2DM (red) and Control (blue) samples along PC1.
13 metabolites identified as significant by both ExWAS and Random Forest.

