Skip to content

fix(openms-consensus): FeatureFinderIdentification maps from group-merged IDs; several consensusXML inputs - #334

Merged
ypriverol merged 4 commits into
bigbio:devfrom
jonasscheid:fix/openms-consensus-merged-ids
Sep 27, 2026
Merged

ypriverol merged 4 commits into
bigbio:devfrom
jonasscheid:fix/openms-consensus-merged-ids

Conversation

@jonasscheid

Copy link
Copy Markdown
Contributor

Makes convert openms-consensus produce a valid, correctly attributed dataset from nf-core/mhcquant consensusXML, where FeatureFinderIdentification gets the group-merged idXML for every run and each sample group is its own consensusXML.

PXD011628 (2 groups × 3 runs, PBMC007 + PBMC009), dev (per file, summed) vs this PR (one call):

dev this PR
PSM rows (PSMs per spectrum) 81,570 (3.0) 27,309 (1.0)
duplicate feature_id 73 0
same peak counted twice in a run 203 0
features with an own-run ID (id_run_file_name, scan) 12,629 26,850
PSMs linked to a feature 12,629 26,815
features with peptide_qvalue / PEP 0 20,520
qpxc validate INVALID VALID

A single-run group (PXD009752) had run_file_name = "" on all 336 rows and is now named from the ID metadata.

  • PSM run: each run's map holds a copy of every group ID, so map_index names the map, not the spectrum's run. When several ProteinIdentifications share one multi-run spectra_data, the run comes from id_merge_index in the PSM's own ProteinIdentification, and the copies collapse to one PSM.
  • Single-run map: FileConverter (featureXML → consensusXML) leaves the column header empty; the run is taken from the ID metadata when it names exactly one.
  • Shared peak: isobaric targets (e.g. VLFHNLPSL / AVSSFIFLR) or positional isomers get the same peak from FFId. After FeatureLinker and IDConflictResolver, both consensus features carry the winning peptide, so the peak appears twice in that run. The row from the consensus feature with more runs, then higher quality, is kept, and PSM links follow it.
  • Own-run IDs: IDConflictResolver moves all but one ID per consensus feature to the unassigned list, tagged with the feature's id. Own-run IDs with the same peptide are attached again, giving those features their scan, id_run_file_name and PSM link. Features quantified only from another run's ID (21%) stay null.
  • PSM → feature link: psm.feature_id is chosen by a fixed ranking instead of the first copy read: feature in the PSM's run, then same peptidoform/charge, closest RT, m/z, quality, feature_id. It no longer depends on feature order.
  • Percolator PEP/q-value are read from the hit meta values (MS:1001493, q-value) when the primary score is a search score, e.g. COMET:xcorr. With Percolator:peptide_level_fdrs, only the peptide's best PSM has real values and the rest carry 1.0. So features take the best PSM's values, the 1.0 placeholders are dropped, psm.posterior_error_probability stays null, and PSMs carry peptide_qvalue in additional_scores.
  • Several inputs: --consensusxml a.consensusXML,b.consensusXML writes one dataset; inputs sharing a run are rejected.

ProteomicsLFQ outputs give unchanged PSM and pg rows. Feature rows only gain values that were null before: own-run IDs, and peptide-level q-value/PEP for Percolator peptide-level runs. 1405 tests pass; new tests cover both readers (streaming and in-memory).

🤖 Generated with Claude Code

…uilt from group-merged IDs and accept several consensusXML inputs.

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

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@coderabbitai

coderabbitai Bot commented Sep 23, 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: Advanced

Run ID: 0c8542b4-68c0-4a79-90c2-fb9c0e38d20b

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 Sep 23, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 213 complexity · 0 duplication

Metric Results
Complexity 213
Duplication 0

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.

…sitives flagged by Codacy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ypriverol
ypriverol merged commit cee47ee into bigbio:dev Sep 27, 2026
9 checks passed
@jonasscheid
jonasscheid deleted the fix/openms-consensus-merged-ids branch September 28, 2026 08:15
@jonasscheid

Copy link
Copy Markdown
Contributor Author

Would it be possible to do a minor or patch release such that I can start implementing the module in mhcquant? @ypriverol @Shen-YuFei ?

@ypriverol

Copy link
Copy Markdown
Contributor

Do another PR; we haven't release.

@jonasscheid

Copy link
Copy Markdown
Contributor Author

Another PR? I think this feature its already merged into main 🤔

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.

3 participants