matchms Mass Spectra Toolkit
A skill that guides loading, cleaning, comparing, and library-searching tandem mass spectra with matchms 0.33.1.
Data & AnalyticsAdvanced★ 33,030⑂ 3,248AI score 8/10Last updated: Aug 9, 2026
What it does
- Handles MS/MS I/O across MGF, MSP, mzML, mzXML, JSON, mzSpecLib, and metabolomics-USI sources.
- Builds preprocessing pipelines with
SpectrumProcessor: metadata harmonization, adduct/precursor handling, intensity normalization, and peak filters applied identically to queries and references. - Helps pick the right similarity metric (CosineGreedy, ModifiedCosineGreedy/Hungarian, NeutralLossesCosine, BlinkCosine, FlashSimilarity, fingerprint similarity) for the scientific question.
- Covers sparse score matrices, precursor-gated search, top-hit extraction, molecular similarity networks, and a bundled
scripts/library_search.pyCLI with CSV output. - Documents removed or renamed APIs (
ModifiedCosine,add_losses(),spectrums) so older tutorial code stops breaking.
Who it's for
- Metabolomics and natural-product researchers automating MS/MS library search.
- Anyone whose matchms scripts broke after upgrading past 0.27/0.32.
- Teams needing reproducible large-scale all-vs-all spectral comparisons or networks.
Examples
- "Search queries.mgf against library.msp with modified cosine and export the top 10 hits to CSV" → generates the CLI invocation or equivalent
calculate_scores()code. - "Build an all-vs-all similarity network from my 3,000 spectra" → script using
is_symmetric=True, sparse arrays, and a pair-count estimate first. - "Why does this example fail on
add_losses?" → migrates the code tocompute_losses()orNeutralLossesCosine.
· · · Install guide · · ·
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the skills/matchms folder from the GitHub repo K-Dense-AI/scientific-agent-skills into my ~/.claude/skills/matchms/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/K-Dense-AI/scientific-agent-skills.git /tmp/scientific-agent-skills && mkdir -p ~/.claude/skills && cp -r /tmp/scientific-agent-skills/skills/matchms ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal and clone the repo:
git clone https://github.com/K-Dense-AI/scientific-agent-skills.git - Create the skills directory:
mkdir -p ~/.claude/skills - Copy just this skill:
cp -r scientific-agent-skills/skills/matchms ~/.claude/skills/ - Make sure you have Python 3.10–3.14 and
uv, then install the pinned library:uv pip install "matchms==0.33.1" - Verify with
uv run python -c "import matchms; print(matchms.__version__)"— it should print 0.33.1. - Restart Claude Code and try a prompt like "use matchms to search my MGF queries against this MSP library".
View source on GitHub ↗License: MIT