Repository navigation
[FIX] QCCalculator: TIC and RIC slump percentages divide by the right count - #10712
Conversation
… count QcMLFile::collectQCData computed both "TIC slump" (QC:0000023) and "percentage of ric slumps" (QC:0000057) as (100 / exp.size()) * below_10k. The integer division truncates to 0 for any run with more than 100 spectra, so both metrics were 0 on essentially every real run, and for small inputs the value could exceed 100 (the QCCalculator_1 reference held a TIC slump of 375 %). Each percentage now uses its own denominator: the number of points of the TIC chromatogram for the TIC slump, and the number of MS1 spectra for the RIC slump (both counted with the same 10k threshold as before). The QCCalculator_1 reference now holds 100 for both, which matches its input: all 3 MS1 spectra and all 15 TIC points are below 10k. (#10148, CPP-160) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_015aShmSX7mJScNWzC4x1qxt
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
TIC and RIC percentage calculations src/openms/source/FORMAT/QcMLFile.cpp, src/tests/class_tests/openms/source/QcMLFile_test.cpp, src/tests/topp/QCCalculator_1_output.qcML |
TIC slump uses the selected TIC chromatogram’s point count. RIC slump uses the MS1 spectrum count. Both calculations return zero when their counts are zero. The new test expects 25.0 for QC:0000057 and 40.0 for QC:0000023; the qcML test data updates its expected values to 100.0 for both measures. |
Possibly related issues
- OpenMS/OpenMS issue 10148: The issue covers confirmed core-library defects, including incorrect TIC and RIC slump percentages in
QcMLFile::collectQCData.
Priority:
Change: Bug fix
Merge Risk: 
Minimal · up to a6f22
-
The percentage correction has no identified issue that needs resolution before merging.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
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 2 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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 counts the TIC points with care,
Then checks MS1 spectra in the air.
Below ten thousand, each gets a place,
Zero counts return zero with grace.
The qcML numbers now match the trail,
And bunny hops off with a test passed tale.
Comment @coderabbitai help to get the list of available commands.
timosachsenberg
left a comment
There was a problem hiding this comment.
Reviewed the TIC/RIC percentage calculations and regression expectations at a6f227b. The denominators now match the counted observations, floating-point division is used, and zero counts are guarded. No substantive finding. Build and wheel CI passed; no local build was run.
Description
#10148 CPP-160.
QcMLFile::collectQCDatacomputed both TIC slump (QC:0000023) and percentage of ric slumps (QC:0000057) as(100 / exp.size()) * below_10k. The integer division truncates to 0 for any run with more than 100 spectra, so QCCalculator reports 0 % on essentially every real run. On small inputs the value can exceed 100: theQCCalculator_1reference held a TIC slump of 375 %.Each percentage now uses its own denominator:
The 10k threshold is unchanged.
Measurement on real data
Data: a TripleTOF 5600 DDA run from PRIDE PXD004884 (
ibludau_K160304_001, 57,560 spectra, 4,348 MS1). I counted MS1 spectra with summed intensity below 10k independently with pyOpenMS 3.6.0 (from PyPI): 754 of 4,348 = 17.34 %.develop8dd24c3The run has no TIC chromatogram, so QC:0000023 is not written for it. The new class test covers that branch.
The second-largest input I checked, the BSA example runs in
share/OpenMS/examples/BSA, have no MS1 spectra below 10k. So 0 is correct for them before and after.Tests
QcMLFile_test: a new section with 4 MS1 + 4 MS2 spectra and a 5-point TIC expects 25 % and 40 %. It fails againstdevelop's library and passes with this change.QCCalculator_1reference: the two slump values change from 375 / 75 to 100.0 / 100.0. That input has 3 MS1 spectra and 15 TIC points, all below 10k (checked independently with pyOpenMS). Nothing else in the reference changes.ctestpasses 3,118 of 3,119. The exception isQPXDatasetExport_test, which this branch does not touch; it does not compile against the local Arrow 23 (FileReader::ReadTable()signature). That run was on a tree that also contained the mzIdentML/mzTab fix from the companion PR [FIX] mzIdentML: C-terminal modifications at location length+1; mzTab: read optional PSM columns #10711; the two touch disjoint files.Checklist
Generated by Claude Code
Summary by CodeRabbit