Skip to content

[FIX,TEST] ProteomicsLFQ: warn instead of asserting on a fraction without features (#10310) - #10315

Merged
timosachsenberg merged 2 commits into
developfrom
claude/wizardly-cannon-pqiddz
Sep 29, 2026
Merged

timosachsenberg merged 2 commits into
developfrom
claude/wizardly-cannon-pqiddz

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Description

Follow-up to #10310 (segfault in QTClusterFinder during ProteomicsLFQ linking with Sage identifications).

Cause of the reported crash. Reproduced with the reporter's build (3.6.0-pre-nightly-2026-07-02, 33ebe49) on the quantms BSA test data with Sage. Percolator (-score:fdr 0.1) keeps no PSM in any run of fraction 1, so feature detection finds nothing and the QT linker receives only empty maps. QTClusterFinder::run_() then called massrange.front() on an empty vector: gdb shows frame #0 reading a double from address 0 under #1 QTClusterFinder::run_<FeatureMap> and #2 FeatureGroupingAlgorithmQT::group_<FeatureMap>, the stack in the issue. 3.5.0 has the same bug. #9790 fixed it on develop on 2026-07-24; the 2026-09-27 nightly runs the same inputs to completion.

What this PR changes.

  • ProteomicsLFQ: link_() still asserted ! consensus_fraction.empty(), so Debug builds aborted on the same input (ProteomicsLFQ.cpp:756: ... Assertion '! consensus_fraction.empty()' failed). The assertion is removed. quantifyFraction_() now warns when a fraction yields no consensus features, naming the fraction and its number of runs. The other fractions are quantified as before.
  • FeatureGroupingAlgorithmQT_test: new section for the call ProteomicsLFQ makes, group() with use_identifications=true on three empty feature maps. It checks the empty result and that protein and unassigned peptide IDs survive postprocessing. The same code segfaults against the 2026-07-02 library.
  • TOPP_ProteomicsLFQ_empty_fraction (+ _out_1): BSA1 and BSA2 with both fractions; fraction 2 has no identifications. The new ProteomicsLFQ_empty_fraction_BSA1_F2.idXML is a copy of the existing BSA2_F2_empty.idXML pointing at BSA1_F2. The test requires the warning and compares the MSstats output of fraction 1 with a reference. The 2026-07-02 nightly segfaults on this test and the Debug build of develop aborts; the reference is byte-identical to the output of the 2026-09-27 Release nightly.
  • CHANGELOG entry.

No library code changes.

Checklist

  • Make sure that you are listed in the AUTHORS file (n/a: generated with Claude Code)
  • Add relevant changes and new features to the CHANGELOG file
  • I have commented my code, particularly in hard-to-understand areas
  • New and existing unit tests pass locally with my changes (local Debug build with -D_GLIBCXX_ASSERTIONS: FeatureGroupingAlgorithmQT_test, QTClusterFinder_test and all 92 TOPP_ProteomicsLFQ_* tests; the full suite was not run)
  • Updated or added python bindings for changed or new classes (Tick if no updates were necessary.)

🤖 Generated with Claude Code

https://claude.ai/code/session_01H8edsjvHPkbzHmRd7Foszp


Generated by Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • ProteomicsLFQ now handles fractions that contain no consensus features without failing, including in Debug builds. Empty fractions contribute no quantities, while processing continues for the remaining fractions.
    • A warning identifies the empty fraction and the number of runs it contains, and suggests checking whether identifications passed FDR filtering.

…hout features (#10310)

A fraction in which no run has a feature gives the linker only empty maps.
That happens when no identification of the fraction's runs passes the
upstream FDR filter, as in the quantms BSA test with Sage, where Percolator
keeps no PSM in any run of fraction 1. Until #9790 this crashed
QTClusterFinder::run_() (massrange.front() on an empty vector, the segfault
reported in #10310; 3.5.0 has it too). Since then linking returns an empty
consensus map, but ProteomicsLFQ still asserted that it is not empty, so
Debug builds aborted on the same input. The fraction now contributes no
quantities and a warning names it; the other fractions are quantified as
before.

FeatureGroupingAlgorithmQT_test covers the call ProteomicsLFQ makes
(use_identifications=true) on empty maps; builds before #9790 segfault on
it. TOPP_ProteomicsLFQ_empty_fraction runs ProteomicsLFQ with a fraction
without identifications (the 2026-07-02 nightly segfaults on it, the Debug
build of develop aborted on the assertion) and compares the MSstats output
of the remaining fraction, which matches the 2026-09-27 Release nightly
byte for byte.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01H8edsjvHPkbzHmRd7Foszp
@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: e5ddca1f-62bb-4126-b7a8-240fa14f6ea4

📥 Commits

Reviewing files that changed from the base of the PR and between 5397a8b and dcf4dc9.

⛔ Files ignored due to path filters (1)
  • src/tests/topp/ProteomicsLFQ_empty_fraction_out.csv is excluded by !**/*.csv
📒 Files selected for processing (2)
  • CHANGELOG
  • src/topp/ProteomicsLFQ.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • CHANGELOG

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

ProteomicsLFQ now handles fractions that produce no consensus features without asserting. It logs a warning that identifies the fraction and run count. Regression tests cover empty feature maps and empty-fraction output.

Changes

Empty-fraction handling

Layer / File(s) Summary
ProteomicsLFQ empty-fraction handling
src/topp/ProteomicsLFQ.cpp, src/tests/topp/CMakeLists.txt, src/tests/topp/ProteomicsLFQ_empty_fraction_BSA1_F2.idXML, CHANGELOG
ProteomicsLFQ no longer asserts when a fraction has no consensus features. It logs a warning. A TOPP test checks the warning and compares the generated CSV with a reference.
Empty-map grouping coverage
src/tests/class_tests/openms/source/FeatureGroupingAlgorithmQT_test.cpp
A regression test checks that grouping empty feature maps produces no consensus features while retaining protein and unassigned peptide identifications.

Suggested reviewers: claude

Priority: ⬇️ Low

Change: Bug fix

Merge Risk: ⚪ Minimal · up to dcf4d

An empty fraction contributes no quantities while the other fractions retain their output. No material mergeability risk is established.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: ProteomicsLFQ now warns instead of asserting when a fraction has no features. It also identifies the associated tests.
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR

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

A rabbit checks the fraction's flow
Empty maps yield no features to show
The warning names the run
Tests confirm what has been done
Then hops away through fields of snow

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

@timosachsenberg
timosachsenberg merged commit 3beca3f into develop Sep 29, 2026
40 of 41 checks passed
@timosachsenberg
timosachsenberg deleted the claude/wizardly-cannon-pqiddz branch September 29, 2026 16:26
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