pyopenms
できること
PyOpenMSは、質量分析データの解析を支援するツールです。プロテオミクスやメタボロミクスの情報を処理でき、化合物の同定や量の測定、ファイル形式の変換などを行えます。
使う場面
- ✓質量分析データがあり、その意味を知りたいとき。
- ✓複数のサンプルを比較して、どの化合物がどれくらい含まれているかを確認したいとき。
- ✓データを別のファイル形式に変換したいとき。
スキルのリンク
https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/pyopenms/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“この質量分析データファイルを解析して、含まれている化合物を教えてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
あらかじめ用意されたスクリプトを使ってデータを処理します。これらのスクリプトがピーク検出、分子の同定、量の計算などの作業を行います。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
PyOpenMS
Overview
PyOpenMS provides Python bindings to the OpenMS library for computational mass spectrometry, enabling analysis of proteomics and metabolomics data. Use it to read/write MS file formats, process raw spectra, detect and quantify features, identify peptides and proteins, and run end-to-end LC-MS/MS pipelines.
This skill ships ready-to-run scripts in scripts/ covering the most common
high-level workflows. Prefer running a script over writing new code—each is a
parameterized CLI tool that handles loading, processing, and export. Drop into the
Python API (and the references/) only when no script fits.
Installation
uv venv --python 3.13
uv pip install "pyopenms==3.6.0" pandas numpy matplotlib
Verify (note: __version__ works, but the bundled binary prints a one-line
memory-status notice on import that is harmless):
import pyopenms as ms
print(ms.__version__) # 3.6.0
Scripts (start here)
Run with python scripts/<name>.py --help for full options. Input formats differ by script; inspect its help. Commands below run from the skill
directory with the environment activated. Native regression tests use tiny synthetic
files; instrument-specific detection/search performance is not validated.
Inspect & convert
| Script | What it does |
|---|---|
inspect_ms_data.py |
Summarize any mzML/mzXML/featureXML/consensusXML/idXML (counts, RT/m/z ranges, TIC, metadata); optional per-spectrum CSV. |
convert_format.py |
Convert between mzML/mzXML/MGF with optional MS-level, RT, and intensity filtering. |
process_spectra.py |
Configurable signal-processing chain: smoothing (Gauss/SGolay), centroiding (PeakPickerHiRes), normalization, S/N and intensity thresholds. |
Feature detection & quantification
| Script | What it does |
|---|---|
detect_features_metabo.py |
Untargeted metabolomics feature finding: MassTraceDetection → ElutionPeakDetection → FeatureFindingMetabo. |
detect_features_centroided.py |
Peptide/centroided feature detection via FeatureFinderAlgorithmPicked. |
align_link_quantify.py |
Multi-sample pipeline: detect (or load) features → RT alignment → consensus linking → quant matrix CSV. |
consensus_to_matrix.py |
consensusXML → wide intensity matrix + metadata, with optional median/quantile normalization and long format. |
Annotation
| Script | What it does |
|---|---|
detect_adducts.py |
Group adducts/charge variants of the same neutral mass (MetaboliteFeatureDeconvolution). |
accurate_mass_search.py |
Annotate features against local formula/structure TSVs by accurate mass (AccurateMassSearchEngine → mzTab/CSV). |
export_gnps_sirius.py |
Export GNPS FBMN inputs (MGF + quant table) or a SIRIUS .ms file. |
Identification
| Script | What it does |
|---|---|
process_identifications.py |
Re-index against FASTA, estimate FDR/q-values, filter (FDR/length/best-per-spectrum), export idXML + CSV. |
Chemistry
| Script | What it does |
|---|---|
mass_calculator.py |
Monoisotopic/average mass, charged m/z, formula, and isotope pattern for peptides or empirical formulas. |
digest_protein.py |
In-silico protease digestion of FASTA/sequence → theoretical peptides with masses and m/z. |
theoretical_spectrum.py |
Generate annotated theoretical fragment spectra (b/y/a/c/x/z, losses) for a peptide. |
Targeted & visualization
| Script | What it does |
|---|---|
extract_chromatograms.py |
Build TIC/BPC and XIC traces for target m/z (CSV + optional plot). |
plot_ms_data.py |
Quick plots: single spectrum, TIC, 2D feature map, MS1 signal map. |
Common script recipes
# Inspect a file
python scripts/inspect_ms_data.py sample.mzML --spectra-csv spectra.csv
# Untargeted metabolomics: features for one sample
python scripts/detect_features_metabo.py sample.mzML --out-csv features.csv
# Full multi-sample quantification study
python scripts/align_link_quantify.py s1.mzML s2.mzML s3.mzML --out-prefix study
python scripts/consensus_to_matrix.py study.consensusXML --out quant.csv --normalize median
# Peptide chemistry
python scripts/mass_calculator.py --peptide "PEPTIDEM(Oxidation)K" --charges 1 2 3 --isotopes 5
python scripts/digest_protein.py proteins.fasta --enzyme Trypsin --missed 2 --out peptides.csv
# Identification post-processing
…
よくある質問
質量分析とは何ですか?
試料中の分子の質量を測定し、物質の同定や定量を行う実験技術です。
プロテオミクスとメタボロミクスとは何ですか?
プロテオミクスは生物内のタンパク質を研究する分野で、メタボロミクスは低分子(代謝物)を研究する分野です。
このツールはどのデータファイル形式に対応していますか?
mzML、mzXML、MGFなど、一般的な形式にいくつか対応しています。
詳細
作者による元の説明
Processes mass spectrometry data with pyOpenMS. Supports proteomics and metabolomics workflows—feature detection, peptide/protein identification, label-free quantification, adduct/accurate-mass annotation, and complex LC-MS/MS pipelines. Supports extensive file formats and algorithms. For simple spectral comparison and small-molecule library matching use matchms.
人気
- GitHubのスター
- 51k
- ランキング
- #3545
- ライセンス
- MIT
- 更新日
- 2026/10/15
コメント
- …
このリポジトリの他のスキル
13c-metabolic-flux
51k炭素13同位体トレーシングのデータを使って代謝フラックスを推定します。細胞の代謝や生化学経路の分析に役立ちます。
adaptyv
51kAdaptyv APIを使ってタンパク質の特性評価実験を設計します。コストの見積もり、配列の提出、ラボの結果の監視を支援します。
aeon
51k時系列データに対して機械学習のタスクを実行します。逐次データの分類、予測、異常検知、パターンの発見に役立ちます。
alphagenome
51k遺伝的変異に対して、事前に計算されたゲノム上の効果を検索します。スコアと説明を提供し、変異がゲノムに与える影響を理解するのに役立ちます。
似ているスキル
gitcrawl
394k保存されたGitHubのイシューとプルリクエストのアーカイブを検索し、重複をまとめ、GitHub上の現在の状態を確認するようエージェントを支援します。
slacrawl
394kローカルのSlackアーカイブ内のメッセージを検索して件数を数え、アーカイブの新しさを確認し、必要に応じて更新するようエージェントを支援します。
goplaces
394kGoogle Placesを使って、場所を検索し、詳細や口コミを取得し、場所の名前を解決するようエージェントを支援します。スクリプト用にJSON出力もできます。