metabolite-disease-correlation-computation
Summary
Compute correlation coefficients between individual metabolite signal intensities and disease class labels across all samples, then construct and visualize a correlation matrix as a heatmap to reveal disease-associated metabolic signatures. This skill transforms raw model outputs into interpretable disease-metabolite associations.
When to use
After training a DeepMSProfiler deep learning model and generating per-sample predictions and metabolite signal intensities, use this skill when you need to: (1) identify which metabolites are most strongly associated with each disease class, (2) generate publication-ready visualizations of metabolite-disease relationships, or (3) validate that learned features correspond to biologically meaningful metabolic differences between disease groups.
When NOT to use
- Input metabolite data is already aggregated by disease group (correlation computation requires per-sample intensities and labels, not group means).
- Disease labels are continuous (e.g., disease severity score) rather than categorical; consider regression or rank correlation instead.
- Metabolite intensities contain missing values or extreme outliers that have not been preprocessed; imputation or normalization should precede correlation.
Inputs
- Per-sample model predictions (class labels for each sample)
- Per-sample metabolite signal intensities (~341 metabolites × N samples)
- Disease class labels for all samples (categorical: e.g., 'health', 'nodule', 'cancer')
Outputs
- Correlation matrix (metabolites × diseases, numeric values in [-1, 1])
- Heatmap visualization (high-resolution image file)
- Feature results array (.npy format) containing heatmap for ensemble models
How to apply
Load the per-sample model outputs (sample predictions and metabolite signal intensities) from the trained DeepMSProfiler model. Compute correlation coefficients (Pearson or Spearman) between each of the ~341 metabolite signals and disease class labels (encoded numerically) across all samples. Construct a 2D correlation matrix with metabolites as rows and disease classes as columns. Generate a heatmap visualization using Python libraries (matplotlib/seaborn) with color intensity encoding correlation magnitude and direction (typically diverging colormap: negative = blue, zero = white, positive = red). Export the heatmap as a high-resolution image file (PNG/SVG).
Related tools
- Python (matplotlib, seaborn) (Generate heatmap visualization from correlation matrix)
- DeepMSProfiler (Source tool that trains model and outputs per-sample metabolite intensities and predictions used as input to this correlation workflow) — https://github.com/yjdeng9/DeepMSProfiler
- SciPy / NumPy (Compute Pearson or Spearman correlation coefficients between metabolite signals and disease labels)
Examples
python showFeature.py
Evaluation signals
- Correlation matrix shape matches expectations: [~341 metabolites × number of disease classes], with all values in [-1, 1].
- Heatmap visual inspection: metabolites with known disease associations should show strong correlations (|r| > 0.5) in expected disease columns; background should appear neutral (near-white for correlation ≈ 0).
- No NaN or inf values in correlation matrix; all cells contain valid numeric correlation coefficients.
- Heatmap color scale is correctly oriented (red = positive correlation, blue = negative correlation, white ≈ 0) and labeled with metabolite and disease identifiers.
- Exported image file has sufficient resolution (≥300 DPI) and is readable for publication.
Limitations
- Correlation magnitude does not imply causation or biological relevance; statistically significant correlations may reflect technical artifacts or confounding.
- Pearson correlation assumes linear relationships; non-linear metabolite-disease associations will be underestimated.
- Disease class imbalance in the training set can bias correlations toward overrepresented classes.
- Raw metabolite signal intensities may contain batch effects, normalization biases, or instrument drift not accounted for in correlation; preprocessing quality affects result interpretation.
Evidence
- [other] Compute correlation coefficients (e.g., Pearson or Spearman) between each metabolite signal and disease class labels for all samples.: "Compute correlation coefficients (e.g., Pearson or Spearman) between each metabolite signal and disease class labels for all samples."
- [other] Construct a correlation matrix with metabolites as rows and diseases as columns.: "Construct a correlation matrix with metabolites as rows and diseases as columns."
- [other] Generate heatmap visualization using a Python plotting library (e.g., matplotlib, seaborn), with rows representing metabolites, columns representing diseases, and cell colors encoding correlation magnitude and direction.: "Generate heatmap visualization using a Python plotting library (e.g., matplotlib, seaborn), with rows representing metabolites, columns representing diseases, and cell colors encoding correlation"
- [readme] It takes raw metabolomics data from different disease groups as input and provides three main outputs: 1. Sample disease type labels. 2. Heatmaps depicting the correlation of different metabolite signals with diseases.: "It takes raw metabolomics data from different disease groups as input and provides three main outputs: 1. Sample disease type labels. 2. Heatmaps depicting the correlation of different metabolite"
- [readme] After
run_feature ,the heatmaps were saved in ../jobs/jobs007/feature_results/ensemble_RISE.npy: "the heatmaps were saved in ../jobs/jobs007/feature_results/ensemble_RISE.npy"
1---2name: metabolite-disease-correlation-computation3description: Use when after training a DeepMSProfiler deep learning model and generating per-sample predictions and metabolite signal intensities, use this skill when you need to: (1) identify which metabolites are most strongly associated with each disease class, (2) generate publication-ready visualizations.4license: CC-BY-4.05---67# metabolite-disease-correlation-computation89## Summary1011Compute correlation coefficients between individual metabolite signal intensities and disease class labels across all samples, then construct and visualize a correlation matrix as a heatmap to reveal disease-associated metabolic signatures. This skill transforms raw model outputs into interpretable disease-metabolite associations.1213## When to use1415After training a DeepMSProfiler deep learning model and generating per-sample predictions and metabolite signal intensities, use this skill when you need to: (1) identify which metabolites are most strongly associated with each disease class, (2) generate publication-ready visualizations of metabolite-disease relationships, or (3) validate that learned features correspond to biologically meaningful metabolic differences between disease groups.1617## When NOT to use1819- Input metabolite data is already aggregated by disease group (correlation computation requires per-sample intensities and labels, not group means).20- Disease labels are continuous (e.g., disease severity score) rather than categorical; consider regression or rank correlation instead.21- Metabolite intensities contain missing values or extreme outliers that have not been preprocessed; imputation or normalization should precede correlation.2223## Inputs2425- Per-sample model predictions (class labels for each sample)26- Per-sample metabolite signal intensities (~341 metabolites × N samples)27- Disease class labels for all samples (categorical: e.g., 'health', 'nodule', 'cancer')2829## Outputs3031- Correlation matrix (metabolites × diseases, numeric values in [-1, 1])32- Heatmap visualization (high-resolution image file)33- Feature results array (.npy format) containing heatmap for ensemble models3435## How to apply3637Load the per-sample model outputs (sample predictions and metabolite signal intensities) from the trained DeepMSProfiler model. Compute correlation coefficients (Pearson or Spearman) between each of the ~341 metabolite signals and disease class labels (encoded numerically) across all samples. Construct a 2D correlation matrix with metabolites as rows and disease classes as columns. Generate a heatmap visualization using Python libraries (matplotlib/seaborn) with color intensity encoding correlation magnitude and direction (typically diverging colormap: negative = blue, zero = white, positive = red). Export the heatmap as a high-resolution image file (PNG/SVG).3839## Related tools4041- **Python (matplotlib, seaborn)** (Generate heatmap visualization from correlation matrix)42- **DeepMSProfiler** (Source tool that trains model and outputs per-sample metabolite intensities and predictions used as input to this correlation workflow) — https://github.com/yjdeng9/DeepMSProfiler43- **SciPy / NumPy** (Compute Pearson or Spearman correlation coefficients between metabolite signals and disease labels)4445## Examples4647```48python showFeature.py49```5051## Evaluation signals5253- Correlation matrix shape matches expectations: [~341 metabolites × number of disease classes], with all values in [-1, 1].54- Heatmap visual inspection: metabolites with known disease associations should show strong correlations (|r| > 0.5) in expected disease columns; background should appear neutral (near-white for correlation ≈ 0).55- No NaN or inf values in correlation matrix; all cells contain valid numeric correlation coefficients.56- Heatmap color scale is correctly oriented (red = positive correlation, blue = negative correlation, white ≈ 0) and labeled with metabolite and disease identifiers.57- Exported image file has sufficient resolution (≥300 DPI) and is readable for publication.5859## Limitations6061- Correlation magnitude does not imply causation or biological relevance; statistically significant correlations may reflect technical artifacts or confounding.62- Pearson correlation assumes linear relationships; non-linear metabolite-disease associations will be underestimated.63- Disease class imbalance in the training set can bias correlations toward overrepresented classes.64- Raw metabolite signal intensities may contain batch effects, normalization biases, or instrument drift not accounted for in correlation; preprocessing quality affects result interpretation.6566## Evidence6768- [other] Compute correlation coefficients (e.g., Pearson or Spearman) between each metabolite signal and disease class labels for all samples.: "Compute correlation coefficients (e.g., Pearson or Spearman) between each metabolite signal and disease class labels for all samples."69- [other] Construct a correlation matrix with metabolites as rows and diseases as columns.: "Construct a correlation matrix with metabolites as rows and diseases as columns."70- [other] Generate heatmap visualization using a Python plotting library (e.g., matplotlib, seaborn), with rows representing metabolites, columns representing diseases, and cell colors encoding correlation magnitude and direction.: "Generate heatmap visualization using a Python plotting library (e.g., matplotlib, seaborn), with rows representing metabolites, columns representing diseases, and cell colors encoding correlation"71- [readme] It takes raw metabolomics data from different disease groups as input and provides three main outputs: 1. Sample disease type labels. 2. Heatmaps depicting the correlation of different metabolite signals with diseases.: "It takes raw metabolomics data from different disease groups as input and provides three main outputs: 1. Sample disease type labels. 2. Heatmaps depicting the correlation of different metabolite"72- [readme] After `run_feature` ,the heatmaps were saved in `../jobs/jobs007/feature_results/ensemble_RISE.npy`: "the heatmaps were saved in `../jobs/jobs007/feature_results/ensemble_RISE.npy`"