Skip to content

[TEST] IDFilter: cover the ConsensusMap removeDanglingProteinReferences overloads - #9558

Merged
timosachsenberg merged 1 commit into
OpenMS:developfrom
timosachsenberg:test/idfilter-consensusmap-dangling-protein-refs
Jun 18, 2026
Merged

timosachsenberg merged 1 commit into
OpenMS:developfrom
timosachsenberg:test/idfilter-consensusmap-dangling-protein-refs

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Jun 15, 2026 •

Copy link
Copy Markdown
Contributor

Context

Part of the OpenMS 3.6.0 pre-release testing plan (#9460), §5 — the dangling-DECOY_-reference concern: "no dangling DECOY_ PeptideEvidence remains (IDFilter::removeDanglingProteinReferences)."

IDFilter_test covered removeDanglingProteinReferences only for the PeptideIdentificationList overload. The two ConsensusMap overloads — the ones the ProteomicsLFQ / consensusXML lane relies on — had no coverage.

Change

Adds a dedicated section for each ConsensusMap overload (self-contained map, no fixtures):

  • removeDanglingProteinReferences(ConsensusMap&, bool) — run run1 knows PROT1/PROT2 but not the decoys:
    • an assigned PSM keeps its valid PROT1 evidence while the dangling DECOY_PROT1 reference is removed;
    • a PSM referencing only a dangling protein ends up with zero evidences (and is dropped when remove_peptides_without_reference=true);
    • an unassigned PSM is filtered too (include_unassigned defaults to true).
  • removeDanglingProteinReferences(ConsensusMap&, const ProteinIdentification& ref_run, bool) — filtering against a single reference run that knows only PROT1 makes PROT2 dangling everywhere, independent of the per-run protein identifications stored on the map.

Notes

  • Tests only — no production code changes.
  • Builds and passes locally; all assertions execute against real values (verbose-confirmed).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Enhanced test coverage for protein reference filtering functionality to validate handling of consensus data and protein identification scenarios.

…es overloads

IDFilter_test covered removeDanglingProteinReferences only for the
PeptideIdentificationList overload. The two ConsensusMap overloads
(per-run and ref_run) -- the ones the ProteomicsLFQ/consensusXML lane relies
on to drop dangling DECOY_ references (OpenMS#9460) -- had no coverage.

Adds sections for both:
- ConsensusMap overload: an assigned PSM keeps its valid PROT1 evidence while
  the dangling DECOY_PROT1 reference is removed; a PSM referencing only a
  dangling protein ends up with zero evidences (and is dropped when
  remove_peptides_without_reference=true); an unassigned PSM is filtered too
  (include_unassigned defaults to true).
- ref_run overload: filtering against a single reference run that knows only
  PROT1 makes PROT2 dangling everywhere, independent of the per-run protein
  identifications stored on the map.

Part of the OpenMS 3.6.0 pre-release testing plan (OpenMS#9460). Tests only;
no production code changes.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d27e4ed9-c420-43f4-8aa8-46f8687e196d

📥 Commits

Reviewing files that changed from the base of the PR and between aacd941 and 1762846.

📒 Files selected for processing (1)
  • src/tests/class_tests/openms/source/IDFilter_test.cpp

📝 Walkthrough

Walkthrough

Adds three OpenMS include headers (PeptideEvidence, ConsensusMap, ConsensusFeature) to IDFilter_test.cpp and introduces two new START_SECTION test blocks covering IDFilter::removeDanglingProteinReferences overloads that operate on ConsensusMap, testing decoy reference removal and single-run reference filtering.

Changes

IDFilter ConsensusMap test coverage

Layer / File(s) Summary
Headers and ConsensusMap test sections
src/tests/class_tests/openms/source/IDFilter_test.cpp
Adds PeptideEvidence, ConsensusMap, and ConsensusFeature includes; adds two START_SECTION blocks that construct a ConsensusMap via an internal helper lambda and assert: (1) decoy-only PeptideEvidence entries are removed, with optional removal of PeptideHits lacking surviving references; (2) filtering against a single reference ProteinIdentification run correctly handles both assigned and unassigned peptide identifications.

Possibly related PRs

  • OpenMS/OpenMS#8500: Introduced the IDFilter::removeDanglingProteinReferences rename/overloads on ConsensusMap that these new tests directly exercise.
  • OpenMS/OpenMS#8662: Refactored removeDanglingProteinReferences with new helper functions and altered filtering logic that the new test assertions validate.
  • OpenMS/OpenMS#8946: Trimmed transitive includes in OpenMS headers, making the explicit ConsensusMap/ConsensusFeature/PeptideEvidence includes added here necessary.

Suggested reviewers

  • jpfeuffer

🐇 A bunny hops through each consensus lane,
Checking each peptide, decoy by name,
Dangling refs gone, the map is clean now,
Two new sections prove the filter's vow.
The evidence stands — no phantom remains! 🌿

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding test coverage for IDFilter's ConsensusMap overloads of removeDanglingProteinReferences.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@github-actions

Copy link
Copy Markdown
Contributor

@timosachsenberg The following names might be missing from the AUTHORS file:

  • Timo Sachsenberg

Please consider applying the following patch:

--- AUTHORS	2026-06-16 00:07:48.391898240 +0000
+++ AUTHORS.new	2026-06-16 00:07:53.559808536 +0000
@@ -23,8 +23,8 @@
  - Chirag Dave
  - Chris Bauer
  - Chris Bielow
- - Christie Mathews
  - Christian Ehrlich
+ - Christie Mathews
  - Clemens Groepl
  - Cornelia Friedle
  - Daniel Jameson

Copy link
Copy Markdown
Contributor Author

Adversarial review result: I did not find a blocking issue in this test-only change. The added IDFilter coverage for ConsensusMap dangling protein references looks consistent with the existing cleanup semantics.

No source/test comments with tracker-style issue references stood out in this diff.

I did not run the tests locally.

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.

1 participant