Chuyển đến nội dung
Skillpedia
Phân tích và bảng tính51k · #3495

matchms

Skill này làm gì

Matchms giúp sắp xếp và so sánh dữ liệu khối phổ. Nó làm sạch, xử lý và tìm kiếm trong các tệp khối phổ để tìm điểm tương đồng giữa chúng.

Khi nào nên dùng

  • ✓So sánh một phổ chưa biết với thư viện các phổ đã biết.
  • ✓Làm sạch và chuẩn hóa dữ liệu khối phổ từ các nguồn khác nhau.
  • ✓Tìm các phân tử tương tự dựa trên phổ khối của chúng.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/matchms/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“So sánh phổ khối này với thư viện của tôi và cho biết những hợp chất nào giống nhất.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Matchms đọc các tệp phổ khối của bạn, áp dụng các quy tắc để làm sạch và chuẩn hóa dữ liệu, sau đó dùng thuật toán để tính mức độ giống nhau giữa các phổ.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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,

…
Câu hỏi thường gặp

Phổ khối là gì?

Phổ khối giống như “dấu vân tay” phân tử, cho thấy phân tử vỡ thành những mảnh nào và với cường độ ra sao.

“Hài hòa siêu dữ liệu” nghĩa là gì?

Nghĩa là đảm bảo thông tin bổ sung (như tên hợp chất, công thức) trong tệp phổ được ghi nhất quán và chuẩn hóa.

Tôi có thể dùng Matchms để nhận diện hợp chất tự động không?

Matchms giúp tìm các hợp chất tương tự, nhưng việc nhận diện cuối cùng cần xác nhận bằng phương pháp khác. Nó cung cấp bằng chứng, không phải chứng minh chắc chắn.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
51k
Vị trí xếp hạng
#3495
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự