Repository navigation
fix(FragmentIndex): truncate SNES mothers to unambiguous spans on X/B/Z (#9192) - #9224
Conversation
Approach C: keep protein-level fast path for the no-ambiguous-residue case; on proteins containing X/B/Z, split into contiguous unambiguous spans and sweep Single-N / Single-C mothers per span. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Spell out shared test parameter block (mirrors existing test 2419) and use isSingleCMother(mod_bitmask_) for mother classification — is_single_c is not a direct field on Peptide. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
… item 2) Three tasks: failing tests, span-split sweep implementation, regression verification. Tracks the spec at 2026-04-27-snes-xbz-truncate-design.md. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Add two failing tests asserting that Single-N / Single-C mother peptides whose proposed window spans an X/B/Z residue still emit a truncated mother covering the unambiguous prefix or suffix at the same anchor. Currently the whole mother is dropped — see issue #9192 item 2.
…n test Code-review follow-up: the Single-N section asserts `start > 8u || end <= 8u` for every kept mother. With max_size=12, an off-by-one bug in the upcoming Single-C span-truncation fix could emit a mother starting at position 8 (spanning the X) and the Single-C test would still pass on its existence check alone. Mirror the invariant.
Previously, when a SNES mother peptide's proposed window overlapped an X/B/Z residue, the whole mother was dropped — losing valid shorter realizations anchored at the same terminus that did not span the ambiguous residue. Now generateSNESMothers_ splits each protein containing X/B/Z into contiguous unambiguous spans and runs the Single-N / Single-C sweeps within each span, with the length cap enforced per-span. Proteins without X/B/Z take the same single-span fast path as before. The emitMother lambda no longer carries an X/B/Z check — span boundaries are now structural. Closes #9192 (item 2; item 1 tracked separately).
Code-review follow-up to the SNES X/B/Z truncation fix. After the
refactor:
- The skipped_peptides counter now counts only spans shorter than
peptide:min_size; X/B/Z overlap no longer rejects mothers, it
truncates them. Update the log line accordingly.
- The if/else dispatch was framed as fast vs slow path, but both
branches call find_first_of("XBZ") exactly once unconditionally —
the split is organizational, not a perf optimization. Reword.
- Annotate the two distinct break exits in the span-walk loop.
No behavior change.
End-of-branch review nits: - emitMother comment still referenced "fast path" / "slow path" labels that were removed from the dispatch block in the previous commit. Reword to describe the actual mechanism (dispatch via sweepSpan vs span-split walk) so the comment has a referent in surrounding code. - Test comment "must still be emitted" implied the truncated mother was already emitted before the fix. Switch to "must now be emitted" to make the post-fix expectation explicit. No behavior change. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR implements span-based truncation for SNES mother peptide generation when X/B/Z ambiguous residues are encountered, replacing per-mother rejection with splitting into contiguous unambiguous regions. The implementation includes design specifications, core algorithm refactoring, and regression test coverage. Changes
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
These are working planning artifacts and shouldn't live in the repo. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Add missing entries for: - #9221: pyOpenMS standalone/cibuildwheel Arrow 24.x CMake fix - #9218: PercolatorAdapter in-process Percolator rescoring backend - #9224: ProSE/FragmentIndex SNES X/B/Z mother truncation fix - #9223: OpenSwathWorkflow macOS arm64 duplicate TLS symbol fix Co-authored-by: GitHub Copilot <[email protected]> Co-authored-by: Copilot <[email protected]>
Add missing CHANGELOG entries for 4 recent code PRs that were not yet documented: - #9218: feat(Percolator) in-process backend — new OpenMS::Percolator class (vendored Percolator 3.08 + TRON solver) and PercolatorAdapter -use_subprocess flag; entries added under OpenMS Library Added and TOPP tools PercolatorAdapter sections. - #9221: fix(cmake) Arrow 24.x in pyOpenMS standalone build — the cibuildwheel CMakeLists.txt version pin now dropped like #9196; entry added under Dependencies. - #9223: fix(openswath) duplicate TLS init symbol on macOS arm64/clang — g_picker_pool_shared moved from inline thread_local in header to a single .cpp definition; entry added under OpenSwathWorkflow. - #9224: fix(FragmentIndex) SNES mothers truncated at X/B/Z residues — proteins with ambiguous residues split into unambiguous spans for SNES indexing; entry added under ProSE. Co-authored-by: GitHub Copilot <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: timosachsenberg <[email protected]>
Summary
Test plan
Notes for reviewers
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation
Tests