bio-ms-data-processing-spatial-metabolomics

Analyze spatial metabolomics imzML files to generate ion images and segment tissue.

7|Updated Apr 5, 2026
One-click install
npx skills add https://github.com/dailycafi/metabolism-skills --skill bio-ms-data-processing-spatial-metabolomics
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bio-ms-data-processing-spatial-metabolomics
Source: https://github.com/dailycafi/metabolism-skills/tree/main/skills/ms-data-processing/spatial-metabolomics
Command: npx skills add https://github.com/dailycafi/metabolism-skills --skill bio-ms-data-processing-spatial-metabolomics

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Map and analyze spatial distributions of metabolites from MSI experiments to convert raw imzML/MSI data into interpretable ion images, segmented tissue regions, and statistically compared ROI spectra so researchers can localize biochemical signatures within tissue sections.

Core Features & Use Cases

  • imzML parsing & ion image generation: extract pixelwise spectra and build ion images for target m/z values with configurable mass tolerance and normalization.
  • Datacube construction & dimensionality reduction: bin spectra onto a common m/z axis to form a (rows × cols × bins) datacube and apply PCA/IncrementalPCA for scalable analysis.
  • Spatial segmentation & ROI comparison: cluster pixels by spectral similarity (k-means or hierarchical), extract mean spectra per region, and run statistical tests with FDR correction to find discriminating m/z features.
  • Coregistration & visualization: align MSI ion images with H&E histology and export publication-quality figures.
  • Use case: Align a MALDI imzML dataset to histology, segment tumor and stroma regions, and report m/z features enriched in tumor after TIC normalization and FDR-corrected testing.

Quick Start

Load the imzML file, generate ion images for biomarkers of interest, build a datacube with 0.1 Da bins, run PCA and k-means (k=5) to segment tissue, and export ROI comparison results.

Frequently Asked Questions about bio-ms-data-processing-spatial-metabolomics

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate ion images from an imzML file for spatial metabolomics?

To generate ion images from an imzML file, parse pixelwise spectra using pyimzml and extract target m/z values with configurable mass tolerance and TIC normalization to visualize metabolite distributions across tissue sections.

How do I segment tissue regions from MALDI mass spectrometry imaging data?

Segment tissue from MALDI MSI data by binning spectra onto a common m/z axis to form a datacube, applying PCA dimensionality reduction, and clustering pixels by spectral similarity using k-means or hierarchical clustering.

Can I coregister MSI ion images with H&E histology slides?

Yes, you can coregister MSI ion images with H&E histology slides to align mass spectrometry imaging datasets with histological tissue sections and export publication-quality visualization figures.

What Python packages do I need for spatial segmentation of imzML data?

Spatial segmentation of imzML data requires Python packages pyimzml, numpy, scipy, scikit-learn, scikit-image, matplotlib, pandas, and statsmodels to support datacube construction, clustering, and statistical comparisons.

How do I find discriminating m/z features between tissue regions of interest?

Find discriminating m/z features by extracting mean spectra per segmented region of interest and running statistical tests with FDR correction to identify significantly enriched metabolites between tissue regions.

Does this Skill support both MALDI and DESI mass spectrometry imaging datasets?

Yes, this Skill supports both MALDI and DESI mass spectrometry imaging datasets, processing imzML and ibd files for ion image generation, spatial segmentation, and region-of-interest metabolite profile comparisons.