Skip to content

[FIX] AssayGeneratorMetabo: apply the registered SiriusExportAlgorithm parameters (fixes #10120) - #10123

Merged
timosachsenberg merged 2 commits into
developfrom
claude/assaygeneratormetabo-apply-params-qreuxj
Sep 11, 2026
Merged

timosachsenberg merged 2 commits into
developfrom
claude/assaygeneratormetabo-apply-params-qreuxj

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fixes #10120.

AssayGeneratorMetabo registered the SiriusExportAlgorithm defaults on its command line (registerFullParam_) but never called setParameters() on its sirius_export_algorithm member. -feature_only, -filter_by_num_masstraces, -precursor_mz_tolerance, -precursor_mz_tolerance_unit and -precursor_rt_tolerance were therefore silently ignored; the tool even logged "Parameters passed to SiriusExportAlgorithm" with the untouched defaults.

Changes:

  • One helper siriusExportParamSubset_() builds the exposed subset (the two isotope-pattern options stay excluded, as before) and is used both for registration and for setParameters(getParam_().copySubset(...)) right before the algorithm is used, mirroring what SiriusExport.cpp does.
  • New TOPP test TOPP_AssayGeneratorMetabo_7: runs with -feature_only true -filter_by_num_masstraces 2. -feature_only true enables the mass-trace filter (otherwise the algorithm resets filter_by_num_masstraces to 1), and the filter drops the 15 of 24 input features that have a single mass trace. check_file_contains.cmake then asserts on the output that the compounds at RT 437.423 and 438.351 (produced only by single-trace features in the default output) are gone and that the compounds of the 2-, 4- and 7-trace features at RT 446.172, 448.028 and 461.815 are still present. Retained features can only gain MS2 assignments when neighbours are removed (closest-m/z assignment in FeatureMapping), so their rows cannot vanish. This needs no new fixture and catches both "parameters not wired through" and a header-only output. The existing tests do not pass any of the affected options, so their fixtures are unchanged.
  • CHANGELOG entry.

Note: this session has no build environment, so the change was written against the code but not executed locally. CI is the first run.

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 (not run locally, see note above)
  • Updated or added python bindings for changed or new classes (Tick if no updates were necessary.)

🤖 Generated with Claude Code

https://claude.ai/code/session_019UEHgs71nDGJrkfYTs8uRa

Summary by CodeRabbit

  • Bug Fixes

    • Fixed AssayGeneratorMetabo so Sirius export settings now take effect when configured.
    • The feature-only, mass-trace filtering, precursor m/z tolerance, tolerance unit, and precursor RT tolerance options are no longer silently ignored.
  • Tests

    • Added coverage verifying feature-only processing and mass-trace filtering behavior, including retained and excluded features.
  • Documentation

    • Updated the changelog to document the corrected Sirius export option behavior.

…meters

The tool registered the SiriusExportAlgorithm defaults on its command line
but never called setParameters() on the algorithm instance, so
-feature_only, -filter_by_num_masstraces, -precursor_mz_tolerance,
-precursor_mz_tolerance_unit and -precursor_rt_tolerance were silently
ignored (#10120). Register and apply the same parameter subset through one
helper, and add a TOPP test asserting that a parameter change changes the
output.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_019UEHgs71nDGJrkfYTs8uRa
@coderabbitai

coderabbitai Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

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: 3643ae1c-2d78-4c06-bd09-6843e75004f9

📥 Commits

Reviewing files that changed from the base of the PR and between 5fa931e and 631ff02.

📒 Files selected for processing (1)
  • src/tests/topp/CMakeLists.txt

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


📝 Walkthrough

Walkthrough

AssayGeneratorMetabo now applies its registered SiriusExportAlgorithm options. A TOPP test verifies that feature filtering changes the output. The changelog documents the corrected behavior.

Changes

AssayGeneratorMetabo parameter wiring

Layer / File(s) Summary
Apply SiriusExportAlgorithm parameters
src/topp/AssayGeneratorMetabo.cpp
The tool registers a shared SiriusExportAlgorithm parameter subset and passes user-provided values to the algorithm.
Validate parameter effects
src/tests/topp/CMakeLists.txt, CHANGELOG
A TOPP test checks retained and dropped feature RTs. The changelog documents the corrected options.

Priority: ➖ Normal

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 631ff

The corrected options are wired into the export algorithm and covered by a targeted output regression test; no actionable merge risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Issue #10120 requires the exposed SiriusExportAlgorithm parameters to reach sirius_export_algorithm before preprocessing(), plus a regression test. src/topp/AssayGeneratorMetabo.cpp now uses `…
Out of Scope Changes check ✅ Passed The changes address issue #10120. They modify parameter registration and application, add the related TOPP regression test, and add a related CHANGELOG entry. No unrelated implementation or test chang…
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: applying the registered SiriusExportAlgorithm parameters in AssayGeneratorMetabo. It also identifies the related issue.
Full details: Docstring Coverage

Explanation

Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/assaygeneratormetabo-apply-params-qreuxj

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 found parameters asleep in a row
Now Sirius receives them and filters the flow
Two, four, and seven traces remain
Single-trace features leave the lane
The changelog records the fix with care
And carrot-bright tests guard it there

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

Copy link
Copy Markdown
Contributor Author

Reviewed at 5fa931e. The production fix looks correct; I found no blocking correctness issue.

  • The shared subset forwards all five exposed options before preprocessing. setParameters() restores defaults for the two excluded isotope options, so their omission is safe.
  • Test improvement (nonblocking): TOPP_AssayGeneratorMetabo_7_out1 only asserts that output differs. Incorrect filtering—even a header-only output—would pass. Prefer an expected filtered fixture or assertions checking that specific compounds disappear and others remain. The current test does catch the original missing-forwarding regression.
  • Documentation nuance: feature_only enables mass-trace filtering here. Assay extraction already processes only assignedMS2, regardless of this setting; it does not switch between including and excluding unassigned spectra.

I would approve the implementation, with the stronger test as a nonblocking improvement. I did not run the TOPP tests locally; both reported CI workflows were still running when checked during this review.

…main

Replace the "output differs" check with explicit content assertions via
check_file_contains.cmake: the compounds of the single-mass-trace features
must be gone, those of multi-trace features must still be present.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_019UEHgs71nDGJrkfYTs8uRa

Copy link
Copy Markdown
Contributor Author

Thanks. Test strengthened in 631ff02: the WILL_FAIL diff is replaced by check_file_contains.cmake assertions on the filtered output — the compounds at RT 437.423 and 438.351 (only single-trace features produce them in the default output) must be absent, the compounds of the 2-, 4- and 7-trace features at RT 446.172, 448.028 and 461.815 must be present. A header-only or wrongly filtered output now fails. An expected fixture would still be the gold standard; I cannot generate one without a build, so this stays as the regression check until someone with a build wants to pin the full output. The feature_only wording in the test comment and PR description now says what it does here (enables the mass-trace filter), not that it toggles unassigned spectra.


Generated by Claude Code

@timosachsenberg
timosachsenberg merged commit d81897c into develop Sep 11, 2026
35 checks passed
@timosachsenberg
timosachsenberg deleted the claude/assaygeneratormetabo-apply-params-qreuxj branch September 11, 2026 15:10
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.

AssayGeneratorMetabo registers SiriusExportAlgorithm parameters but never applies them

2 participants