Mzml format validation
Skill HolobiomicsLab/asb-skill-collections/packs/metabolomics/lc-ms/skills/mzml-format-validation
Curated, evidence-grounded skill and software-tool collections for scientific AI agents, generated by the AgenticScienceBuilder
npx -y skills add HolobiomicsLab/asb-skill-collections --skill mzml-format-validationAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 14 stars14 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 author says it does
Copied from the file, not written here
Use when after downloading an mzML file from a remote repository (e.g., MetaboLights, MassIVE, GNPS) via USI resolution, before attempting to parse it into a spectrum container or visualization dashboard.
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
5.8 KB, 897 tokens by cl100k_base, as published. Nobody here has run it
mzml-format-validation
Summary
Validate downloaded mzML files against the mzML XML schema to confirm structural integrity, presence of spectrum list, and indexed offset consistency before loading into analysis pipelines. This ensures data quality and compatibility with downstream spectrum access and metadata retrieval tools.
When to use
After downloading an mzML file from a remote repository (e.g., MetaboLights, MassIVE, GNPS) via USI resolution, before attempting to parse it into a spectrum container or visualization dashboard. Validation is essential when the source file integrity cannot be assumed or when the file will be used in production analysis workflows.
When NOT to use
- Input file is already loaded in memory as a spectrum object; re-validation of a parsed object is unnecessary.
- Input file comes from a trusted, validated local cache with documented provenance; skip validation if reproducibility does not depend on fresh verification.
- File format is not mzML (e.g., mzXML, NetCDF, Bruker .d); use format-specific validators instead.
Inputs
- mzML file (downloaded or local path)
- mzML schema definition (implicit in validator)
Outputs
- Validation result (pass/fail boolean or report)
- Error log or message (if validation fails)
- Validated mzML file ready for parsing (if validation passes)
How to apply
Parse the downloaded mzML file using a dedicated mzML validator tool (such as mzML indexer or pymzML parser) to check XML well-formedness, verify the presence and structure of the spectrum list element, and confirm that indexed offset records match the actual byte positions of spectrum entries in the file. If validation fails (malformed XML, missing spectrum list, corrupted offsets), reject the file and re-download. Pass only validated files to downstream spectrum container constructors. The validation step is grounded in the USI resolution workflow where file integrity directly impacts spectrum loading reliability.
Related tools
- pymzML (Parse and validate mzML XML structure; confirm spectrum list presence and indexed offset integrity)
- mzML indexer (Validate mzML schema compliance and index offset correctness)
- GNPS LCMS Visualization Dashboard (Consume validated mzML files for spectrum visualization and XIC extraction) — https://github.com/Wang-Bioinformatics-Lab/GNPS_LCMSDashboard
Examples
from pymzml.run import Reader; run = Reader('QC07.mzML'); spectra = [s for s in run]; assert len(spectra) > 0, 'No spectra found'
Evaluation signals
- Validator returns no XML parsing errors; file structure conforms to mzML schema.
- Spectrum list element is present and contains at least one spectrum entry with valid index references.
- Indexed byte offsets in the mzML index match actual file positions of spectrum elements when spot-checked.
- File can be successfully loaded into a pymzML container without exceptions; spectrum metadata and scan numbers are accessible.
- Validated file produces consistent chromatogram and spectrum data when visualized in the GNPS LCMS Dashboard or equivalent viewer.
Limitations
- Validation only confirms syntactic and structural correctness; does not verify semantic correctness (e.g., whether m/z values are physically plausible or whether retention times are monotonic).
- Some validators may not detect all edge cases of corrupt index offsets in very large mzML files; manual spot-checking of index entries is recommended for critical workflows.
- Validation performance may degrade on very large files (>1 GB); consider streaming or sampling-based validation for production pipelines with strict latency requirements.
Evidence
- [other] Validate the downloaded file against mzML schema using an mzML validator (e.g., mzML indexer or pymzML parser) to confirm XML structure, presence of spectrum list, and indexed offset integrity.: "Validate the downloaded file against mzML schema using an mzML validator (e.g., mzML indexer or pymzML parser) to confirm XML structure, presence of spectrum list, and indexed offset integrity."
- [other] Load the validated mzML file into an mzML spectrum container (e.g., pymzML object or equivalent data structure) to enable downstream spectrum access and metadata retrieval.: "Load the validated mzML file into an mzML spectrum container (e.g., pymzML object or equivalent data structure) to enable downstream spectrum access and metadata retrieval."
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.