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/identification.md
View on GitHub# Identification and confidence (pyOpenMS 3.6.0)
## Search engines and provenance
OpenMS TOPP adapters and their engine executables are separate from the Python
wheel. Use a supported installed adapter's `--help` and versioned parameter file;
do not invent `ms.CometAdapter` or assume a search engine is bundled. This skill
postprocesses precomputed idXML. Comet, Mascot, MSGF+, X! Tandem and MSFragger
searches, rescoring, protein inference accuracy and proprietary engines were not
executed in this audit.
Record raw data/conversion, target+decoy FASTA checksum and decoy strategy,
enzyme/specificity/missed cleavages, fixed versus variable modifications,
precursor/fragment tolerance values **and units**, charge/isotope hypotheses,
search-engine version and rescoring. `SearchParameters` records settings; merely
setting it does not run a database search. Use `digestion_enzyme`,
`fixed_modifications`, `variable_modifications`, `precursor_mass_tolerance`,
`precursor_mass_tolerance_ppm`, `fragment_mass_tolerance` and
`fragment_mass_tolerance_ppm`, not invented `enzyme`/`modifications` attributes.
## Local idXML processing
```python
import pyopenms as ms
proteins, peptides = ms.IdXMLFile().load("search.idXML")
for pid in peptides:
print(pid.getIdentifier(), pid.getScoreType(), pid.isHigherScoreBetter())
for hit in pid.getHits():
print(hit.getSequence().toString(), hit.getCharge(), hit.getScore())
if hit.metaValueExists("target_decoy"):
print(hit.getMetaValue("target_decoy"))
ms.IdXMLFile().store("copy.idXML", proteins, peptides)
```
`PeptideIdentificationList` is the mutable ID container; protein runs remain a
Python list. In 3.6, string accessors return `str`; do not blindly `.decode()`.
`getIdentifier()` links peptide IDs to a protein/search run; it is not the engine
name. Read `getScoreType()` and `isHigherScoreBetter()` rather than inferring
score meaning from filenames or a substring such as Comet.
```bash
python scripts/process_identifications.py search.idXML --fasta target_decoy.fasta --decoy-prefix DECOY_ --fdr 0.01 --out filtered.idXML --csv hits.csv
```
This file-dependent recipe was exercised on a tiny constructed target/decoy
FASTA and idXML, not a real search. Re-index using exactly the database used for
searching. The prefix is configurable; the CLI uses prefix matching, not suffix
matching. `PeptideIndexing.run` returns status plus updated output containers;
non-success status is an error. Missing decoys are an error, not a warning.
## FDR assumptions
`filter_psm_qvalues` checks finite original scores, valid target/decoy annotations,
one search run/score type/direction, and both target and decoy **top** hits. This
prevents the native no-decoy behavior from producing misleading zero q-values.
`FalseDiscoveryRate` sorts and retains the first hit by default, estimates q-values,
removes decoys by default, sets score type `q-value` and lower-is-better, and puts
the q-value in **`hit.getScore()`**. It is not generally a `q-value` meta-value.
The helper explicitly sets `no_qvalues=false`, `use_all_hits=false`, and
`add_decoy_peptides=false`; record all other defaults with the result.
A 1% PSM threshold is neither a per-hit probability nor 1% protein FDR. Unique
peptide, protein and protein-group error control are separate. Tiny fixtures test
API behavior and safeguards only; they cannot establish statistical calibration.
Do not repeatedly estimate FDR from already transformed scores. Post-FDR length
filters change the reported population and do not establish an independently
controlled subgroup FDR. Mixed runs require an explicit pooling/stratification
plan rather than silently accepting incomparable scores.
## Feature annotation and protein inference
`IDMapper.annotate(feature_map, peptides, proteins)` maps IDs onto features using
m/z/RT tolerances, charge and hull assumptions; it does not infer proteins.
`BasicProteinInferenceAlgorithm.run(peptides, proteins)` aggregates evidence and
returns updated protein runs in 3.6. Protein hits are not a protein group simply
because multiple hits occur in one run. Inspect `getProteinGroups()` and
`getIndistinguishableProteins()` where appropriate and perform separately
validated protein/group-level confidence estimation. This workflow is
illustrative here, not a validated protein-inference pipeline.
## Chemistry
The bundled digestion, mass and theoretical-spectrum scripts have synthetic
native regression tests. The spectrum generator requires an `MSSpectrum`, not a
Python list:
```python
seq = ms.AASequence.fromString("PEPTIDEM(Oxidation)K")
fragments = ms.MSSpectrum()
ms.TheoreticalSpectrumGenerator().getSpectrum(fragments, seq, 1, 2)
```
Fragment charge bounds are positive magnitudes; sequence modifications alter
mass. Theoretical intensities do not predict instrument spectra. An arbitrary
similarity cutoff such as 0.7 is not validated spectral-library identification.
Decoy construction also needs deliberate enzyme/modification/duplicate handling;
`DecoyGenerator.reverseProtein` accepts an `AASequence`, not a `FASTAEntry`.
Sources: [FDR release implementation](https://github.com/OpenMS/OpenMS/blob/5d5cbff4053b281763a1a79bf69e81c27967cfdf/src/openms/source/ANALYSIS/ID/FalseDiscoveryRate.cpp),
[OpenMS FDR API](https://openms.de/documentation/classOpenMS_1_1FalseDiscoveryRate.html)
and installed 3.6.0 binding signatures. Use the implementation to resolve stale or
internally inconsistent formula descriptions in generated API documentation.
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 |