SKILL.md--- name: matchms description: Processes, cleans, compares, and searches tandem mass spectra with matchms. Use for MS/MS file I/O, metadata harmonization, peak filtering, spectral similarity, library matching, score matrices, and molecular-similarity networks. Use pyopenms instead for LC-MS feature detection or proteomics pipelines. allowed-tools: Read Write Edit Bash license: Apache-2.0 compatibility: Requires Python >=3.10,<3.15, uv, and matchms 0.33.1. Local file workflows need no credentials; metabolomics-USI loading requires network access. metadata: version: "2.3" last-reviewed: "2026-10-01" skill-author: K-Dense Inc. --- # Matchms ## Purpose and Scope Matchms is a Python package for importing, cleaning, processing, and comparing tandem mass spectra. This skill targets **matchms 0.33.1**, released 2026-06-08, verified again on 2026-10-01. Older tutorials can use removed names; see the migration reference. Use matchms for: - MS/MS library search and query-versus-reference scoring - Metadata harmonization, adduct/precursor handling, and peak filtering - Cosine, modified-cosine, neutral-loss, approximate, and entropy scoring - Structured score matrices, top-hit extraction, and spectral networks - MGF, MSP, mzML, mzXML, JSON, mzSpecLib, and metabolomics-USI workflows Do not use matchms as a replacement for: - LC-MS feature detection, chromatographic alignment, peptide identification, or protein quantification — use pyopenms - Vendor raw-file conversion — convert to mzML/mzXML first - A validated compound-identification protocol — similarity is evidence, not proof of identity ## Install the Verified Release Create or activate an environment, then install the release used by this skill: ```bash uv pip install "matchms==0.33.1" ``` Verify the runtime: ```bash uv run python -c "import matchms; print(matchms.__version__)" ``` Matchms 0.33.1 supports Python 3.10-3.14 and installs RDKit as a regular dependency. The old `matchms[chemistry]` extra is not part of the current package metadata. ## Operating Workflow 1. **Inspect the inputs.** Record format, spectrum count, MS level, precursor coverage, ion mode, peak counts, and identifier fields. 2. **Load with metadata harmonization enabled** by default. Retain original files: disabling the flag in 0.33.1 still harmonizes metadata keys. 3. **Apply the same peak-processing steps** to query and reference spectra. Keep metadata enrichment separate when reference annotations are richer. 4. **Drop invalid spectra explicitly.** Many `require_*` filters return `None`. 5. **Choose the score from the scientific question**, not from convenience. Modified and neutral-loss scores require valid `precursor_mz`. 6. **Estimate `len(references) * len(queries)` before scoring.** A sparse result container does not automatically avoid computing every requested pair. 7. **Report score settings and evidence.** Include tolerance