K-Dense-AI/scientific-agent-skills / skills/pyopenms
pyopenms
VerifiedProcesses 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.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 12.2 KB |
| references/data_structures.md | markdown | 5.3 KB |
| references/feature_detection.md | markdown | 5.9 KB |
| references/file_io.md | markdown | 3.9 KB |
| references/identification.md | markdown | 5.4 KB |
| references/metabolomics.md | markdown | 6.0 KB |
| references/signal_processing.md | markdown | 5.7 KB |
| scripts/_common.py | script | 1.0 KB |
| scripts/accurate_mass_search.py | script | 3.7 KB |
| scripts/align_link_quantify.py | script | 5.9 KB |
| scripts/consensus_to_matrix.py | script | 2.7 KB |
| scripts/convert_format.py | script | 3.3 KB |
| scripts/detect_adducts.py | script | 3.9 KB |
| scripts/detect_features_centroided.py | script | 3.3 KB |
| scripts/detect_features_metabo.py | script | 4.3 KB |
| scripts/digest_protein.py | script | 3.6 KB |
| scripts/export_gnps_sirius.py | script | 4.2 KB |
| scripts/extract_chromatograms.py | script | 3.9 KB |
| scripts/inspect_ms_data.py | script | 5.8 KB |
| scripts/mass_calculator.py | script | 3.5 KB |
| scripts/plot_ms_data.py | script | 3.9 KB |
| scripts/process_identifications.py | script | 6.4 KB |
| scripts/process_spectra.py | script | 4.8 KB |
| scripts/theoretical_spectrum.py | script | 3.1 KB |
references/file_io.md
View on GitHub# File I/O (pyOpenMS 3.6.0)
The bundled scripts use local files; they do not fetch vendor data or databases.
Native tests cover tiny synthetic mzML, chromatogram, featureXML, consensusXML,
idXML, FASTA, MGF and local TSV examples. Instrument conversion, mzIdentML/pepXML,
TraML, and large-file throughput remain untested here.
## mzML and indexed access
```python
import pyopenms as ms
exp = ms.MSExperiment()
ms.MzMLFile().load("sample.mzML", exp)
print(exp.getNrSpectra(), exp.getNrChromatograms())
writer = ms.MzMLFile()
options = writer.getOptions()
options.setWriteIndex(True)
options.setCompression(True)
writer.setOptions(options)
writer.store("indexed.mzML", exp)
on_disk = ms.OnDiscMSExperiment()
if not on_disk.openFile("indexed.mzML"):
raise ValueError("An indexed mzML is required")
for i in range(on_disk.getNrSpectra()):
spec = on_disk.getSpectrum(i)
# RT is seconds; get_peaks() yields m/z and intensity arrays.
```
`IndexedMzMLFileLoader.load(filename, on_disk)` is an alternative loader; it
requires an `OnDiscMSExperiment` output argument. The loader itself is not a
spectrum container. Preserve a known indexed input for lazy reading; converting
an unindexed input via `MSExperiment` first still loads the full input in memory.
`CachedmzML.store(path, exp)` and `CachedmzML.load(path, cached)` are available for
local binary caches, which require their paired metadata files and disk space.
## Format-specific I/O
```python
proteins, peptides = ms.IdXMLFile().load("search.idXML")
ms.IdXMLFile().store("copy.idXML", proteins, peptides)
# The output-argument form also works:
proteins = []
peptides = ms.PeptideIdentificationList()
ms.IdXMLFile().load("search.idXML", proteins, peptides)
features = ms.FeatureMap()
ms.FeatureXMLFile().load("features.featureXML", features)
consensus = ms.ConsensusMap()
ms.ConsensusXMLFile().load("study.consensusXML", consensus)
entries = []
ms.FASTAFile().load("database.fasta", entries)
```
For untested formats, inspect installed signatures before adapting:
`help(ms.MzIdentMLFile.load)`, `help(ms.PepXMLFile.load)`,
`help(ms.TraMLFile.load)`. pepXML is a general peptide-identification exchange
format, not an X! Tandem-only format. An `MSPFile.load` call requires a
`PeptideIdentificationList` and `MSExperiment` (or `AnnotatedMSRun`), not a list
of spectra.
## Metadata and loss
Use `exp.getInstrument()`, `exp.getSample()`, and `exp.getSourceFiles()` to inspect
provenance. `MSChromatogram.get_peaks()` gives time in seconds and intensity;
`getNativeID()` identifies stored traces, but a stored TIC need not be present
or equal to the sum of the MS1 peaks retained after conversion.
`convert_format.py` preserves experiment metadata when filtering spectra, and
retains synchronized peak arrays using `MSSpectrum.select(indices)`. Its RT and
intensity filters apply to spectra only. Chromatograms pass through unchanged
unless `--ms-level` is selected, when they are omitted.
MGF exports tandem spectra and loses much mzML metadata, chromatograms, and
other acquisition information; mzXML also cannot represent all mzML metadata.
Round-trip counts alone do not establish lossless conversion. Keep the original
file, conversion program/version/options, native IDs, charge/polarity, source
metadata, and calibration state. Native vendor-reader availability in OpenMS
3.6 does not establish that any particular vendor file works in this wheel.
## mzTab
Use the producing algorithm's populated `MzTab`/`MzTabM` with the corresponding
writer. A title plus empty rows is not a complete report. When changing a copied
metadata object, explicitly call `mztab.setMetaData(metadata)` before storing.
Retain candidate multiplicity, adduct assumptions and database provenance.
Source: [OpenMS release changes](https://openms.de/documentation/html/ChangeLog.html)
and installed pyOpenMS 3.6.0 binding signatures; the older
[mzML tutorial](https://pyopenms.readthedocs.io/en/latest/user_guide/mzml_files.html)
may show different output-argument conventions.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |