Conversation
…odles Coordinate-math correctness pass driven by a differential test against bladerunner, aimed at letting bladerunner link bedpull as a library. - Fix boundary-coincidence bug in get_read_cuts: a read whose alignment began/ended exactly at a region boundary was mis-sliced or silently dropped (BAM/CRAM path). Replace the `start > 0` sentinel with an explicit found_start flag + op-entry guard; the op-level `== ref_end` shortcut no longer skips a mid-op ref_start crossing. - get_read_cuts now takes align_end (exclusive) and clamps its fire-on boundaries to the alignment span internally, so partial reads return a real slice instead of a read_end == 0 sentinel. - ReadCuts gains softclip_lead_start / softclip_trail_end, making its layout field-identical to bladerunner's ReadCuts. - Simplify resolve_cuts: spanning is decided by align coverage, not by un-swapping sentinel fields. Real-data BAM/CRAM tests unchanged (40 spanning / 44 partial). - Bump noodles 0.110 -> 0.111 to match bladerunner across the boundary. - Add regression battery for the boundary cases and soft-clip fields; update CHANGELOG and version.
…odles Coordinate-math correctness pass driven by a differential test against bladerunner, aimed at letting bladerunner link bedpull as a library. - Fix boundary-coincidence bug in get_read_cuts: a read whose alignment began/ended exactly at a region boundary was mis-sliced or silently dropped (BAM/CRAM path). Replace the `start > 0` sentinel with an explicit found_start flag + op-entry guard; the op-level `== ref_end` shortcut no longer skips a mid-op ref_start crossing. - get_read_cuts now takes align_end (exclusive) and clamps its fire-on boundaries to the alignment span internally, so partial reads return a real slice instead of a read_end == 0 sentinel. - ReadCuts gains softclip_lead_start / softclip_trail_end, making its layout field-identical to bladerunner's ReadCuts. - Simplify resolve_cuts: spanning is decided by align coverage, not by un-swapping sentinel fields. Real-data BAM/CRAM tests unchanged (40 spanning / 44 partial). - Bump noodles 0.110 -> 0.111 to match bladerunner across the boundary. - Add regression battery for the boundary cases and soft-clip fields; update CHANGELOG and version.
get_bam_reads/get_cram_reads returned ref_start/ref_end in the 1-based CIGAR-walk frame, but the |missing_left/right header suffix compares them against 0-based BED coordinates — so every fully-spanning read was mislabelled missing_left=1bp. Normalise the returned coordinates to 0-based at the reads-layer boundary (lengths unchanged, so the partial coverage check is unaffected). Pre-existing since v0.2.0; only the header text was wrong, never the extracted sequence. Add an end-to-end regression test via the read_bed (+1-shifted) path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[0.3.0] — 2026-07-21
Coordinate-math correctness pass, driven by a differential test against
bladerunner and aimed at letting bladerunner link
bedpullas a library.Fixed
Boundary-coincidence bug in
get_read_cuts— a read whose alignment began (or ended)exactly at a region boundary was mis-sliced or silently dropped. The
start > 0sentinelconflated "start not found yet" with "start found at read offset 0". Replaced with an explicit
found_startflag plus an op-entry guard, and the op-level== ref_endshortcut no longerskips a mid-op
ref_startcrossing. This affected BAM/CRAM extraction (the PAF path alreadyrouted around it via
read_pos_at_ref).Spurious
missing_left=1bpon fully-spanning BAM/CRAM reads —get_bam_reads/get_cram_readsreturnedref_start/ref_endin the 1-based CIGAR-walk frame while theheader suffix compared them against 0-based BED coordinates, so every spanning read was
mislabelled as missing 1bp on the left. The returned coordinates are now normalised to
0-based (a pre-existing bug, also present in v0.2.0; extraction/sequences were never affected).
Changed
get_read_cutssignature is nowget_read_cuts(cigar_ops, align_start, align_end, region_start, region_end). It takes thealignment end and clamps its fire-on boundaries to the alignment span internally
(
ref_start = max(region_start, align_start),ref_end = min(region_end, align_end)), so apartially-overlapping read yields a real slice instead of a
read_end == 0sentinel.region_start/region_endare the desired (flank-expanded) window; the caller no longerpre-clamps.
align_endis exclusive (one past the last reference base) — callers usingnoodles' inclusive
alignment_end()must add 1.ReadCutsgainssoftclip_lead_startandsoftclip_trail_end(read offsets of theleading/trailing soft-clip runs; equal to
read_start/read_endwhen no extension isavailable). Layout is now field-identical to bladerunner's
ReadCuts.0.110→0.111to match bladerunner across the crate boundary.Added