matchms

Match unknown MS/MS spectra against reference libraries using similarity scoring.

783|65|Updated Feb 27, 2026
One-click install
npx skills add https://github.com/LeonChaoX/qinyan-academic-skills --skill matchms-leonchaox
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: matchms
Source: https://github.com/LeonChaoX/qinyan-academic-skills/tree/main/skills/06-%E5%8C%96%E5%AD%A6%E4%BF%A1%E6%81%AF%E4%B8%8E%E8%8D%AF%E7%89%A9%E5%8F%91%E7%8E%B0/matchms
Command: npx skills add https://github.com/LeonChaoX/qinyan-academic-skills --skill matchms-leonchaox

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you identify unknown metabolites by matching their MS/MS fragmentation patterns against reference spectral libraries.

Core Features & Use Cases

  • Spectral import & export: Load spectra from common formats (MGF, MSP, mzML/mzXML, JSON/GNPS) and save processed results for reuse.
  • Cleaning & metadata harmonization: Apply standardized filters (e.g., precursor m/z, retention info, adduct/formula/name cleanup) and peak quality control.
  • Similarity scoring & candidate ranking: Compute spectral similarity (cosine, modified cosine, neutral-loss cosine, etc.) to retrieve the best matches from libraries.
  • Optional enrichment: Derive chemical identifiers (InChI/InChIKey/SMILES) and compute molecular fingerprints for structural-aware matching.
  • Use Case: You have an LC-MS/MS run exported as MGF and a reference library (MGF or MSP). Use this Skill to preprocess both, calculate similarity, and output the top-ranked compound candidates per query spectrum.

Quick Start

Ask your agent to match the spectra in 'unknowns.mgf' against 'reference_library.mgf' using precursor-aware modified cosine similarity with a 0.1 m/z tolerance.

Frequently Asked Questions about matchms

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

FAQPage Schema
How do I match MS/MS spectra against a reference library to identify metabolites?

To match MS/MS spectra, you load query spectra and a reference library, standardize metadata, filter peaks, and compute similarity scores like CosineGreedy to rank candidate metabolites for identification.

What mass spectrometry file formats can I import for spectral library searching?

You can import mass spectrometry spectra from MGF, MSP, mzML, mzXML, and JSON or GNPS formats to perform spectral matching and identify unknown metabolites from your data.

What is the difference between cosine greedy and modified cosine similarity for metabolomics?

Modified cosine similarity accounts for precursor m/z shifts during spectral matching, allowing you to identify metabolites even when precursor ions differ between query and reference spectra, unlike standard cosine greedy scoring.

Can I clean and harmonize MS/MS metadata before computing spectral similarity?

Yes, you can apply standardized filters to clean precursor m/z, retention information, adducts, formulas, and peak quality before computing spectral similarity scores for metabolite identification.

Do I need to derive chemical identifiers to perform spectral matching?

Deriving chemical identifiers like InChI, InChIKey, or SMILES is optional for structural-aware matching, but you can compute spectral similarity and rank metabolite candidates using fragmentation patterns alone.

What is the best way to preprocess LC-MS/MS data for compound identification?

The best way to preprocess LC-MS/MS data is to import spectra, apply metadata harmonization and peak filtering, normalize peaks, and calculate similarity scores against a reference library to rank compound candidates.