본문으로 건너뛰기
Skillpedia
분석 및 스프레드시트51k · #3495

matchms

하는 일

Matchms는 질량 분석 데이터를 정리하고 비교하도록 돕습니다. 질량 분석 파일을 정리하고, 처리하고, 검색해 서로 간의 유사점을 찾습니다.

사용하는 경우

  • ✓알려지지 않은 스펙트럼을 알려진 스펙트럼 라이브러리와 비교할 때.
  • ✓서로 다른 출처의 질량 분석 데이터를 정리하고 표준화할 때.
  • ✓질량 스펙트럼을 바탕으로 비슷한 분자를 찾을 때.

스킬 링크

https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/matchms/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/matchms/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 질량 스펙트럼을 제 라이브러리와 비교해, 어떤 화합물이 가장 비슷한지 알려 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

Matchms는 질량 스펙트럼 파일을 읽고, 데이터를 정리하고 표준화하는 규칙을 적용한 뒤, 알고리즘으로 스펙트럼끼리 얼마나 비슷한지 계산합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

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:

uv pip install "matchms==0.33.1"

Verify the runtime:

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 and units, preprocessing, score name, number of matched peaks when available, and candidate metadata. The cosine-family tolerance is an absolute m/z window in Da, not ppm; a precursor filter with tolerance_type="ppm" does not change fragment tolerance.
  8. Validate top hits visually and chemically. Use mirror plots, precursor agreement, ion/adduct compatibility, and orthogonal evidence.

Current API Guardrails

These points prevent the most common failures from pre-0.33 examples:

  • Use ModifiedCosineGreedy or ModifiedCosineHungarian; ModifiedCosine was removed in 0.32.0.
  • Do not call add_losses(). It was removed in 0.27.0; use spectrum.losses, spectrum.compute_losses(...), or NeutralLossesCosine directly.
  • SpectrumProcessor is not callable. Use process_spectrum() or process_spectra(). The single-spectrum call mutates by default; pass a clone when preserving the original.
  • process_spectra() returns (processed_spectra, processing_report).
  • Scores.scores is a StackedSparseArray, often with separate structured fields such as CosineGreedy_score and CosineGreedy_matches.
  • scores_by_query() returns (reference_spectrum, score_record) pairs, not reference indices.
  • Prefer spectra in parameter names. The legacy spelling spectrums is deprecated.
  • Never load pickle files from an untrusted source; unpickling can execute code.

See references/migration.md for a complete old-to-current mapping.

Quick Start: Clean and Search a Library

from math import isfinite

from matchms import SpectrumProcessor, calculate_scores
from matchms.filtering import (
    default_filters,
    normalize_intensities,
    require_minimum_number_of_peaks,
    require_precursor_mz,
    select_by_relative_intensity,
)
from matchms.importing import load_spectra
from matchms.similarity import ModifiedCosineGreedy


def load_and_process(path):
    spectra = [default_filters(spectrum) for spectrum in load_spectra(path)]
    processor = SpectrumProcessor(
        [
            (require_precursor_mz, {"minimum_accepted_mz": 10.0}),
            normalize_intensities,

…
자주 묻는 질문

질량 스펙트럼이란 무엇인가요?

분자가 어떤 조각으로 쪼개지고 각 조각이 얼마나 강하게 나타나는지 보여 주는, 분자의 ‘지문’과 같습니다.

‘메타데이터 조화(metadata harmonization)’란 무엇인가요?

스펙트럼 파일에 들어 있는 부가 정보(화합물 이름, 화학식 등)를 일관되고 표준화된 방식으로 작성하도록 맞추는 것입니다.

Matchms로 화합물을 자동으로 식별할 수 있나요?

Matchms는 비슷한 화합물을 찾는 데 도움을 주지만, 최종 식별은 다른 방법으로 확인해야 합니다. 이는 결정적 증거가 아니라 근거를 제공합니다.

상세 정보

작성자의 원본 설명

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.

repo: K-Dense-AI/scientific-agent-skills

인기도

GitHub 스타
51k
순위
#3495
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