agentsclimarketplace

Mass spectrometry data parsing

Skill HolobiomicsLab/asb-skill-collections/packs/metabolomics/lc-ms/skills/mass-spectrometry-data-parsing

Use when you have received raw or vendor-converted centroid mzML files from LC-MS, GC-MS, or DI-MS platforms and need to extract MS1 spectra before building mass tracks, performing peak detection, or constructing composite feature maps.From its SKILL.md

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill mass-spectrometry-data-parsing

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 15 stars15 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its file declares

Copied from the file, not written here

The file declares its own license as CC-BY-4.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

8.3 KB, ~1.3k tokens by cl100k_base, as published. Nobody here has run it

mass-spectrometry-data-parsing

Summary

Parse centroid mzML files from LC-MS instruments to extract MS1 spectra as (m/z, scan_number, intensity) tuples, indexing them for efficient retrieval and downstream mass track construction. This is the foundational step that converts vendor instrument data into a structured, queryable representation suitable for high-resolution metabolomics feature extraction.

When to use

You have received raw or vendor-converted centroid mzML files from LC-MS, GC-MS, or DI-MS platforms and need to extract MS1 spectra before building mass tracks, performing peak detection, or constructing composite feature maps. Use this skill at the start of any asari workflow or when you need to inspect and validate the structure and quality of raw mass spectrometry data before alignment or annotation.

When NOT to use

  • Input data are in profile (non-centroid) format — asari requires centroid mzML; convert using ProteoWizard or ThermoRawFileParser first.
  • Data have already been processed into mass tracks or feature tables — this skill is for raw spectrum extraction only.
  • You need to extract or process MS/MS spectra — asari's default LC-MS workflow ignores MS/MS data; use alternative workflows if tandem data are required.

Inputs

  • centroid mzML file (from LC-MS, GC-MS, or DI-MS platform)
  • vendor .RAW file (if converted to mzML via ThermoRawFileParser or ProteoWizard)

Outputs

  • list of (m/z, scan_number, intensity) tuples extracted from MS1 spectra
  • mzTree dictionary keyed by int(mz × 1000) for efficient mass-indexed lookup

How to apply

Use pymzml to parse the mzML file and retrieve all MS1 spectra as a list of (m/z, scan_number, intensity) tuples. Index the resulting data points into an mzTree dictionary keyed by int(mz × 1000) to enable efficient O(1) lookup during subsequent binning and mass track construction. Validate that the parsed tuples retain high mass resolution (typically sub-ppm for Orbitrap or similar instruments) and that scan numbers are sequential and complete. Check that intensity values are positive and that the m/z range matches the instrument's configured mass window. This indexing scheme exploits high mass resolution to prioritize mass separation during the initial processing phase, laying the groundwork for accurate alignment and downstream feature detection.

Related tools

Examples

from pymzml import run; spectra = [(s['m/z array'], s['ID'], s['intensity array']) for s in run('sample.mzML') if s['ms level'] == 1]

Evaluation signals

  • Parsed tuple list contains non-zero counts of (m/z, scan_number, intensity) entries with m/z values spanning the instrument's configured mass window (typically 50–1200 m/z for metabolomics).
  • mzTree dictionary contains entries for all unique int(mz × 1000) keys; no collisions or data loss during indexing.
  • Scan numbers are sequential (or contain expected gaps for non-MS1 scans); no duplicate or out-of-order entries.
  • Intensity values are all positive integers or floats; no negative or NaN entries after parsing.
  • High mass resolution is preserved: m/z values show sub-ppm precision (e.g., 5–10 decimal places for Orbitrap data), not truncated to lower precision.

Limitations

  • Performance scales with file size; very large mzML files (>10 GB) may require streaming or chunked parsing to stay within memory budget.
  • Profile-mode (non-centroid) data must be converted to centroid format before parsing; centroiding is not performed by pymzml itself.
  • Parsing speed and accuracy depend on mzML file quality and vendor-specific schema compliance; some vendor formats may have non-standard or incomplete metadata.
  • MS/MS spectra are ignored in this parsing step; if tandem data are required, alternative workflows or explicit MS2 extraction logic must be applied.

Evidence

  • [other] Parse the mzML file using pymzml to retrieve all MS1 spectra as a list of (m/z, scan_number, intensity) tuples.: "Parse the mzML file using pymzml to retrieve all MS1 spectra as a list of (m/z, scan_number, intensity) tuples."
  • [other] The default method uses pymzml to parse mzML files.: "The default method uses pymzml to parse mzML files."
  • [other] Index data points into an mzTree dictionary keyed by int(mz × 1000) for efficient retrieval.: "Index data points into an mzTree dictionary keyed by int(mz × 1000) for efficient retrieval."
  • [intro] Taking advantage of high mass resolution to prioritize mass separation and alignment: "Taking advantage of high mass resolution to prioritize mass separation and alignment"
  • [other] We use ThermoRawFileParser to convert Thermo .RAW files to .mzML. Msconvert in ProteoWizard can handle the conversion of most vendor data formats.: "We use ThermoRawFileParser to convert Thermo .RAW files to .mzML. Msconvert in ProteoWizard can handle the conversion of most vendor data formats."
  • [other] Input data are centroid mzML files from LC, GC or DI-MS metabolomics.: "Input data are centroid mzML files from LC, GC or DI-MS metabolomics."
  • [other] MS/MS spectra are ignored in default LC-MS workflow but handled by alternative workflows.: "MS/MS spectra are ignored in default LC-MS workflow but handled by alternative workflows."

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.