Skip to content

feat(openms-consensus): structured modifications, localization scores, metadata tables - #238

Merged
ypriverol merged 2 commits into
devfrom
feat/openms-consensus-modifications
Aug 6, 2026
Merged

ypriverol merged 2 commits into
devfrom
feat/openms-consensus-modifications

Conversation

@daichengxin

Copy link
Copy Markdown
Collaborator

Summary

Extends the openms-consensus converter to full parity with the openms enrichment path.

Structured modifications

  • Populate the structured modifications column in feature and psm views from pyopenms AASequence per-residue / N-/C-terminal modifications, with canonical UNIMOD:N accessions.
  • Verified against LFQ / TMT / phospho datasets: every modification position matches the peptidoform string exactly (0 mismatches).

Site-localisation scores

  • Extract per-position localisation scores from OpenMS hit UserParams for Luciphor, Ascore, and PhosphoRS:
    • <algo>_pep_score → additional_scores
    • <algo>_global_flr → additional_scores
    • <algo>_site_scores ({position: score}) → modifications[].positions[].scores
  • Multiple algorithms in one file are all collected.

Metadata tables

  • Write ontology / provenance / dataset so the output is a complete 8-structure QPX dataset (previously only 5 structures).
  • Provenance auto-detects isobaric (TMT/iTRAQ) vs label-free from the consensusXML map labels.

CLI parity with convert openms

  • Add --project-accession (stamped into dataset.parquet).
  • Add --compression [zstd|snappy|gzip|none], threaded through every writer (feature/psm/pg/run/sample/ontology/provenance/dataset).

Validation

  • Re-converted LFQ (PXD001819), TMT (PXD007683TMT), and three phospho-localisation variants (Luciphor / Ascore / PhosphoRS) against the source consensusXML.
  • All datasets: 8/8 structures, qpxc validate Overall VALID, schema columns exact, PK unique, record-level intensities match source, modifications positions ↔ peptidoform consistent (0 mismatches), site scores attached correctly.

Files changed

  • qpx/cli/convert.py
  • qpx/converters/openms_consensus/converter.py
  • qpx/converters/openms_consensus/feature_adapter.py
  • qpx/converters/openms_consensus/psm_adapter.py

Co-Authored-By: Claude [email protected]

…, metadata tables

Extend the openms-consensus converter to parity with the openms enrichment path:

- Populate the structured `modifications` column in feature and psm views from
  pyopenms AASequence per-residue / terminal modifications (canonical UNIMOD:N).
- Extract site-localisation scores from OpenMS UserParams for Luciphor, Ascore,
  and PhosphoRS (`<algo>_pep_score`, `<algo>_global_flr`, `<algo>_site_scores`)
  into `additional_scores` and per-position `modifications[].positions[].scores`.
- Write the ontology / provenance / dataset metadata tables so the output is a
  complete 8-structure QPX dataset, matching the openms converter.
- Add `--project-accession` and `--compression` CLI options, threaded through
  every writer, matching the openms command.

Co-Authored-By: Claude <[email protected]>
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai

coderabbitai Bot commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f83e3703-d637-4aba-8b4b-c03a29c89793

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codacy-production

codacy-production Bot commented Aug 6, 2026 •

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 3 critical · 2 high · 6 medium

Alerts:
⚠ 11 issues (≤ 0 issues of at least minor severity)

Results:
11 new issues

Category Results
ErrorProne 2 high
Security 3 critical
1 medium
Complexity 5 medium

View in Codacy

🟢 Metrics 54 complexity · 1 duplication

Metric Results
Complexity 54
Duplication 1

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Resolve the CI pre-commit failures:
- Remove the unused `headers` assignment in `_consensus_is_isobaric`.
- Re-sort the `qpx._version` import ahead of `qpx.converters.*` (ruff I001).
- Apply `ruff format` to cli/convert.py, converter.py, feature_adapter.py.

Co-Authored-By: Claude <[email protected]>
@ypriverol
ypriverol self-requested a review August 6, 2026 08:15
@ypriverol
ypriverol merged commit b47366b into dev Aug 6, 2026
7 of 8 checks passed
@ypriverol
ypriverol deleted the feat/openms-consensus-modifications branch August 7, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants