Spectrum metadata 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 spectrum-metadata-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 importing raw mass spectrometry data from mzML, mzXML, msp, MGF, or JSON formats using matchms, when you need to ensure that metadata fields (e.
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
6.5 KB, 983 tokens by cl100k_base, as published. Nobody here has run it
spectrum-metadata-validation
Summary
Validate and normalize mass spectrometry spectrum metadata fields against schema requirements to ensure data accuracy and integrity after importing raw spectral data. This skill applies matchms metadata cleaning and validation tools to normalize field values, standardize naming conventions, and flag or remove invalid entries before downstream analysis.
When to use
After importing raw mass spectrometry data from mzML, mzXML, msp, MGF, or JSON formats using matchms, when you need to ensure that metadata fields (e.g., precursor m/z, compound name, ionization mode) conform to expected schema requirements and are free of inconsistencies, missing values, or malformed entries that could corrupt similarity comparisons or library searches.
When NOT to use
- Spectra that have already undergone metadata validation and cleaning in an upstream pipeline—re-validating may introduce redundant computation.
- Use cases where raw, unvalidated metadata must be preserved exactly as recorded for audit or regulatory compliance (prefer data flagging over transformation).
- When metadata is intentionally sparse or schema-agnostic (e.g., exploratory mass spectrometry studies with heterogeneous instrument outputs).
Inputs
- Raw mass spectrometry spectra in mzML, mzXML, msp, MGF, or JSON format
- Imported Spectrum objects with unvalidated metadata fields
- Schema specification or validation rules for expected metadata structure
Outputs
- Validated and normalized Spectrum objects with cleaned metadata
- Cleaned spectrum dataset in original or preferred matchms format
- Validation report documenting metadata transformations and failures
How to apply
Load imported spectra using matchms import utilities, then apply matchms metadata cleaning functions to normalize field values and standardize naming conventions across the dataset. Next, validate cleaned metadata fields against matchms schema requirements using the library's validation logic. Run pytest on any custom validation code to confirm that existing tests pass and validation logic is sound. Document all metadata transformations, null values, and validation failures in a structured validation report. Finally, output the cleaned spectrum dataset with validated metadata in the original or preferred matchms format (mzML, mzXML, msp, MGF, or JSON), ensuring data integrity for downstream spectral similarity measures and comparisons.
Related tools
- matchms (Primary library providing metadata cleaning functions, validation schema, and import utilities for mass spectrometry data) — https://github.com/matchms/matchms
- pytest (Testing framework for verifying that custom validation logic and existing tests pass)
- poetry (Dependency and version management for matchms development and contribution workflows)
Examples
from matchms.importing_utils import load_from_mgf; from matchms import Spectrum; spectra = load_from_mgf('raw_spectra.mgf'); import pytest; pytest.main(['-v', 'test_metadata_validation.py'])
Evaluation signals
- All spectrum metadata fields conform to matchms schema requirements with no schema violations reported
- Pytest test suite runs without errors and all existing validation tests pass
- Validation report shows zero or documented number of invalid entries (e.g., null precursor m/z, malformed compound names, out-of-range retention times)
- Metadata normalization is traceable: field transformations and flagged entries are recorded in the validation report
- Output spectra retain or improve data integrity when used in downstream spectral similarity computations (e.g., no crashes or unexpected null scores due to malformed metadata)
Limitations
- Metadata validation is schema-dependent; if the schema is incomplete or does not match the user's data model, valid spectra may be incorrectly flagged or rejected.
- Normalization and transformation of metadata values (e.g., standardizing compound name capitalization or ionization mode labels) may discard or alter original provenance information if not carefully logged.
- Sparse or highly heterogeneous metadata across large spectral libraries may require custom validation rules beyond matchms' built-in tools, requiring extension via custom code.
- Validation performance may degrade on very large spectral libraries (hundreds of thousands of spectra) if schema checks are computationally expensive.
Evidence
- [other] matchms provides metadata cleaning and validation tools: "Matchms offers an array of tools for metadata cleaning and validation, alongside basic peak filtering, to ensure data accuracy and integrity"
- [readme] Supported spectral data formats: "The software supports a range of popular spectral data formats, including mzML, mzXML, msp, metabolomics-USI, MGF, and JSON"
- [other] Workflow includes schema validation after cleaning: "Validate cleaned metadata fields against matchms schema requirements to ensure data accuracy and integrity"
- [other] pytest is used to verify validation logic: "Run pytest on custom validation logic to verify existing tests pass"
- [other] Documentation and reporting of transformations: "Document any metadata transformations and validation failures in a validation report"
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.