Small fixes for consistency in the numbers.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4103 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
ebanks 2010-08-24 20:48:25 +00:00
parent 7bbd67f3c4
commit cba5f05538
2 changed files with 7 additions and 2 deletions

View File

@ -97,6 +97,10 @@ public class IndelConsistencyReadCounter extends ReadWalker<Integer, Integer> {
private static boolean containsIndel(final SAMRecord r, final VariantContext vc) {
int indelStart = vc.getStart() + 1;
int readPos = r.getAlignmentStart();
if ( vc.isInsertion() && indelStart == readPos )
return true;
final Cigar cigar = r.getCigar();
int idx = 0;
@ -106,7 +110,6 @@ public class IndelConsistencyReadCounter extends ReadWalker<Integer, Integer> {
switch ( ce.getOperator() ) {
case M:
case I:
case S:
readPos += ce.getLength();
break;
default:

View File

@ -109,7 +109,9 @@ public class RealignedReadCounter extends ReadWalker<Integer, Integer> {
private int getIndelSize(SAMRecord read) {
for ( CigarElement ce : read.getCigar().getCigarElements() ) {
if ( ce.getOperator() == CigarOperator.I || ce.getOperator() == CigarOperator.D )
if ( ce.getOperator() == CigarOperator.I )
return 0;
if ( ce.getOperator() == CigarOperator.D )
return ce.getLength();
}
logger.warn("We didn't see an indel for this read: " + read.getReadName() + " " + read.getAlignmentStart() + " " + read.getCigar());