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/data_structures.md
View on GitHub# Data structures (pyOpenMS 3.6.0)
## Spectra, chromatograms and copy semantics
```python
import pyopenms as ms
spec = ms.MSSpectrum()
spec.setRT(60.0) # seconds, not minutes
spec.setMSLevel(1)
spec.setType(ms.SpectrumSettings.SpectrumType.CENTROID)
spec.set_peaks(([100.0, 200.0], [10.0, 20.0]))
exp = ms.MSExperiment()
exp.addSpectrum(spec)
copy = exp.getSpectrum(0)
copy.select([1]) # also filters associated peak arrays
exp.setSpectra([copy]) # explicit writeback
mz, intensity = exp[0].get_peaks()
assert list(mz) == [200.0]
```
`MSExperiment` stores spectra and chromatograms separately. `len(exp)` concerns
spectra; inspect `getNrChromatograms()` too. `getSpectrum()` and indexing return
copies in this binding; do not rely on iteration to mutate stored peaks.
`set_peaks()` changes the peak arrays but does not synchronize associated
float/integer/string arrays; prefer `select` for peak removal.
`MSChromatogram.get_peaks()` returns time in seconds and intensity. Precursor
metadata in a chromatogram is not proof of an analyte identity. MS2 precursor
m/z and charge come from `getPrecursors()`; the list may be empty or contain
multiple entries. Charge zero means unknown. Keep collision energy, isolation
windows, polarity and ion mobility metadata when they matter. Empty spectra and
traces need explicit handling before min/max/argmax operations.
`MSExperiment(exp)` makes a copy. Experiment metadata are available through
`getInstrument()`, `getSample()`, `getSourceFiles()`, and
`getExperimentalSettings()`. Preserve native IDs and source provenance when
rewriting files.
## Features and consensus
A `Feature` carries RT, m/z, intensity, charge, quality, hulls and optional
subordinates/identifications. Hull coordinates are `(RT seconds, m/z)`; use
`len(feature.getConvexHull().getHullPoints())`. Subordinates are algorithm-defined,
not invariably isotope peaks. Overall quality is not a calibrated probability.
```python
features = ms.FeatureMap()
f = ms.Feature()
f.setRT(60.0)
f.setMZ(200.0)
f.setIntensity(1000.0)
f.setCharge(1)
features.push_back(f)
features.setUniqueIds()
features.setPrimaryMSRunPath(["run.mzML"])
print(features.getPrimaryMSRunPath()) # list[str]
print(features.get_df()[["rt", "mz", "intensity", "charge"]])
```
`getUniqueId()` is an object identifier, not a count. `FeatureMap.size()` is the
number of features. Preserve source IDs when joining data. `ConsensusFeature`
contains handles with `getMapIndex()`, `getUniqueId()` and the original
feature coordinates/intensity. Absent handles mean missing observations.
`ConsensusMap.getColumnHeaders()` returns the map-index/sample mapping. Modify
it then call `setColumnHeaders(headers)` explicitly. `get_intensity_df()` and
`get_metadata_df()` are the focused exports; row identities/sample names must
be checked before joining. Positional concatenation avoids duplicate-index joins
but the output row number is not a persistent scientific identifier.
## Identification containers
Use `PeptideIdentificationList` with `push_back` for mutable peptide IDs.
`IdXMLFile.load(path)` returns proteins plus peptide IDs in 3.6; output-argument
loading also remains supported. A peptide ID has a search-run identifier, score
type/direction, optional RT/m/z, and hits. Hits have sequences, charge, score,
rank, protein evidence and metadata. Read `getScoreType()` and
`isHigherScoreBetter()`; do not assume scores or mass-error meta keys have a
universal meaning. `MS:1002252` is not a generic ppm-error key.
`ProteinIdentification` describes a search run and protein hits/groups, not one
protein. `getSearchParameters()` includes database, enzyme, modifications and
tolerance units. Use the identification reference for FDR semantics.
## Chemistry and parameters
```python
seq = ms.AASequence.fromString("PEPTIDEM(Oxidation)K")
print(seq.getMonoWeight(), seq.getAverageWeight(), seq.getFormula().toString())
formula = ms.EmpiricalFormula("C6H12O6")
print(formula.getMonoWeight()) # neutral mass in Da
pattern = formula.getIsotopeDistribution(ms.CoarseIsotopePatternGenerator(4))
print([(p.getMZ(), p.getIntensity()) for p in pattern.getContainer()])
algorithm = ms.FeatureFindingMetabo()
params = algorithm.getDefaults()
for key in params.keys():
print(key, params.getValue(key), params.getDescription(key))
params.setValue("charge_lower_bound", 1)
algorithm.setParameters(params)
```
The neutral-formula isotope container uses mass coordinates; do not label them
charged m/z without applying the intended adduct/charge. Coarse isotope patterns
are theoretical natural-abundance models; labeling/enrichment needs its own
model. Mass and average mass are different quantities. Unknown/ambiguous sequence
residues or modifications need deliberate treatment rather than silently
substituting a standard residue.
In 3.6 `Param.keys()` returns strings and typed parameter values may be booleans.
String values `"true"`/`"false"` remain accepted for the bundled algorithms.
Use installed defaults and descriptions to establish allowed names and units;
setting an unused or misspelled parameter does not establish algorithm behavior.
Sources: [3.6 release changes](https://openms.de/documentation/html/ChangeLog.html),
[wheel metadata](https://pypi.org/project/pyopenms/3.6.0/), and native 3.6.0
object/round-trip checks. The examples above are covered by synthetic checks;
they do not validate real acquisition metadata or scientific inference.
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 |