‹ 首页

alterlab-pyopenms

@alterlab-ieu · 收录于 1 周前

Build complete mass-spectrometry workflows with pyOpenMS — feature detection, peptide identification, protein quantification, and full LC-MS/MS pipelines across many MS file formats (mzML, mzXML) and algorithms. Use for comprehensive proteomics and MS data processing — for simple spectral comparison and metabolite identification use matchms. Part of the AlterLab Academic Skills suite.

适合你,如果需要进行蛋白质组学或质谱数据的深度分析

/ 下载安装
alterlab-pyopenms.skill双击,或拖进 Claude 桌面版 / Cowork,即完成安装↓ .skill↓ .zip
用别的 agent?下载 .zip 解压,把文件夹放进它的技能目录
Claude Code~/.claude/skills/(项目级 .claude/skills/)
Codex CLI~/.codex/skills/
Cursor自动读取上面两处目录
其他工具见其文档的「skills」目录;两个下载是同一份文件,只是名字不同
/ 通过 npx 安装 校验哈希
npx oh-my-skill add alterlab-ieu/alterlab-academic-skills/alterlab-pyopenms
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- alterlab-ieu/alterlab-academic-skills/alterlab-pyopenms
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify alterlab-ieu/alterlab-academic-skills/alterlab-pyopenms
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
39GitHub stars
~1.4K最小装载
~15.1K含声明引用
~15.9K文本包总量
镜像托管

怎么用

技能原文 SKILL.md作者撰写 · MIT · a0064fd

PyOpenMS

Overview

PyOpenMS provides Python bindings to the OpenMS library for computational mass spectrometry, enabling analysis of proteomics and metabolomics data. Use for handling mass spectrometry file formats, processing spectral data, detecting features, identifying peptides/proteins, and performing quantitative analysis.

Installation

Install using uv (pyOpenMS 3.x — examples here are verified against 3.5):

uv pip install "pyopenms>=3.4"

Verify installation:

import pyopenms
print(pyopenms.__version__)
Version note: pyOpenMS 3.x removed the old FeatureFinder facade. Use FeatureFinderAlgorithmPicked (the former "centroided" algorithm) or, for metabolomics, the MassTraceDetectionElutionPeakDetectionFeatureFindingMetabo chain. See references/feature_detection.md.
Core Capabilities

PyOpenMS organizes functionality into these domains:

1. File I/O and Data Formats

Handle mass spectrometry file formats and convert between representations.

Supported formats: mzML, mzXML, TraML, mzTab, FASTA, pepXML, protXML, mzIdentML, featureXML, consensusXML, idXML

Basic file reading:

import pyopenms as ms

# Read mzML file
exp = ms.MSExperiment()
ms.MzMLFile().load("data.mzML", exp)

# Access spectra
for spectrum in exp:
    mz, intensity = spectrum.get_peaks()
    print(f"Spectrum: {len(mz)} peaks")

For detailed file handling: See references/file_io.md

2. Signal Processing

Process raw spectral data with smoothing, filtering, centroiding, and normalization.

Basic spectrum processing:

# Smooth spectrum with Gaussian filter
gaussian = ms.GaussFilter()
params = gaussian.getParameters()
params.setValue("gaussian_width", 0.1)
gaussian.setParameters(params)
gaussian.filterExperiment(exp)

For algorithm details: See references/signal_processing.md

3. Feature Detection

Detect and link features across spectra and samples for quantitative analysis.

# Detect features in centroided data (pyOpenMS 3.x API)
ff = ms.FeatureFinderAlgorithmPicked()
params = ff.getParameters()          # defaults for the "centroided" algorithm
ff.setParameters(params)

features = ms.FeatureMap()
seeds = ms.FeatureMap()              # empty seeds = detect de novo
ff.run(exp, features, params, seeds)

For complete workflows: See references/feature_detection.md

4. Peptide and Protein Identification

Integrate with search engines and process identification results.

Supported engines: Comet, Mascot, MSGFPlus, XTandem, OMSSA, Myrimatch

Basic identification workflow:

# Load identification data.
# pyOpenMS 3.x: protein_ids is a plain list, peptide_ids MUST be a
# PeptideIdentificationList (a plain [] is rejected by load()).
protein_ids = []
peptide_ids = ms.PeptideIdentificationList()
ms.IdXMLFile().load("identifications.idXML", protein_ids, peptide_ids)

# Compute q-values (target-decoy FDR), then filter at 1%.
# fdr.apply() requires target/decoy hits annotated with a 'target_decoy'
# meta value (run PeptideIndexer on a concatenated target-decoy search first).
fdr = ms.FalseDiscoveryRate()
fdr.apply(peptide_ids)               # rewrites scores to q-values (lower = better)
ms.IDFilter().filterHitsByScore(peptide_ids, 0.01)
ms.IDFilter().removeEmptyIdentifications(peptide_ids)

For detailed workflows: See references/identification.md

5. Metabolomics Analysis

Perform untargeted metabolomics preprocessing and analysis.

Typical workflow:

  1. Load and process raw data
  2. Detect features
  3. Align retention times across samples
  4. Link features to consensus map
  5. Annotate with compound databases

For complete metabolomics workflows: See references/metabolomics.md

Data Structures

PyOpenMS uses these primary objects:

  • MSExperiment: Collection of spectra and chromatograms
  • MSSpectrum: Single mass spectrum with m/z and intensity pairs
  • MSChromatogram: Chromatographic trace
  • Feature: Detected chromatographic peak with quality metrics
  • FeatureMap: Collection of features
  • PeptideIdentification: Search results for peptides
  • ProteinIdentification: Search results for proteins

For detailed documentation: See references/data_structures.md

Common Workflows
Quick Start: Load and Explore Data
import pyopenms as ms

# Load mzML file
exp = ms.MSExperiment()
ms.MzMLFile().load("sample.mzML", exp)

# Get basic statistics
print(f"Number of spectra: {exp.getNrSpectra()}")
print(f"Number of chromatograms: {exp.getNrChromatograms()}")

# Examine first spectrum
spec = exp.getSpectrum(0)
print(f"MS level: {spec.getMSLevel()}")
print(f"Retention time: {spec.getRT()}")
mz, intensity = spec.get_peaks()
print(f"Peaks: {len(mz)}")
Parameter Management

Most algorithms use a parameter system:

# Get algorithm parameters
algo = ms.GaussFilter()
params = algo.getParameters()

# View available parameters
for param in params.keys():
    print(f"{param}: {params.getValue(param)}")

# Modify parameters
params.setValue("gaussian_width", 0.2)
algo.setParameters(params)
Export to Pandas

Convert data to pandas DataFrames for analysis:

import pyopenms as ms
import pandas as pd

# Load feature map
fm = ms.FeatureMap()
ms.FeatureXMLFile().load("features.featureXML", fm)

# Convert to DataFrame
df = fm.get_df()
print(df.head())
Integration with Other Tools

PyOpenMS integrates with:

  • Pandas: Export data to DataFrames
  • NumPy: Work with peak arrays
  • Scikit-learn: Machine learning on MS data
  • Matplotlib/Seaborn: Visualization
  • R: Via rpy2 bridge
Resources
  • Official documentation: https://pyopenms.readthedocs.io
  • OpenMS documentation: https://www.openms.org
  • GitHub: https://github.com/OpenMS/OpenMS
References
  • references/file_io.md - Comprehensive file format handling
  • references/signal_processing.md - Signal processing algorithms
  • references/feature_detection.md - Feature detection and linking
  • references/identification.md - Peptide and protein identification
  • references/metabolomics.md - Metabolomics-specific workflows
  • references/data_structures.md - Core objects and data structures
按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。