Skip to content

[FIX] FLASHDeconv: sort the signal-decoy exclusion list before searching it - #10697

Merged
timosachsenberg merged 1 commit into
OpenMS:developfrom
okohlbacher:claude/flashdeconv-decoy-exclusion-sort
Oct 26, 2026
Merged

timosachsenberg merged 1 commit into
OpenMS:developfrom
okohlbacher:claude/flashdeconv-decoy-exclusion-sort

Conversation

@okohlbacher

@okohlbacher okohlbacher commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #10696.
In the signal-decoy run of SpectralDeconvolution::scoreAndFilterPeakGroups_, excluded_masses_for_decoy_runs_ is rebuilt as mono + j * iso_distance for j in [-allowed_isotope_error, allowed_isotope_error] per target, which is unsorted as soon as allowed_isotope_error >= 1. isPeakGroupInExcludedMassForDecoyRuns_ binary-searches it (std::upper_bound), so signal decoys overlapping a target could be kept.
Fix: sort the list after building it, as prepareSignalDecoyExclusions_ already does.
With -FD:report_FDR -FD:allowed_isotope_error 1: 737 → 733 signal-decoy rows on a small top-down file, 24,672 → 24,667 on a HeLa bottom-up file; target rows unchanged. Default settings, with and without FDR, give byte-identical output. The 14 FLASHDeconv/TOPDOWN tests pass. (Measured on a FLASHDeconv build carrying this commit on top of other, output-neutral performance changes; the commit itself applies cleanly to develop.)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved spectral deconvolution peak filtering when isotope-error tolerance is enabled, helping ensure signal and decoy peaks are evaluated consistently.

…ing it

scoreAndFilterPeakGroups_ rebuilds excluded_masses_for_decoy_runs_ as
mono + j * iso_distance for j in [-allowed_isotope_error, allowed_isotope_error]
per target, which is unsorted as soon as allowed_isotope_error >= 1.
isPeakGroupInExcludedMassForDecoyRuns_ uses std::upper_bound on it, so
signal decoys that overlap a target could be kept. With the default (0) the
list is already sorted and nothing changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Review in 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: 2231eaa6-ef5e-484c-bd82-9e3f1a9f5508
📥 Commits

Reviewing files that changed from the base of the PR and between 6173e49 and 3a9cd13.

📒 Files selected for processing: 1
  • src/openms/source/ANALYSIS/TOPDOWN/SpectralDeconvolution.cpp

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

📝 Walkthrough

The signal-decoy branch sorts its exclusion-mass list after adding isotope-offset masses. This prepares the list for the binary-search exclusion check when isotope errors are allowed.

Changes: Signal-decoy exclusion check

Layer / File(s) Summary
Sort exclusion masses before lookup
src/openms/source/ANALYSIS/TOPDOWN/SpectralDeconvolution.cpp
The signal-decoy branch sorts the populated exclusion-mass list before the binary-search check. The added comment notes that isotope-offset masses can interleave when allowed_isotope_error > 0.

Suggested reviewers: poshul

Priority: ⬇️ Low

Change: Bug fix · Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to 3a9cd

The signal-decoy exclusion list is now sorted before the affected search, addressing the missed-exclusion behavior. No remaining merge-blocking risk is evident.

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 1 files. 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 describes the main change: sorting the signal-decoy exclusion list before searching it.
Linked Issues check Passed Issue #10696 requires sorting the signal-decoy exclusion-mass list before binary search when isotope errors can interleave entries. The diff adds std::sort(excluded_masses_for_decoy_runs_.begin(), exc…
Out of Scope Changes check Passed The whole-PR diff changes only src/openms/source/ANALYSIS/TOPDOWN/SpectralDeconvolution.cpp. It adds the required sort and a comment that explains the binary-search invariant. Both changes directly su…
Full details: Linked Issues check

Explanation

Issue #10696 requires sorting the signal-decoy exclusion-mass list before binary search when isotope errors can interleave entries. The diff adds std::sort(excluded_masses_for_decoy_runs_.begin(), excluded_masses_for_decoy_runs_.end()) immediately after the signal-decoy list is built and before exclusion checks. The change directly satisfies the issue requirement. No additional coding requirement is stated.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff changes only src/openms/source/ANALYSIS/TOPDOWN/SpectralDeconvolution.cpp. It adds the required sort and a comment that explains the binary-search invariant. Both changes directly support issue #10696. No unrelated implementation or test changes are present.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • 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 checks the masses in a row,
Then sorts the list before searches go.
Isotope offsets find their place,
While decoys meet a tidier space.
One soft hop, and checks now flow.

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

@timosachsenberg timosachsenberg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good. isPeakGroupInExcludedMassForDecoyRuns_() binary-searches this list, and with allowed_isotope_error > 0 the offsets of neighbouring targets interleave, so it has to be sorted here, as prepareSignalDecoyExclusions_() already does. Thanks for the before/after counts: target rows unchanged, default settings byte-identical.


Generated by Claude Code

@timosachsenberg
timosachsenberg merged commit d1e1d26 into OpenMS:develop Oct 26, 2026
32 checks passed
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.

FLASHDeconv: signal-decoy exclusion list is binary-searched unsorted when allowed_isotope_error >= 1

2 participants