If you're working with mass spectrometry data in metabolomics or proteomics, this handles the grunt work of loading mzML, MGF, and MSP files, cleaning up messy metadata, and running spectral similarity calculations. The filtering pipeline is solid with 40+ functions for things like normalizing intensities, removing noise peaks, and harmonizing compound annotations. Spectral matching uses cosine similarity variants including modified cosine that accounts for precursor mass differences. The SpectrumProcessor lets you chain filters into reproducible workflows instead of writing the same boilerplate every time. It's Python native, open source, and frankly one of the better designed libraries in the computational mass spec space.
$ npx -y skills add davila7/claude-code-templates --skill matchms --agent claude-codeInstalls into .claude/skills of the current project.
Matchms is an open-source Python library for mass spectrometry data processing and analysis. Import spectra from various formats, standardize metadata, filter peaks, calculate spectral similarities, and build reproducible analytical workflows.
Load spectra from multiple file formats and export processed data:
from matchms.importing import load_from_mgf, load_from_mzml, load_from_msp, load_from_json
from matchms.exporting import save_as_mgf, save_as_msp, save_as_json
# Import spectra
spectra = list(load_from_mgf("spectra.mgf"))
spectra = list(load_from_mzml("data.mzML"))
spectra = list(load_from_msp("library.msp"))
# Export processed spectra
save_as_mgf(spectra, "output.mgf")
save_as_json(spectra, "output.json")
Supported formats:
For detailed importing/exporting documentation, consult references/importing_exporting.md.
Sponsors