Bug fix for reads that completely fall within an insertion: the I cigar string element was 1 base too long.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4482 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
ebanks 2010-10-12 14:46:21 +00:00
parent f348ca2976
commit 69652e08c6
1 changed files with 5 additions and 1 deletions

View File

@ -923,7 +923,11 @@ public class IndelRealigner extends ReadWalker<Integer, Integer> {
if ( indelCE.getOperator() == CigarOperator.I ) {
// for reads that end in an insertion
if ( myPosOnAlt + aRead.getReadLength() < endOfFirstBlock + indelCE.getLength() ) {
readCigar.add(new CigarElement(myPosOnAlt + aRead.getReadLength() - endOfFirstBlock, CigarOperator.I));
int partialInsertionLength = myPosOnAlt + aRead.getReadLength() - endOfFirstBlock;
// if we also started inside the insertion, then we need to modify the length by 1 base
if ( !sawAlignmentStart )
partialInsertionLength--;
readCigar.add(new CigarElement(partialInsertionLength, CigarOperator.I));
aRead.setCigar(readCigar);
return true;
}