
Pyopenms
- 36 installs
- 16 repo stars
- Updated November 20, 2025
- jackspace/claudeskillz
Process LC-MS/MS proteomics and metabolomics data with pyOpenMS, including file handling, feature detection, and peptide identification.
About
PyOpenMS is a Python interface to OpenMS for mass spectrometry data analysis. Developers use it for LC-MS/MS proteomics and metabolomics workflows spanning signal processing, feature detection, and quantification.
- Handles mzML, mzXML, mzTab, FASTA, pepXML, and mzIdentML formats
- Covers signal processing, feature detection, and peptide identification
Pyopenms by the numbers
- 36 all-time installs (skills.sh)
- Ranked #1,041 of 2,065 Data Science & ML skills by installs in the Skillselion catalog
- Data as of Aug 2, 2026 (Skillselion catalog sync)
npx skills add https://github.com/jackspace/claudeskillz --skill pyopenmsAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 36 |
|---|---|
| repo stars | ★ 16 |
| Last updated | November 20, 2025 |
| Repository | jackspace/claudeskillz ↗ |
What it does
Process LC-MS/MS proteomics and metabolomics data with pyOpenMS, including file handling, feature detection, and peptide identification.
Files
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:
uv pip install pyopenmsVerify installation:
import pyopenms
print(pyopenms.__version__)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
ff = ms.FeatureFinder()
ff.run("centroided", exp, features, params, ms.FeatureMap())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
protein_ids = []
peptide_ids = []
ms.IdXMLFile().load("identifications.idXML", protein_ids, peptide_ids)
# Apply FDR filtering
fdr = ms.FalseDiscoveryRate()
fdr.apply(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 handlingreferences/signal_processing.md- Signal processing algorithmsreferences/feature_detection.md- Feature detection and linkingreferences/identification.md- Peptide and protein identificationreferences/metabolomics.md- Metabolomics-specific workflowsreferences/data_structures.md- Core objects and data structures
{
"description": "Python interface to OpenMS for mass spectrometry data analysis. Use for LC-MS/MS proteomics and metabolomics workflows including file handling (mzML, mzXML, mzTab, FASTA, pepXML, protXML, mzIdentML), signal processing, feature detection, peptide identification, and quantitative analysis. Apply when working with mass spectrometry data, analyzing proteomics experiments, or processing metabolomics datasets.",
"references": {
"files": [
"references/data_structures.md",
"references/feature_detection.md",
"references/file_io.md",
"references/identification.md",
"references/metabolomics.md",
"references/signal_processing.md"
]
},
"content": "PyOpenMS organizes functionality into these domains:\r\n\r\n### 1. File I/O and Data Formats\r\n\r\nHandle mass spectrometry file formats and convert between representations.\r\n\r\n**Supported formats**: mzML, mzXML, TraML, mzTab, FASTA, pepXML, protXML, mzIdentML, featureXML, consensusXML, idXML\r\n\r\nBasic file reading:\r\n\r\n```python\r\nimport pyopenms as ms\r\n\r\nexp = ms.MSExperiment()\r\nms.MzMLFile().load(\"data.mzML\", exp)\r\n\r\nfor spectrum in exp:\r\n mz, intensity = spectrum.get_peaks()\r\n print(f\"Spectrum: {len(mz)} peaks\")\r\n```\r\n\r\n**For detailed file handling**: See `references/file_io.md`\r\n\r\n### 2. Signal Processing\r\n\r\nProcess raw spectral data with smoothing, filtering, centroiding, and normalization.\r\n\r\nBasic spectrum processing:\r\n\r\n```python\r\ngaussian = ms.GaussFilter()\r\nparams = gaussian.getParameters()\r\nparams.setValue(\"gaussian_width\", 0.1)\r\ngaussian.setParameters(params)\r\ngaussian.filterExperiment(exp)\r\n```\r\n\r\n**For algorithm details**: See `references/signal_processing.md`\r\n\r\n### 3. Feature Detection\r\n\r\nDetect and link features across spectra and samples for quantitative analysis.\r\n\r\n```python\r\nff = ms.FeatureFinder()\r\nff.run(\"centroided\", exp, features, params, ms.FeatureMap())\r\n```\r\n\r\n**For complete workflows**: See `references/feature_detection.md`\r\n\r\n### 4. Peptide and Protein Identification\r\n\r\nIntegrate with search engines and process identification results.\r\n\r\n**Supported engines**: Comet, Mascot, MSGFPlus, XTandem, OMSSA, Myrimatch\r\n\r\nBasic identification workflow:\r\n\r\n```python\r\nprotein_ids = []\r\npeptide_ids = []\r\nms.IdXMLFile().load(\"identifications.idXML\", protein_ids, peptide_ids)\r\n\r\n\r\n### Quick Start: Load and Explore Data\r\n\r\n```python\r\nimport pyopenms as ms\r\n\r\nexp = ms.MSExperiment()\r\nms.MzMLFile().load(\"sample.mzML\", exp)\r\n\r\nprint(f\"Number of spectra: {exp.getNrSpectra()}\")\r\nprint(f\"Number of chromatograms: {exp.getNrChromatograms()}\")\r\n\r\nspec = exp.getSpectrum(0)\r\nprint(f\"MS level: {spec.getMSLevel()}\")\r\nprint(f\"Retention time: {spec.getRT()}\")\r\nmz, intensity = spec.get_peaks()\r\nprint(f\"Peaks: {len(mz)}\")\r\n```\r\n\r\n### Parameter Management\r\n\r\nMost algorithms use a parameter system:\r\n\r\n```python\r\nalgo = ms.GaussFilter()\r\nparams = algo.getParameters()\r\n\r\nfor param in params.keys():\r\n print(f\"{param}: {params.getValue(param)}\")\r\n\r\nparams.setValue(\"gaussian_width\", 0.2)\r\nalgo.setParameters(params)\r\n```\r\n\r\n### Export to Pandas\r\n\r\nConvert data to pandas DataFrames for analysis:\r\n\r\n```python\r\nimport pyopenms as ms\r\nimport pandas as pd\r\n\r\nfm = ms.FeatureMap()\r\nms.FeatureXMLFile().load(\"features.featureXML\", fm)",
"name": "pyopenms",
"id": "scientific-pkg-pyopenms",
"sections": {
"Installation": "Install using uv:\r\n\r\n```bash\r\nuv pip install pyopenms\r\n```\r\n\r\nVerify installation:\r\n\r\n```python\r\nimport pyopenms\r\nprint(pyopenms.__version__)\r\n```",
"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.",
"Integration with Other Tools": "PyOpenMS integrates with:\r\n- **Pandas**: Export data to DataFrames\r\n- **NumPy**: Work with peak arrays\r\n- **Scikit-learn**: Machine learning on MS data\r\n- **Matplotlib/Seaborn**: Visualization\r\n- **R**: Via rpy2 bridge",
"Data Structures": "PyOpenMS uses these primary objects:\r\n\r\n- **MSExperiment**: Collection of spectra and chromatograms\r\n- **MSSpectrum**: Single mass spectrum with m/z and intensity pairs\r\n- **MSChromatogram**: Chromatographic trace\r\n- **Feature**: Detected chromatographic peak with quality metrics\r\n- **FeatureMap**: Collection of features\r\n- **PeptideIdentification**: Search results for peptides\r\n- **ProteinIdentification**: Search results for proteins\r\n\r\n**For detailed documentation**: See `references/data_structures.md`",
"Core Capabilities": "fdr = ms.FalseDiscoveryRate()\r\nfdr.apply(peptide_ids)\r\n```\r\n\r\n**For detailed workflows**: See `references/identification.md`\r\n\r\n### 5. Metabolomics Analysis\r\n\r\nPerform untargeted metabolomics preprocessing and analysis.\r\n\r\nTypical workflow:\r\n1. Load and process raw data\r\n2. Detect features\r\n3. Align retention times across samples\r\n4. Link features to consensus map\r\n5. Annotate with compound databases\r\n\r\n**For complete metabolomics workflows**: See `references/metabolomics.md`",
"Common Workflows": "df = fm.get_df()\r\nprint(df.head())\r\n```",
"Resources": "- **Official documentation**: https://pyopenms.readthedocs.io\r\n- **OpenMS documentation**: https://www.openms.org\r\n- **GitHub**: https://github.com/OpenMS/OpenMS",
"References": "- `references/file_io.md` - Comprehensive file format handling\r\n- `references/signal_processing.md` - Signal processing algorithms\r\n- `references/feature_detection.md` - Feature detection and linking\r\n- `references/identification.md` - Peptide and protein identification\r\n- `references/metabolomics.md` - Metabolomics-specific workflows\r\n- `references/data_structures.md` - Core objects and data structures"
}
}---
name: pyopenms
description: Python interface to OpenMS for mass spectrometry data analysis. Use for LC-MS/MS proteomics and metabolomics workflows including file handling (mzML, mzXML, mzTab, FASTA, pepXML, protXML, mzIdentML), signal processing, feature detection, peptide identification, and quantitative analysis. Apply when working with mass spectrometry data, analyzing proteomics experiments, or processing metabolomics datasets.
---
# 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:
```bash
uv pip install pyopenms
```
Verify installation:
```python
import pyopenms
print(pyopenms.__version__)
```
## 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:
```python
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:
```python
# 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.
```python
# Detect features
ff = ms.FeatureFinder()
ff.run("centroided", exp, features, params, ms.FeatureMap())
```
**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:
```python
# Load identification data
protein_ids = []
peptide_ids = []
ms.IdXMLFile().load("identifications.idXML", protein_ids, peptide_ids)
# Apply FDR filtering
fdr = ms.FalseDiscoveryRate()
fdr.apply(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
```python
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:
```python
# 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:
```python
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