Repository navigation
[FIX,TOPP,TEST] ProteomicsLFQ: make the fraction's link FWHM a median, not the last file's - #9985
Conversation
…, not the last file's The feature linker's RT tolerance is derived from a chromatographic FWHM (distance_RT:max_difference = 2*max_alignment_diff + 2*fwhm, and PIP-ECHO's local_rt window). That FWHM is a property of the fraction, but quantifyFraction_ computed it into a variable scoped to the whole function and read it again after the per-file loop had finished -- so it was whichever run the loop ended on, and the tolerance depended on the order the files were passed in. It is now the median over the fraction's runs. Feature detection is untouched: detect:peak_width still uses the current run's own FWHM, which is a genuinely per-run quantity. Only the fraction-level use changes. Two related defects with the same shape: - The per-run value is now scoped to the loop iteration. The "no seed-based estimate available, use 30 s" fallback for .d/IM_PEAK fires on `== 0.0`, so it only ever fired for the first file; a later IM_PEAK run in a fraction that also contained a non-IM run silently inherited that run's measured FWHM instead. - picked_decoy_string_/picked_decoy_prefix_ were overwritten by every input file, so the last one silently decided the affix used for picked protein FDR over the whole study. The first is now kept and a disagreement is reported: the affix is a property of the FASTA, so two files disagreeing means one was searched against a different database and half the accessions will not match. Measured on the shipped BSA fixtures, the fraction values do move -- fraction 1's runs are 8.64 / 7.78 / 7.12 s, so 7.12 (last) becomes 7.78 (median), and fraction 2's 8.77 becomes 8.73. No output changes, because the tolerance is dominated by 2*max_alignment_diff, which is floored at 120 s: a ~1.4 s shift in a ~255 s window changes no grouping decision. The change is therefore justified by the definition rather than by an observed delta, and the fixtures are not sensitive enough to show one. Since nothing in the outputs would notice a silent revert, TOPP_ProteomicsLFQ_ fraction_fwhm asserts the aggregation on the log: PASS_REGULAR_EXPRESSION pins that it happens over the fraction's 3 runs, FAIL_REGULAR_EXPRESSION pins that the reported value is not the last run's 7.1x. Verified to fail for its stated reason -- with median() replaced by back(), it reports 7.11529 and goes red. TOPP_ProteomicsLFQ suite: 70/70 pass, no reference files touched. The .d/PASEF tests (DDA_PASEF, DDA_PASEF_biosaur2) cover the IM_PEAK path above. Co-Authored-By: Claude Opus 5 (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 Plus Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughChangesProteomicsLFQ metric handling
Sequence Diagram(s)sequenceDiagram
participant ProteomicsLFQ
participant MSRun
participant alignAndLink_
ProteomicsLFQ->>MSRun: Measure chromatographic FWHM
MSRun-->>ProteomicsLFQ: Return per-run FWHM or default
ProteomicsLFQ->>ProteomicsLFQ: Compute fraction median
ProteomicsLFQ->>alignAndLink_: Pass fraction FWHM
Suggested reviewers: Poem
Merge Risk: 🔵 Low · up to The change makes fraction-level FWHM aggregation order-independent while preserving per-run feature detection. A bounded data-integrity risk remains because files with conflicting decoy conventions are combined after a warning, using one convention for study-wide picked-protein FDR; the PR is mergeable with explicit owner awareness or follow-up. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches 💡 1📝 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 |
…fix entry The median-FWHM entry added by OpenMS#9985 was missing its own PR citation. The quant-score SVM training shuffle fix (OpenMS#9981/OpenMS#9982) had no entry at all. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_011BcssmGej97WFDdDWW7LhW
What
The feature linker's RT tolerance is derived from a chromatographic FWHM
(
distance_RT:max_difference = 2*max_alignment_diff + 2*fwhm, and PIP-ECHO'slocal_rtwindow).That FWHM describes the fraction, but
quantifyFraction_computed it into a variable scoped tothe whole function and read it again after the per-file loop had finished — so it was whichever
run the loop ended on, and the tolerance depended on the order the files were passed in.
It is now the median over the fraction's runs. Feature detection is untouched:
detect:peak_widthstill uses the current run's own FWHM, which is a genuinely per-run quantity.Only the fraction-level use changes.
Two related defects with the same shape
available, use 30 s" fallback for
.d/IM_PEAK fires on== 0.0, so it only ever fired for thefirst file; a later IM_PEAK run in a fraction that also contained a non-IM run silently
inherited that run's measured FWHM instead.
picked_decoy_string_/picked_decoy_prefix_were overwritten by every input file, so thelast one silently decided the affix used for picked protein FDR across the whole study. The
first is now kept and a disagreement is reported: the affix is a property of the FASTA, so two
files disagreeing means one was searched against a different database and the picked FDR would
be computed against an affix that does not match half the accessions.
Effect on output
None, on the shipped fixtures — and the values genuinely do move, so this is not vacuous:
No grouping decision changes, because the tolerance is dominated by
2*max_alignment_diff, whichis floored at 120 s: a ~1.4 s shift in a ~255 s window moves nothing. So the change is justified
by the definition rather than by an observed delta, and the fixtures are not sensitive enough to
show one. No reference file is touched.
Test
Since nothing in the outputs would notice a silent revert to last-file-wins,
TOPP_ProteomicsLFQ_fraction_fwhmasserts the aggregation on the log:PASS_REGULAR_EXPRESSIONpins that it happens over the fraction's 3 runs,FAIL_REGULAR_EXPRESSIONpins that the reported value is not the last run's7.1x. Matched on7.1rather than on the median itself so it does not become brittle to platform differences inthe FWHM estimate.
Verified to fail for its stated reason: with
Math::median(...)replaced byrun_fwhms.back(),it reports
7.11529and goes red; green again on revert.ctest -R TOPP_ProteomicsLFQ: 72/72 pass (rebased onto develop after #9979/#9982/#9984, sothis includes the new
strictly_uniquetests).🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests