Repository navigation
[FIX] IsobaricWorkflow: precursor purity tolerance was truncated to 1 ppm - #10448
Conversation
getPurities_() declared max_precursor_isotope_deviation as bool, and the call site handed it the double read from -extraction:precursor_isotope_deviation (default 10 ppm). The conversion turned every non-zero setting into true, so PrecursorPurity ran with a 1 ppm isotope tolerance and a 1 ppm fuzzy border of the isolation window, whatever the user set. The existing IsobaricWorkflow fixtures cannot see this: their isolation windows hold only the precursor peak, so the purity is 1.0 at any tolerance and the references stay as they are. The new TOPP_IsobaricWorkflow_purity_tolerance test runs the same input on a copy of the mzML whose MS1 has one extra peak 0.004 Th above the strict upper border of scan 24217's isolation window with twice the precursor's intensity: at 10 ppm the fuzzy border (0.0077 Th at m/z 769) counts it half, purity 0.5; at 1 ppm it is outside, purity 1.0. The reference is IsobaricWorkflow_1_out.consensusXML with the file name and that one feature's purities adjusted; the purity was recomputed for the fixture with a line-by-line port of PrecursorPurity::computeSingleScanPrecursorPurities. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_0116xbaQQJpHtmofZc5FirfT
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_0116xbaQQJpHtmofZc5FirfT
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughIsobaricWorkflow now passes precursor isotope deviation as a numeric tolerance for precursor-purity calculations. A TOPP regression test runs the workflow with a 10 ppm setting and compares its consensusXML output with a reference. ChangesPrecursor isotope tolerance
Suggested reviewers: Priority: ➖ Normal Change: Bug fix Merge Risk: ⚪ Minimal · up to No actionable issue is established; the change is mergeable after normal checks. 🚥 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 1 functions across 1 files. (4 skipped: 4 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. A rabbit checks the tolerance line, Comment |
|
clear bug |
Brings in #10448, #10453, #10449 (ProSE -rescore), #10429, #10463, #10455 and #10452. #10429 is the same PeptideIndexing change this branch carried from #10403, so the files merged identically; its duplicate CHANGELOG entry is dropped. The CHANGELOG conflict keeps both sides. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01UQCiwdbPoEkrebED8VQ2TJ
Bug
getPurities_()insrc/topp/IsobaricWorkflow.cppdeclaredmax_precursor_isotope_deviationasbool, while the call site passes thedoubleread from-extraction:precursor_isotope_deviation(default 10 ppm). The implicit conversion turned every non-zero setting intotrue, soPrecursorPurity::computeSingleScanPrecursorPurities/computeInterpolatedPrecursorPurityran with a 1 ppm isotope tolerance and a 1 ppm fuzzy border of the isolation window, whatever the user set. The precursor purities IsobaricWorkflow reports (precursor_purity,quant_precursor_purity, and the MS3 average) were therefore computed at the wrong tolerance; on real data that undercounts isotope peaks of the precursor and reports purities that are too low.IsobaricAnalyzeris not affected (it goes throughIsobaricChannelExtractor, which keeps the double).Fix
One line: the parameter is a
double.Test
The existing IsobaricWorkflow fixtures cannot detect this: in
TMTTenPlexMethod_test.mzMLevery isolation window holds only the precursor peak, so the purity is 1.0 at any tolerance and all existing references stay unchanged (verified by recomputing them at 1 ppm and 10 ppm).New test
TOPP_IsobaricWorkflow_purity_tolerance: the same run onIsobaricWorkflow_purity_in.mzML, a copy of the fixture whose MS1 carries one extra peak 0.004 Th above the strict upper border of scan 24217's isolation window, with twice the precursor's intensity. At the default 10 ppm the fuzzy border is 0.0077 Th at m/z 769, the peak counts half into the total intensity and the purity is 0.5; at 1 ppm (0.00077 Th) it lies outside and the purity is 1.0. The other four scans keep purity 1.0.The reference
IsobaricWorkflow_purity_out.consensusXMLisIsobaricWorkflow_1_out.consensusXMLwith the file name and that one feature's two purity values adjusted. I could not build OpenMS in this environment, so the expected 0.5 comes from a line-by-line port ofcomputeSingleScanPrecursorPuritiesrun on the new fixture (and the port reproduces the 1.0 of the existing references at both tolerances). The value is exact in float arithmetic (I / (I + 0.5 × 2I)), so FuzzyDiff tolerances are not involved. CI will confirm.Also added a CHANGELOG entry under TOPP tools.
🤖 Generated with Claude Code
https://claude.ai/code/session_0116xbaQQJpHtmofZc5FirfT
Generated by Claude Code
Summary by CodeRabbit