Skip to content

fix: correct off-by-one in centered_query_start/end for minus strand and add missing wide format header column#98

Merged
mrvollger merged 1 commit intomainfrom
fix/center-minus-strand-off-by-one
Feb 3, 2026
Merged

fix: correct off-by-one in centered_query_start/end for minus strand and add missing wide format header column#98
mrvollger merged 1 commit intomainfrom
fix/center-minus-strand-off-by-one

Conversation

@mrvollger
Copy link
Member

centered_query_start and centered_query_end were off by 1 on the minus strand because the half-open interval [start, end) was negated as [-end, -start) instead of the correct [-end+1, -start+1). This caused m6a positions to index into the wrong base when users sliced query_sequence[-centered_query_end:] for minus strand reads. The fix converts to inclusive coordinates before negation and back to exclusive after, matching the existing correct logic in apply_offset_helper().

Also adds the missing fire_qual column name to the wide format header so the header column count (22) matches the data.

…and add missing wide format header column

`centered_query_start` and `centered_query_end` were off by 1 on the minus strand
because the half-open interval [start, end) was negated as [-end, -start) instead of
the correct [-end+1, -start+1). This caused m6a positions to index into the wrong
base when users sliced `query_sequence[-centered_query_end:]` for minus strand reads.
The fix converts to inclusive coordinates before negation and back to exclusive after,
matching the existing correct logic in `apply_offset_helper()`.

Also adds the missing `fire_qual` column name to the wide format header so the header
column count (22) matches the data.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@mrvollger mrvollger merged commit e51bb03 into main Feb 3, 2026
9 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.

1 participant