Skip to content

fix(FeatureFinderAlgorithmPicked): swap pattern/trace mz_tolerance assignments (#9247) - #9250

Merged
timosachsenberg merged 1 commit into
developfrom
fix/ffap-tolerance-swap-9247
Apr 30, 2026
Merged

timosachsenberg merged 1 commit into
developfrom
fix/ffap-tolerance-swap-9247

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Fixes FeatureFinderAlgorithmPicked #9247. FeatureFinderAlgorithmPicked::updateMembers_() was assigning mass_trace:mz_tolerance to pattern_tolerance_ and isotopic_pattern:mz_tolerance to trace_tolerance_ — the opposite of what the variable names and every call site expect.
  • The variable semantics are clear from usage:
    • pattern_tolerance_ is consumed by findIsotope_() (isotopic pattern position scoring at FeatureFinderAlgorithmPicked.cpp:1623,1644,1665).
    • trace_tolerance_ is consumed by feature_traces.isValid(seed_mz, trace_tolerance_) for mass-trace validation (:640, :2064) and trace-extension position scores (:323, :334, :1538).
  • Both parameters default to 0.03, which is why the swap stayed latent — only users who tuned the two tolerances independently were affected, and silently.
  • Also corrects the doxygen comments in FeatureFinderAlgorithmPicked.h that were documenting the buggy mapping.

Test plan

  • Build OpenMS (cmake --build OpenMS-build -j$(nproc))
  • ctest --test-dir OpenMS-build -R FeatureFinder — existing FFAP tests should still pass since defaults are unchanged.
  • Manual sanity check with a featureXML where isotopic_pattern:mz_tolerance and mass_trace:mz_tolerance are deliberately set to different values: confirm the trace tolerance now drives mass-trace extension and the pattern tolerance now drives isotope matching.

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Corrected the assignment of mz tolerance parameters in feature detection to ensure proper tolerance application during mass-trace validation and isotope-pattern matching.

…signments (#9247)

`updateMembers_()` assigned `mass_trace:mz_tolerance` to `pattern_tolerance_`
and `isotopic_pattern:mz_tolerance` to `trace_tolerance_`, the opposite of
what the variable names and call sites expect (`pattern_tolerance_` is used
in `findIsotope_()` for isotopic-pattern position scoring; `trace_tolerance_`
is used in `feature_traces.isValid()` for mass-trace validation). Both
parameters share the default value 0.03, which is why the bug stayed latent
until users tuned them independently.

Also corrects the doxygen comments in the header that documented the buggy
mapping.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 37990d4f-2e07-44c3-9944-a8a484a374f7

📥 Commits

Reviewing files that changed from the base of the PR and between 6ddec4c and 93cd392.

📒 Files selected for processing (2)
  • src/openms/include/OpenMS/FEATUREFINDER/FeatureFinderAlgorithmPicked.h
  • src/openms/source/FEATUREFINDER/FeatureFinderAlgorithmPicked.cpp

📝 Walkthrough

Walkthrough

This change corrects parameter-to-member variable mappings in FeatureFinderAlgorithmPicked::updateMembers_(). The method now assigns isotopic_pattern:mz_tolerance to pattern_tolerance_ and mass_trace:mz_tolerance to trace_tolerance_, fixing reversed assignments. Header documentation is updated to reflect the corrected logic.

Changes

Cohort / File(s) Summary
Parameter Assignment Correction
src/openms/source/FEATUREFINDER/FeatureFinderAlgorithmPicked.cpp
Swapped parameter assignments in updateMembers_() to correctly map isotopic_pattern:mz_tolerance → pattern_tolerance_ and mass_trace:mz_tolerance → trace_tolerance_
Documentation Update
src/openms/include/OpenMS/FEATUREFINDER/FeatureFinderAlgorithmPicked.h
Updated inline member variable documentation comments for pattern_tolerance_ and trace_tolerance_ to reflect corrected parameter mappings

Poem

🐰 A tolerance mix-up, oh what a plight,
Where patterns and traces were swapped left and right!
But now they're aligned with their true names at last,
This parameter puzzle corrected—bug fixed, problem passed! ✨

🚥 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%. 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 fix: swapping the incorrectly assigned pattern/trace mz_tolerance parameters in FeatureFinderAlgorithmPicked.
Linked Issues check ✅ Passed The pull request fully addresses issue #9247: swapping pattern_tolerance_ and trace_tolerance_ assignments, updating documentation, and restoring correct parameter-to-member mapping.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the tolerance assignment bug: updates to .h header comments and .cpp assignment logic, with no extraneous modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

📋 Issue Planner

Built with CodeRabbit's Coding Plans for faster development and fewer bugs.

View plan used: #9247

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ffap-tolerance-swap-9247

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
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

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

@timosachsenberg
timosachsenberg merged commit bd26c5b into develop Apr 30, 2026
44 checks passed
@timosachsenberg
timosachsenberg deleted the fix/ffap-tolerance-swap-9247 branch April 30, 2026 12:24
timosachsenberg pushed a commit that referenced this pull request May 1, 2026
Add missing entries for:
- HiGHS LP solver as third LP backend alternative (#9246)
- Fix: FeatureFinderAlgorithmPicked mz_tolerance parameter swap (#9247, #9250)

Co-authored-by: GitHub Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
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.

FeatureFinderAlgorithmPicked

1 participant