Skip to content

[FIX] QCCalculator: TIC and RIC slump percentages divide by the right count - #10712

Merged
timosachsenberg merged 1 commit into
developfrom
claude/charming-ride-nrnkyj-qc
Oct 26, 2026
Merged

timosachsenberg merged 1 commit into
developfrom
claude/charming-ride-nrnkyj-qc

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Description

#10148 CPP-160. 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 QCCalculator reports 0 % on essentially every real run. On small inputs the value can 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 QC:0000023;
  • the number of MS1 spectra for QC:0000057.

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 %.

QCCalculator, QC:0000057 value
develop 8dd24c3 0
this branch 17.341306347746091

The 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 against develop's library and passes with this change.
  • QCCalculator_1 reference: 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.
  • Full local run: Linux Release build (Ubuntu 24.04 system packages, shared Arrow 23); ctest passes 3,118 of 3,119. The exception is QPXDatasetExport_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

  • Make sure that you are listed in the AUTHORS file
  • I have commented my code, particularly in hard-to-understand areas
  • New and existing unit tests pass locally with my changes
  • Updated or added python bindings for changed or new classes (Tick if no updates were necessary.)

Generated by Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Quality-control reports now calculate the percentage of low-intensity points using the selected total ion chromatogram’s data points.
    • RIC slump percentages now use MS1 spectra counts, rather than all spectra, for a more accurate result.
    • Both percentages return 0 when their respective data sets are empty, avoiding invalid values.

… 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
@coderabbitai

coderabbitai Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f6d897ec-0e4c-4e11-a4c1-bc54d7c2b619
Commits

Reviewing files that changed from the base of the PR and between 8dd24c3 and a6f227b.

Files selected for processing: 3
  • src/openms/source/FORMAT/QcMLFile.cpp
  • src/tests/class_tests/openms/source/QcMLFile_test.cpp
  • src/tests/topp/QCCalculator_1_output.qcML

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

QcMLFile::collectQCData now calculates TIC slump using TIC points and RIC slump using MS1 spectra. Both calculations return zero when their respective counts are zero. Tests cover the exported percentages and update the expected qcML values.

Changes: QcML slump percentages

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: Normal

Change: Bug fix

Merge Risk: Minimal · up to a6f22

The percentage correction has no identified issue that needs resolution before merging.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning 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 … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed 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 identifies the main change: correcting the denominators for TIC and RIC slump percentages in QCCalculator.
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 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.

❤️ Share

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 timosachsenberg left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@timosachsenberg
timosachsenberg merged commit 6b025ae into develop Oct 26, 2026
33 checks passed
@timosachsenberg
timosachsenberg deleted the claude/charming-ride-nrnkyj-qc branch October 26, 2026 10:47
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