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.
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.