Fix SamLocusIterator so that read position is not incorrectly offset …#1758
Merged
Fix SamLocusIterator so that read position is not incorrectly offset …#1758
Conversation
…after transiting insertions that fail the base quality check.
5 tasks
yfarjoun
requested changes
Mar 24, 2026
| for (final SamLocusIterator.RecordAndOffset rao : li.getInsertedInRecord()) { | ||
| // The second insertion's first base is at read offset 12. | ||
| // Before the fix, the drifted readBase would report offset 11. | ||
| Assert.assertEquals(rao.getOffset(), 12, |
Contributor
There was a problem hiding this comment.
please assert that we got to here (i.e. that the loops were not all trivially empty)
Co-authored-by: Yossi Farjoun <farjoun@gmail.com>
nh13
approved these changes
Apr 4, 2026
Co-authored-by: Nils Homer <nh13@users.noreply.github.com>
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.
…after transiting insertions that fail the base quality check.
Description
This fixes a bug in SamLocusIterator where during accumulation of indels, the position in the read (
readBase) was incorrectly failling to count indels that failed a base quality check. The result of this is that indels later in the read were then accumulated with incorrect read offsets.This affects any tool that uses the pileup engine with a base quality filter and cares about indels!
The added test fails without the accompanying change to SamLocusIterator.