Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
k-dense-ai avatar

Pyopenms

  • 831 installs
  • 32k repo stars
  • Updated July 29, 2026
  • k-dense-ai/scientific-agent-skills

pyopenms is a mass spectrometry skill that loads and inspects LC-MS experiments via PyOpenMS MSExperiment and MzMLFile APIs for developers working with mzML spectral data in agent sessions.

About

pyopenms is a skill from k-dense-ai/scientific-agent-skills covering PyOpenMS core data structures for LC-MS experiments. It shows creating an MSExperiment, loading mzML files with MzMLFile().load, and inspecting spectrum counts, chromatogram counts, retention-time ranges, and individual spectra. PyOpenMS exposes C++ mass-spec objects through Python bindings, so the skill emphasizes correct object usage for proteomics and metabolomics pipelines. Developers reach for pyopenms when agents must read mzML data, summarize experiment metadata, or manipulate spectra and chromatograms inside Claude, Cursor, or Codex workflows without leaving the coding session.

  • Native Python bindings to the OpenMS C++ library for LC-MS and proteomics data
  • Core containers: MSExperiment for full runs and MSSpectrum for individual scans
  • Direct mzML file loading with metadata extraction for instrument and experimental settings
  • Peak data access as numpy arrays for immediate analysis and visualization
  • Iterative spectrum filtering by MS level, retention time, and precursor properties

Pyopenms by the numbers

  • 831 all-time installs (skills.sh)
  • +37 installs in the week ending Jul 29, 2026 (Skillselion tracking)
  • Ranked #371 of 2,065 Data Science & ML skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Jul 29, 2026 (Skillselion catalog sync)
npx skills add https://github.com/k-dense-ai/scientific-agent-skills --skill pyopenms

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs831
repo stars32k
Security audit3 / 3 scanners passed
Last updatedJuly 29, 2026
Repositoryk-dense-ai/scientific-agent-skills

How do you load and inspect mzML data with PyOpenMS?

Load, inspect, and manipulate mass spectrometry data files directly inside Claude, Cursor or Codex agent sessions.

Who is it for?

Proteomics or metabolomics developers manipulating mzML LC-MS files with PyOpenMS inside AI coding agent sessions.

Skip if: RNA-seq single-cell analysis or small-molecule docking workflows unrelated to mass spectrometry mzML data.

When should I use this skill?

A developer loads mzML files, inspects MSExperiment spectra, or manipulates PyOpenMS LC-MS data structures in Python.

What you get

Loaded MSExperiment with spectrum and chromatogram counts, RT ranges, and accessible per-spectrum metadata from mzML input files.

  • loaded MSExperiment object
  • spectrum and chromatogram summary statistics

Files

SKILL.mdMarkdownGitHub ↗

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 pip install pyopenms

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.5.0

Scripts (start here)

Run with python scripts/<name>.py --help for full options. All accept standard MS file formats and write featureXML/consensusXML/CSV/mzTab/PNG as appropriate.

Inspect & convert

ScriptWhat it does
inspect_ms_data.pySummarize any mzML/mzXML/featureXML/consensusXML/idXML (counts, RT/m/z ranges, TIC, metadata); optional per-spectrum CSV.
convert_format.pyConvert between mzML/mzXML/MGF with optional MS-level, RT, and intensity filtering.
process_spectra.pyConfigurable signal-processing chain: smoothing (Gauss/SGolay), centroiding (PeakPickerHiRes), normalization, S/N and intensity thresholds.

Feature detection & quantification

ScriptWhat it does
detect_features_metabo.pyUntargeted metabolomics feature finding: MassTraceDetection → ElutionPeakDetection → FeatureFindingMetabo.
detect_features_centroided.pyPeptide/centroided feature detection via FeatureFinderAlgorithmPicked.
align_link_quantify.pyMulti-sample pipeline: detect (or load) features → RT alignment → consensus linking → quant matrix CSV.
consensus_to_matrix.pyconsensusXML → wide intensity matrix + metadata, with optional median/quantile normalization and long format.

Annotation

ScriptWhat it does
detect_adducts.pyGroup adducts/charge variants of the same neutral mass (MetaboliteFeatureDeconvolution).
accurate_mass_search.pyAnnotate features against HMDB by accurate mass (AccurateMassSearchEngine → mzTab/CSV).
export_gnps_sirius.pyExport GNPS FBMN inputs (MGF + quant table) or a SIRIUS .ms file.

Identification

ScriptWhat it does
process_identifications.pyRe-index against FASTA, estimate FDR/q-values, filter (FDR/length/best-per-spectrum), export idXML + CSV.

Chemistry

ScriptWhat it does
mass_calculator.pyMonoisotopic/average mass, charged m/z, formula, and isotope pattern for peptides or empirical formulas.
digest_protein.pyIn-silico protease digestion of FASTA/sequence → theoretical peptides with masses and m/z.
theoretical_spectrum.pyGenerate annotated theoretical fragment spectra (b/y/a/c/x/z, losses) for a peptide.

Targeted & visualization

ScriptWhat it does
extract_chromatograms.pyBuild TIC/BPC and XIC traces for target m/z (CSV + optional plot).
plot_ms_data.pyQuick 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
python scripts/process_identifications.py search.idXML --fasta db.fasta --fdr 0.01 --out filtered.idXML --csv hits.csv

Key 3.5.0 API notes

These changed from older OpenMS releases—older tutorials and code will break:

  • Feature finding: FeatureFinder("centroided") was removed. Use

FeatureFinderAlgorithmPicked (proteomics/centroided) or the MassTraceDetection → ElutionPeakDetection → FeatureFindingMetabo pipeline (metabolomics). See detect_features_*.py.

  • idXML I/O: IdXMLFile().load/store require a ms.PeptideIdentificationList()

for peptide IDs (a plain Python list raises "can not handle type"). Protein IDs remain a plain list.

  • Adduct decharging: the class is MetaboliteFeatureDeconvolution, and adducts

use Elements:Charge:Probability syntax (e.g. H:+:0.4, H-2O-1:0:0.05)—not bracket notation like [M+H]+.

  • DataFrame columns: FeatureMap.get_df() uses lowercase rt/mz (not RT).

ConsensusMap provides get_intensity_df() and get_metadata_df().

  • Bundled data caveat: the pip wheel ships HMDBMappingFile.tsv but not

HMDB2StructMapping.tsv; accurate_mass_search.py detects this and explains how to supply it.

Core data structures

  • MSExperiment – collection of spectra and chromatograms
  • MSSpectrum / MSChromatogram – a single spectrum / chromatographic trace
  • Feature / FeatureMap – a detected LC-MS peak / collection of features
  • ConsensusMap – features linked across samples (the quant table)
  • PeptideIdentification / ProteinIdentification – search results
  • AASequence / EmpiricalFormula – sequence and formula chemistry

For details: see references/data_structures.md.

Parameter management

Most algorithms expose an OpenMS Param object:

algo = ms.FeatureFindingMetabo()
p = algo.getDefaults()
for key in p.keys():
    print(key.decode(), "=", p.getValue(key), "|", p.getDescription(key))
p.setValue("charge_lower_bound", 1)
algo.setParameters(p)

Export to pandas

fm = ms.FeatureMap(); ms.FeatureXMLFile().load("features.featureXML", fm)
df = fm.get_df()             # columns include lowercase rt, mz, intensity, charge, quality

cm = ms.ConsensusMap(); ms.ConsensusXMLFile().load("study.consensusXML", cm)
intensities = cm.get_intensity_df()   # features x samples
metadata = cm.get_metadata_df()       # rt, mz, charge, quality, ...

Integration with other tools

Pandas (DataFrames), NumPy (peak arrays), scikit-learn (ML), Matplotlib/Seaborn (plots), and downstream tools via export: GNPS (FBMN), SIRIUS, and mzTab.

Resources

  • Official docs (3.5.0): https://pyopenms.readthedocs.io/en/release-3.5.0/
  • OpenMS: https://www.openms.org
  • GitHub: https://github.com/OpenMS/OpenMS

References

  • references/file_io.md – 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

Related skills

FAQ

How does pyopenms load LC-MS data?

pyopenms loads LC-MS data by creating an MSExperiment and calling MzMLFile().load on an mzML path. Developers then read spectrum counts, chromatogram counts, and retention-time ranges from the experiment object.

What file format does the pyopenms skill focus on?

The pyopenms skill focuses on mzML files loaded through PyOpenMS MzMLFile into MSExperiment containers. The workflow covers spectra, chromatograms, and per-spectrum retention-time inspection in Python.

Is Pyopenms safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

Data Science & MLagentsautomation

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.