matchms — community matchms, scientific-research, community, ide skills, Claude Code, Cursor, Windsurf

v1.0.0
GitHub

About this Skill

Perfect for Scientific Analysis Agents needing advanced mass spectrometry data processing capabilities. Scientific Research

sanand0 sanand0
[0]
[0]
Updated: 3/5/2026

Agent Capability Analysis

The matchms skill by sanand0 is an open-source community AI agent skill for Claude Code and other IDE workflows, helping agents execute tasks with better context, repeatability, and domain-specific guidance.

Ideal Agent Persona

Perfect for Scientific Analysis Agents needing advanced mass spectrometry data processing capabilities.

Core Value

Empowers agents to import and export mass spectrometry data from various formats such as MGF, MZML, and MSP, calculate spectral similarities, and build reproducible analytical workflows using the matchms Python library.

Capabilities Granted for matchms

Importing mass spectrometry data from MGF files for peak filtering
Calculating spectral similarities for metabolomics research
Building reproducible analytical workflows for proteomics studies

! Prerequisites & Limits

  • Requires Python environment
  • Limited to mass spectrometry data formats
  • Dependent on matchms library updates for new features and bug fixes
Labs Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

matchms

Install matchms, an AI agent skill for AI agent workflows and automation. Works with Claude Code, Cursor, and Windsurf with one-command setup.

SKILL.md
Readonly

Matchms

Overview

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.

Core Capabilities

1. Importing and Exporting Mass Spectrometry Data

Load spectra from multiple file formats and export processed data:

python
1from matchms.importing import load_from_mgf, load_from_mzml, load_from_msp, load_from_json 2from matchms.exporting import save_as_mgf, save_as_msp, save_as_json 3 4# Import spectra 5spectra = list(load_from_mgf("spectra.mgf")) 6spectra = list(load_from_mzml("data.mzML")) 7spectra = list(load_from_msp("library.msp")) 8 9# Export processed spectra 10save_as_mgf(spectra, "output.mgf") 11save_as_json(spectra, "output.json")

Supported formats:

  • mzML and mzXML (raw mass spectrometry formats)
  • MGF (Mascot Generic Format)
  • MSP (spectral library format)
  • JSON (GNPS-compatible)
  • metabolomics-USI references
  • Pickle (Python serialization)

For detailed importing/exporting documentation, consult references/importing_exporting.md.

2. Spectrum Filtering and Processing

Apply comprehensive filters to standardize metadata and refine peak data:

python
1from matchms.filtering import default_filters, normalize_intensities 2from matchms.filtering import select_by_relative_intensity, require_minimum_number_of_peaks 3 4# Apply default metadata harmonization filters 5spectrum = default_filters(spectrum) 6 7# Normalize peak intensities 8spectrum = normalize_intensities(spectrum) 9 10# Filter peaks by relative intensity 11spectrum = select_by_relative_intensity(spectrum, intensity_from=0.01, intensity_to=1.0) 12 13# Require minimum peaks 14spectrum = require_minimum_number_of_peaks(spectrum, n_required=5)

Filter categories:

  • Metadata processing: Harmonize compound names, derive chemical structures, standardize adducts, correct charges
  • Peak filtering: Normalize intensities, select by m/z or intensity, remove precursor peaks
  • Quality control: Require minimum peaks, validate precursor m/z, ensure metadata completeness
  • Chemical annotation: Add fingerprints, derive InChI/SMILES, repair structural mismatches

Matchms provides 40+ filters. For the complete filter reference, consult references/filtering.md.

3. Calculating Spectral Similarities

Compare spectra using various similarity metrics:

python
1from matchms import calculate_scores 2from matchms.similarity import CosineGreedy, ModifiedCosine, CosineHungarian 3 4# Calculate cosine similarity (fast, greedy algorithm) 5scores = calculate_scores(references=library_spectra, 6 queries=query_spectra, 7 similarity_function=CosineGreedy()) 8 9# Calculate modified cosine (accounts for precursor m/z differences) 10scores = calculate_scores(references=library_spectra, 11 queries=query_spectra, 12 similarity_function=ModifiedCosine(tolerance=0.1)) 13 14# Get best matches 15best_matches = scores.scores_by_query(query_spectra[0], sort=True)[:10]

Available similarity functions:

  • CosineGreedy/CosineHungarian: Peak-based cosine similarity with different matching algorithms
  • ModifiedCosine: Cosine similarity accounting for precursor mass differences
  • NeutralLossesCosine: Similarity based on neutral loss patterns
  • FingerprintSimilarity: Molecular structure similarity using fingerprints
  • MetadataMatch: Compare user-defined metadata fields
  • PrecursorMzMatch/ParentMassMatch: Simple mass-based filtering

For detailed similarity function documentation, consult references/similarity.md.

