Skip to content

Fix to CollectSamErrorMetrics getIndelOperator function to check operator type#2041

Open
tfenne wants to merge 1 commit intomasterfrom
tf_CollectSamErrorMetrics_getIndelOperatorFix
Open

Fix to CollectSamErrorMetrics getIndelOperator function to check operator type#2041
tfenne wants to merge 1 commit intomasterfrom
tf_CollectSamErrorMetrics_getIndelOperatorFix

Conversation

@tfenne
Copy link
Copy Markdown
Collaborator

@tfenne tfenne commented Mar 24, 2026

Description

The getIndelOperator function in ReadBaseStratifier takes a RecordAndOffset and 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 null is 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

  • Added or modified tests to cover changes and any new functionality
  • Edited the README / documentation (if applicable)
  • All tests passing on github actions

Review

  • Final thumbs-up from reviewer
  • Rebase, squash and reword as applicable

For more detailed guidelines, see https://github.com/broadinstitute/picard/wiki/Guidelines-for-pull-requests

… operator within a cigar, that the identified operater at the requested offset is actually of the expected type (insertion or deletion).
Copy link
Copy Markdown
Contributor

@yfarjoun yfarjoun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be logged? (can it be easily logged ?)

seems like if sli isn't buggy, this should never happen...

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.

2 participants