matchms

Compute cosine and modified cosine similarity scores for mass spectra in metabolomics.

1|Updated Nov 30, 2025
One-click install
npx skills add https://github.com/MAF2414/kyco --skill matchms-maf2414
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: matchms
Source: https://github.com/MAF2414/kyco/tree/main/.claude/skills/matchms
Command: npx skills add https://github.com/MAF2414/kyco --skill matchms-maf2414

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Mass spectrometry workflows often require robust, reproducible processing, comparison, and identification of spectra across libraries. Matchms provides a Python toolkit to import, standardize, filter, and compare spectra, enabling reliable compound identification from spectral data.

Core Features & Use Cases

  • Importing and exporting spectra in multiple formats (mgf, mzML, json)
  • Spectrum filtering, metadata harmonization, and quality control
  • Calculating spectral similarities (CosineGreedy, ModifiedCosine, NeutralLossesCosine) and matching against libraries
  • Building reproducible processing pipelines and deriving chemical information from spectra

Quick Start

Process a small example dataset by loading spectra, applying default filters, and computing cosine similarity against a reference spectrum.

Frequently Asked Questions about matchms

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I identify compounds in mass spectrometry data using spectral matching?

Spectral matching identifies compounds by computing similarity scores between your mass spectra and reference libraries. This Skill applies cosine and modified cosine similarity metrics to match unknown spectra against known standards for compound identification.

What mass spectrometry file formats can I import for metabolomics spectral matching?

You can import mass spectrometry data in MGF, mzML, and JSON formats for spectral matching. The toolkit standardizes imported spectra through metadata harmonization and filtering before computing similarity scores against reference libraries.

What is the difference between cosine and modified cosine similarity for spectral matching?

Cosine similarity matches mass spectra based on shared mass-to-charge ratios and intensities, while modified cosine similarity accommodates precursor mass differences. This Skill supports both metrics, alongside neutral losses cosine, for flexible compound identification.

Does this spectral matching approach require Python to process metabolomics workflows?

Yes, spectral matching for metabolomics workflows requires Python and the matchms library to function. It leverages Python to import, filter, and compare mass spectra against reference libraries for compound identification.

How do I build a reproducible pipeline for mass spectrometry spectrum filtering and library search?

Build reproducible pipelines by loading spectra from MGF or mzML files, applying default quality control filters for metadata harmonization, and computing similarity scores against reference libraries to derive chemical information.

When do I need neutral losses cosine similarity for metabolomics compound identification?

Neutral losses cosine similarity is needed when identifying compounds based on characteristic mass losses rather than direct fragment matches. This Skill includes this metric alongside standard and modified cosine methods for comprehensive library matching.