Skip to content

MaRaClusterAdapter: pass the precursor tolerance unit on to MaRaCluster - #10263

Merged
timosachsenberg merged 1 commit into
developfrom
claude/maracluster-da-units
Sep 26, 2026
Merged

timosachsenberg merged 1 commit into
developfrom
claude/maracluster-da-units

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Description

-precursor_tolerance_units Da had no effect: MaRaCluster always got the tolerance in ppm.

MaRaCluster takes the unit as the suffix of -p (20.0ppm, 0.05Da) and reads a value without one as ppm. The adapter mapped the unit to an index (ppm → 0, Da → 1) and appended that index as a digit instead:

  • the default 20 ppm reached MaRaCluster as -p 20.00, which is right by accident;
  • -precursor_tolerance 0.05 -precursor_tolerance_units Da reached it as -p 0.051, i.e. 0.051 ppm.

On the adapter's test inputs (3,374 spectra), 0.05 Da gives 1,946 consensus spectra; the 0.051 ppm it actually ran with gives 2,242.

Changes:

  • MaRaClusterAdapter.cpp: the -p value now carries the unit's name (0.05Da, 20.0ppm).
  • The option's description, tolerance_mass_units 0=ppm, 1=Da, described the old mapping. It now reads Unit of 'precursor_tolerance'., as in other tools, also in the two test INIs.
  • New TOPP_MaRaClusterAdapter_3: runs the adapter with 0.05 Da at -debug 4, where it logs the MaRaCluster command line, and requires -p 0.05Da in the output.
  • CHANGELOG entry under Fixes.

Verification (no full OpenMS build here): I built this MaRaClusterAdapter.cpp against the 2026-09-24 nightly package (its headers and libOpenMS_CLI) and ran the MaRaClusterAdapter tests as third_party_tests.cmake defines them:

Checklist

  • Make sure that you are listed in the AUTHORS file
  • Add relevant changes and new features to the CHANGELOG file
  • I have commented my code, particularly in hard-to-understand areas
  • New and existing unit tests pass locally with my changes: the MaRaClusterAdapter TOPP tests, run as described above (no full local build).
  • Updated or added python bindings for changed or new classes (Tick if no updates were necessary.)

How can I get additional information on failed tests during CI

Click to expand If your PR is failing you can check out

🤖 Generated with Claude Code

https://claude.ai/code/session_01NgnkdZCjwS6LE8cufGTDJU


Generated by Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Fixed precursor tolerance handling in MaRaClusterAdapter so values are passed with their selected units, allowing Da tolerances to be applied correctly.

MaRaCluster takes the unit as the suffix of -p ("20.0ppm", "0.05Da") and
reads a value without one as ppm. The adapter appended the index of the
chosen unit (0 for ppm, 1 for Da) as a digit instead. So the default
20 ppm reached MaRaCluster as '-p 20.00', which is right by accident, and
-precursor_tolerance 0.05 -precursor_tolerance_units Da as '-p 0.051',
i.e. 0.051 ppm. A tolerance in Da was never applied: on the adapter's
test inputs, 0.05 Da gives 1946 consensus spectra, the 0.051 ppm it ran
with 2242.

The value now carries the unit's name. The option's description,
"tolerance_mass_units 0=ppm, 1=Da", described the old mapping; it now
reads "Unit of 'precursor_tolerance'." as in other tools, also in the
two test INIs.

TOPP_MaRaClusterAdapter_3 runs the adapter with 0.05 Da at debug level
4, where it logs the MaRaCluster command line, and checks that the line
contains '-p 0.05Da'.

Checked by building MaRaClusterAdapter against the 2026-09-24 nightly
package (its headers and libOpenMS_CLI) and running the MaRaClusterAdapter
tests as third_party_tests.cmake defines them. With MaRaCluster 0.05.0
and the current references, and with 1.04.1 and the references
regenerated in #10259, tests 1 and 2 still pass and
TOPP_MaRaClusterAdapter_3 passes; with the nightly's unfixed adapter,
TOPP_MaRaClusterAdapter_3 fails.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NgnkdZCjwS6LE8cufGTDJU
@coderabbitai

coderabbitai Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 92a56a4c-029a-4efb-bd1d-118b9d19e2c9

📥 Commits

Reviewing files that changed from the base of the PR and between 8b25c6e and d95e2e0.

📒 Files selected for processing (5)
  • CHANGELOG
  • src/tests/topp/THIRDPARTY/MaRaClusterAdapter_1.ini
  • src/tests/topp/THIRDPARTY/MaRaClusterAdapter_2.ini
  • src/tests/topp/THIRDPARTY/third_party_tests.cmake
  • src/topp/MaRaClusterAdapter.cpp

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

MaRaClusterAdapter now passes precursor tolerances with their unit suffix, such as 0.05Da. The parameter descriptions and changelog were updated, and a third-party test checks that the Da suffix appears in the logged command line.

Changes

MaRaCluster tolerance units

Layer / File(s) Summary
Pass and verify the tolerance unit
src/topp/MaRaClusterAdapter.cpp, src/tests/topp/THIRDPARTY/MaRaClusterAdapter_*.ini, src/tests/topp/THIRDPARTY/third_party_tests.cmake, CHANGELOG
The adapter appends the selected unit to the tolerance value instead of a numeric unit index. Parameter descriptions now state that the option sets the unit of precursor_tolerance. The new test checks for -p 0.05Da in the logged command line. The changelog records the fix.

Suggested reviewers: cbielow

Merge Risk: ⚪ Minimal · up to d95e2

The change is intended to preserve the requested tolerance unit when invoking MaRaCluster, and the added test checks the Da form. No actionable merge-blocking risk is evident from the supplied context.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ 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 2 functions across 1 files. (4 skipped: 4 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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 describes the main change: passing the precursor tolerance unit from MaRaClusterAdapter to MaRaCluster.
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 2 functions across 1 files. (4 skipped: 4 unsupported.)

  • Fix all pre-merge checks with AI
✨ 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

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 checks the suffix with care,
“Da” now follows the value there.
The tests watch each command go by,
While ppm and Da pass nimbly.
The changelog notes the change today.

Comment @coderabbitai help to get the list of available commands.

@timosachsenberg
timosachsenberg merged commit a3867b6 into develop Sep 26, 2026
33 checks passed
@timosachsenberg
timosachsenberg deleted the claude/maracluster-da-units branch September 26, 2026 06:08
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