Repository navigation
[FIX] FragmentMassError: make both compute() overloads agree (#9488 QC-3) - #9618
Conversation
|
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 (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughFragmentMassError::compute for PeptideIdentificationList now accumulates ppm errors in a first pass, computes the final average afterward, and derives variance in a second pass. A regression test adds spectra with differing ppm offsets and checks the overload results against FeatureMap. ChangesFragmentMassError two-pass statistics
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 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 |
|
Adversarial review result: no blocking behavioral issue found in this pass. Required source cleanup before merge: the added production/test comments include tracker references. Please remove those references from source comments and keep the comments focused on the two-pass average/variance contract. I did not run the tests locally. |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 `@src/openms/source/QC/FragmentMassError.cpp`:
- Around line 291-294: The new comment in FragmentMassError should be rewritten
to describe the two-pass average/variance contract only, and must remove the
issue-tracker reference text (“#9488, QC-3”). Update the nearby comment in the
FragmentMassError computation block so it explains that both overloads use the
same two-pass computation and that variance is accumulated against the final
average, without mentioning any ticket or tracker identifiers.
In `@src/tests/class_tests/openms/source/FragmentMassError_test.cpp`:
- Around line 305-313: Update the regression test comment in
FragmentMassError_test.cpp to remove the issue-tracker reference and QC label,
and rewrite it to describe the behavior being verified: that the
PeptideIdentificationList and FeatureMap overloads must compute average_ppm and
variance_ppm identically using the same spectra/peptides with non-constant
per-spectrum errors. Keep the focus on the two-pass average/variance contract
and the moving-average bug that the test distinguishes, without mentioning `#9488`
or QC-3.
- Line 358: The boolean assertion in FragmentMassError_test should use the
preferred test macro style instead of comparing against true. Update the test
around list_result.variance_ppm to use TEST_TRUE with the same condition,
keeping the existing assertion intent but aligning with the coding guideline for
boolean checks.
🪄 Autofix (Beta)
❌ Autofix failed (check again to retry)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b7302dbe-d024-4c6f-accc-f0a9f69282b9
📒 Files selected for processing (2)
src/openms/source/QC/FragmentMassError.cppsrc/tests/class_tests/openms/source/FragmentMassError_test.cpp
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. An unexpected error occurred while generating fixes: Not Found - https://docs.github.com/rest/git/refs#get-a-reference |
…9488 QC-3) Part of OpenMS#9488 (POLS high-severity checklist — **QC / SYSTEM / APPLICATIONS**). ### [QC-3] `FragmentMassError::compute` — two overloads computed average/variance differently The `PeptideIdentificationList` overload accumulated ppm errors, computed the average, and called `calculateVariance_` **inside** the per-ID loop, so the variance was accumulated against a *moving/partial* average. The `FeatureMap` overload already did it correctly in two passes, so the two overloads produced different results for the same data. **Fix:** make the list overload mirror the `FeatureMap` overload — first pass accumulates all ppm errors and computes the final average; second pass computes the variance against that final average. **ABI:** none (implementation only). **Test:** `FragmentMassError_test` — both overloads now produce identical `average_ppm` / `variance_ppm` for the same input (non-constant errors so the variance is non-degenerate). Co-Authored-By: Claude Opus 4.8 <[email protected]>
Rewrite the FragmentMassError source/test comments to describe the two-pass average/variance contract without issue-tracker identifiers, and switch the variance assertion to TEST_TRUE. Co-Authored-By: Claude Fable 5 <[email protected]>
c51f11c to
a45e11f
Compare
Adds entries for PRs merged in the last couple of days that were missing changelog coverage: the TOPPView precursor-highlighting feature (#9715), the Xerces-C++ PRIVATE-linkage/XMLHandler API change (#9712, which also supersedes a stale note left by the LibSVM PRIVATE-linkage entry), the FragmentMassError variance fix (#9618), the PepXMLFile duplicate Comet metavalue fix (#9089), and the clang/OpenMP and TextExporter USI documentation additions (#9162, #9173). Co-authored-by: Claude <[email protected]>
Part of #9488 (POLS high-severity checklist — QC / SYSTEM / APPLICATIONS).
[QC-3]
FragmentMassError::compute— two overloads computed average/variance differentlyThe
PeptideIdentificationListoverload accumulated ppm errors, computed the average, and calledcalculateVariance_inside the per-ID loop, so the variance was accumulated against a moving/partial average. TheFeatureMapoverload already did it correctly in two passes, so the two overloads produced different results for the same data.Fix: make the list overload mirror the
FeatureMapoverload — first pass accumulates all ppm errors and computes the final average; second pass computes the variance against that final average.ABI: none (implementation only).
Test:
FragmentMassError_test— both overloads now produce identicalaverage_ppm/variance_ppmfor the same input (non-constant errors so the variance is non-degenerate).🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests