Fix to CollectSamErrorMetrics getIndelOperator function to check operator type#2041
Open
Fix to CollectSamErrorMetrics getIndelOperator function to check operator type#2041
Conversation
… operator within a cigar, that the identified operater at the requested offset is actually of the expected type (insertion or deletion).
yfarjoun
approved these changes
Mar 24, 2026
Contributor
yfarjoun
left a comment
There was a problem hiding this comment.
should this be logged? (can it be easily logged ?)
seems like if sli isn't buggy, this should never happen...
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.
Description
The getIndelOperator function in ReadBaseStratifier takes a
RecordAndOffsetand is intended to return either the Insertion or Deletion Cigar element found in that read's cigar at that offset, depending on whether the RecordAndOffset represents an insertion of deletion operation.It appears to function correctly if and only if passed RecordAndOffsets that are also correct - i.e. correctly identify an insertion or deletion within a read at an accurate offset. However, when an incorrect offset is given for an insertion (as triggered by this bug in HTSJDK, it will erroneously return any cigar element with an operator that consumes read bases.
This PR adds a test to highlight that invalid input causes this problem, and ensure that in that case
nullis returned instead of an incorrect cigar element.Checklist (never delete this)
Never delete this, it is our record that procedure was followed. If you find that for whatever reason one of the checklist points doesn't apply to your PR, you can leave it unchecked but please add an explanation below.
Content
Review
For more detailed guidelines, see https://github.com/broadinstitute/picard/wiki/Guidelines-for-pull-requests