border case bug fixes
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@951 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
fecba2cae5
commit
b45b1d5f2b
|
|
@ -539,7 +539,7 @@ public class IntervalCleanerWalker extends LocusWindowWalker<Integer, Integer>
|
|||
switch ( ce.getOperator() ) {
|
||||
case M:
|
||||
for (int k = 0 ; k < ce.getLength() ; k++, refIdx++, altIdx++ ) {
|
||||
if ( Character.toUpperCase(readStr.charAt(altIdx)) != Character.toUpperCase(reference.charAt(refIdx)) )
|
||||
if ( refIdx < reference.length() && Character.toUpperCase(readStr.charAt(altIdx)) != Character.toUpperCase(reference.charAt(refIdx)) )
|
||||
cleanedMismatchBases[refIdx] += (int)qualStr.charAt(altIdx) - 33;
|
||||
}
|
||||
break;
|
||||
|
|
@ -626,7 +626,6 @@ public class IntervalCleanerWalker extends LocusWindowWalker<Integer, Integer>
|
|||
// position, we will move insertion left, to the position right after CA. This way, while moving the indel across the repeat
|
||||
// on the ref, we can theoretically move it across a non-repeat on the read if the latter has a mismtach.
|
||||
|
||||
|
||||
while ( period < indel_length ) { // we will always get at least trivial period = indelStringLength
|
||||
|
||||
period = BaseUtils.sequencePeriod(indelString, period+1);
|
||||
|
|
@ -643,7 +642,7 @@ public class IntervalCleanerWalker extends LocusWindowWalker<Integer, Integer>
|
|||
boolean match = true;
|
||||
|
||||
for ( int testRefPos = newIndex - period, indelPos = 0 ; testRefPos < newIndex; testRefPos++, indelPos++) {
|
||||
if ( Character.toUpperCase(refSeq.charAt(testRefPos)) != indelString.charAt(indelPos) ) {
|
||||
if ( Character.toUpperCase(refSeq.charAt(testRefPos)) != indelString.charAt(indelPos) || indelString.charAt(indelPos) == 'N' ) {
|
||||
match = false;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ public class AlignmentUtils {
|
|||
switch ( ce.getOperator() ) {
|
||||
case M:
|
||||
for (int j = 0 ; j < ce.getLength() ; j++, refIndex++, readIdx++ ) {
|
||||
if ( Character.toUpperCase(readSeq.charAt(readIdx)) != Character.toUpperCase(refSeq.charAt(refIndex)) )
|
||||
if ( refIndex < refSeq.length() && Character.toUpperCase(readSeq.charAt(readIdx)) != Character.toUpperCase(refSeq.charAt(refIndex)) )
|
||||
mismatches++;
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in New Issue