4. Building Processing Pipelines

Create reproducible, multi-step analysis workflows:

python
1from matchms import SpectrumProcessor 2from matchms.filtering import default_filters, normalize_intensities 3from matchms.filtering import select_by_relative_intensity, remove_peaks_around_precursor_mz 4 5# Define a processing pipeline 6processor = SpectrumProcessor([ 7 default_filters, 8 normalize_intensities, 9 lambda s: select_by_relative_intensity(s, intensity_from=0.01), 10 lambda s: remove_peaks_around_precursor_mz(s, mz_tolerance=17) 11]) 12 13# Apply to all spectra 14processed_spectra = [processor(s) for s in spectra]

5. Working with Spectrum Objects

The core Spectrum class contains mass spectral data:

python
1from matchms import Spectrum 2import numpy as np 3 4# Create a spectrum 5mz = np.array([100.0, 150.0, 200.0, 250.0]) 6intensities = np.array([0.1, 0.5, 0.9, 0.3]) 7metadata = {"precursor_mz": 250.5, "ionmode": "positive"} 8 9spectrum = Spectrum(mz=mz, intensities=intensities, metadata=metadata) 10 11# Access spectrum properties 12print(spectrum.peaks.mz) # m/z values 13print(spectrum.peaks.intensities) # Intensity values 14print(spectrum.get("precursor_mz")) # Metadata field 15 16# Visualize spectra 17spectrum.plot() 18spectrum.plot_against(reference_spectrum)

6. Metadata Management

Standardize and harmonize spectrum metadata:

python
1# Metadata is automatically harmonized 2spectrum.set("Precursor_mz", 250.5) # Gets harmonized to lowercase key 3print(spectrum.get("precursor_mz")) # Returns 250.5 4 5# Derive chemical information 6from matchms.filtering import derive_inchi_from_smiles, derive_inchikey_from_inchi 7from matchms.filtering import add_fingerprint 8 9spectrum = derive_inchi_from_smiles(spectrum) 10spectrum = derive_inchikey_from_inchi(spectrum) 11spectrum = add_fingerprint(spectrum, fingerprint_type="morgan", nbits=2048)

Common Workflows

For typical mass spectrometry analysis workflows, including:

  • Loading and preprocessing spectral libraries
  • Matching unknown spectra against reference libraries
  • Quality filtering and data cleaning
  • Large-scale similarity comparisons
  • Network-based spectral clustering

Consult references/workflows.md for detailed examples.

Installation

bash
1uv pip install matchms

For molecular structure processing (SMILES, InChI):

bash
1uv pip install matchms[chemistry]

Reference Documentation

Detailed reference documentation is available in the references/ directory:

  • filtering.md - Complete filter function reference with descriptions
  • similarity.md - All similarity metrics and when to use them
  • importing_exporting.md - File format details and I/O operations
  • workflows.md - Common analysis patterns and examples

Load these references as needed for detailed information about specific matchms capabilities.

FAQ & Installation Steps

These questions and steps mirror the structured data on this page for better search understanding.

? Frequently Asked Questions

What is matchms?

Perfect for Scientific Analysis Agents needing advanced mass spectrometry data processing capabilities. Scientific Research

How do I install matchms?

Run the command: npx killer-skills add sanand0/scientific-research/matchms. It works with Cursor, Windsurf, VS Code, Claude Code, and 19+ other IDEs.

What are the use cases for matchms?

Key use cases include: Importing mass spectrometry data from MGF files for peak filtering, Calculating spectral similarities for metabolomics research, Building reproducible analytical workflows for proteomics studies.

Which IDEs are compatible with matchms?

This skill is compatible with Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer. Use the Killer-Skills CLI for universal one-command installation.

Are there any limitations for matchms?

Requires Python environment. Limited to mass spectrometry data formats. Dependent on matchms library updates for new features and bug fixes.

How To Install

  1. 1. Open your terminal

    Open the terminal or command line in your project directory.

  2. 2. Run the install command

    Run: npx killer-skills add sanand0/scientific-research/matchms. The CLI will automatically detect your IDE or AI agent and configure the skill.

  3. 3. Start using the skill

    The skill is now active. Your AI agent can use matchms immediately in the current project.

Related Skills

Looking for an alternative to matchms or another community skill for your workflow? Explore these related open-source skills.

View All

widget-generator

Logo of f
f

f.k.a. Awesome ChatGPT Prompts. Share, discover, and collect prompts from the community. Free and open source — self-host for your organization with complete privacy.

149.6k
0
AI

flags

Logo of vercel
vercel

flags is a Next.js feature management skill that enables developers to efficiently add or modify framework feature flags, streamlining React application development.

138.4k
0
Browser

zustand

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
AI

data-fetching

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
AI