Repository navigation
fix: filter subsumable (prob=0) proteins in ProtXMLFile parser - #8960
Conversation
ProteinProphet assigns probability=0 to "unneeded" proteins whose peptides are fully explained by higher-probability proteins in the same protein_group. Previously these were parsed as separate indistinguishable groups, causing ProteinQuantifier to discard shared peptides between the leader and these subsumable proteins (since it only uses peptides unique to a single indistinguishable group). This led to most proteins being quantified in only one TMT plex instead of all plexes. Now probability=0 <protein> elements and all their children (peptides, indistinguishable_protein, modifications) are skipped during parsing. This matches how FragPipe/Philosopher and MaxQuant handle subsumable proteins. Truly indistinguishable proteins (via <indistinguishable_protein> XML elements) are unaffected. Fixes #6038 Supersedes #8416 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe changes filter ProteinProphet proteins with ChangesProtXML zero-probability filtering
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
# Conflicts: # src/openms/source/FORMAT/ProtXMLFile.cpp
|
Adversarial review result: no blocking parser issue found in static review for the probability-zero ProtXML filtering. Cleanup required before merge: the added source/test comments explicitly mention |
… scope) Co-Authored-By: Claude Opus 4.8 <[email protected]>
Follow-up to the subsumable-protein filter:
- Guard insertProteinGroup() against accession-less groups: a protein_group
whose <protein> elements were all probability=0 (and thus skipped) would
otherwise be inserted empty, breaking downstream consumers that assume
group.accessions[0] exists (e.g. TextExporter).
- Document that probability==0 covers BOTH subset and subsumable ("unneeded")
proteins and why it is preferred over the optional, subsumable-only
'subsuming_protein_entry' attribute.
- Downgrade the per-protein skip log from INFO to DEBUG.
- Extend the regression test: subsumable-protein-first-then-valid group (mid-
group skip reset + indistinguishable-child guard), an all-prob=0 group (no
empty group emitted), and a schema-valid modification_info wrapper.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Keep the full technical rationale for filtering probability=0 (subset/subsumable) proteins, but remove the GitHub issue-number references from the header doxygen, source comment, and test comment. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…todo Resolve the "document which metavalues of Protein/PeptideHit are filled" @todo by listing exactly what the reader populates on ProteinHit (accession, score, coverage; no meta values), PeptideHit (sequence, score, charge, PeptideEvidence, is_unique, is_contributing meta values), and the identification score type. Also correct the stale claim that indistinguishable siblings get "score of -1": the reader transfers the group leader's score to them. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@CHANGELOG`:
- Line 545: Update the CHANGELOG entry to replace the unsupported “most
proteins” impact claim with the supported wording that many proteins were
quantified in only one TMT plex; leave the filtering behavior and issue
references unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
|
@copilot resolve the merge conflicts in this pull request |
Done — issue-tracker references were removed from comments in commit
Merge conflicts with |
…, faithful fixture Address low-severity review findings: - Assert surviving peptide sequences and their PeptideEvidence accessions, not just the count, so a regression that substitutes a skipped peptide or leaves stale evidence from a filtered protein can no longer pass at count 5. - Fix the indistinguishable-group comment: without filtering the fixture yields 8 groups (one per <protein>), not 6. - Doxygen: indistinguishable siblings do carry a protein_name; say they have no probability or coverage of their own rather than "no attributes". - Make the fixture's subsumption relationships faithful: SUB_FIRST's peptide is now a subset of its sibling VALID_AFTER (subsuming_protein_entry references the sibling id), and the all-zero group carries no subsuming_protein_entry, showing probability=0 alone drives filtering. ProtXMLFile_test passes. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…able-protein-filtering # Conflicts: # CHANGELOG
Summary
ProteinQuantifierto discard shared peptides (since it only uses peptides unique to a single indistinguishable group), leading to most proteins being quantified in only one TMT plex<indistinguishable_protein>XML elements) are unaffectedBackground
ProteinProphet assigns
probability=0to proteins whose peptides are fully explained by higher-probability proteins in the same<protein_group>. These are subsumable (subset) proteins — distinct from truly indistinguishable (same-set) proteins. The old parser treated both the same way, creating separate indistinguishable groups for each<protein>element. This brokeProteinQuantifier's peptide-to-leader mapping (getAccession_()returned empty / "LEADERS EMPTY"), discarding shared peptides from quantification.This matches how other tools handle subsumable proteins:
Changes
ProtXMLFile.h: Addedskip_protein_flag + class doxygen documenting protXML parsing semanticsProtXMLFile.cpp: Skip<protein>elements withprobability=0and all their children (peptides, modifications, indistinguishable_protein)ProtXMLFile_input_3.protXML) with 3 test cases: leader+subsumable, indistinguishable pair, single proteinFixes #6038
Supersedes #8416
Test plan
ProtXMLFile_testpasses (existing + new test section)🤖 Generated with Claude Code
Summary by CodeRabbit
probability=0so they no longer generate protein hits, indistinguishable protein entries, or associated peptide evidence, preventing empty or spurious groups.