Skip to content

SAMFragment.getReferenceEndPosition() returns wrong position when Fragments have deletions #10

Description

@charcuterie

SAMFragment.getReferenceEndPosition() currently calculates the end position with

record.getAlignmentStart() + this.size() - 1;

This is a problem, because this.size() returns the number of bases in the Annotation. An Annotation which aligns to a 20-bp stretch of reference, but has one deletion, will have a (correct) size of 19, and so the calculated reference end position will be off by one. An equivalent alignment with 2 deletions will have a correct size of 18, and the calculated reference end position wil lbe off by two, and so on.

The method originally used "record.getAlignmentEnd()", but this line has been commented out with a note that the Picard CIGAR Parser is incorrect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions