Fix for the HaplotypeScore optimization in AlignmentUtils
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5310 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
15dfac6bf7
commit
1129f1535d
|
|
@ -70,7 +70,7 @@ public class AlignmentUtils {
|
|||
* on the read of length <code>nReadBases</code> starting at (0-based) position <code>readIndex</code>.
|
||||
* @param r Aligned read to count mismatches for
|
||||
* @param refSeq Chunk of reference sequence that subsumes the alignment
|
||||
* @param refIndex Zero-based position on <code>refSeq</code> where the alighnment for the whole read starts
|
||||
* @param refIndex Zero-based position on <code>refSeq</code> where the alignment for the whole read starts
|
||||
* @param readIndex Zero-based position on the read, the mismatches will be counted only from this position on
|
||||
* @param nReadBases Length of continuous stretch on the read, along which mismatches will be counted
|
||||
* @return
|
||||
|
|
@ -491,7 +491,7 @@ public class AlignmentUtils {
|
|||
if(!atDeletion) {
|
||||
alignmentPos += elementLength;
|
||||
} else {
|
||||
if( pos + elementLength >= pileupOffset ) {
|
||||
if( pos + elementLength - 1 >= pileupOffset ) {
|
||||
return alignmentPos + (pileupOffset - pos);
|
||||
} else {
|
||||
pos += elementLength;
|
||||
|
|
@ -500,7 +500,7 @@ public class AlignmentUtils {
|
|||
}
|
||||
break;
|
||||
case M:
|
||||
if( pos + elementLength >= pileupOffset ) {
|
||||
if( pos + elementLength - 1 >= pileupOffset ) {
|
||||
return alignmentPos + (pileupOffset - pos);
|
||||
} else {
|
||||
pos += elementLength;
|
||||
|
|
@ -602,7 +602,7 @@ public class AlignmentUtils {
|
|||
if ( r.getReadUnmappedFlag() ) return true;
|
||||
|
||||
// our life would be so much easier if all sam files followed the specs. In reality,
|
||||
// sam files (including those generated by maq or bwa) miss headers alltogether. When
|
||||
// sam files (including those generated by maq or bwa) miss headers altogether. When
|
||||
// reading such a SAM file, reference name is set, but since there is no sequence dictionary,
|
||||
// null is always returned for referenceIndex. Let's be paranoid here, and make sure that
|
||||
// we do not call the read "unmapped" when it has only reference name set with ref. index missing
|
||||
|
|
@ -624,7 +624,7 @@ public class AlignmentUtils {
|
|||
if ( r.getMateUnmappedFlag() ) return true;
|
||||
|
||||
// our life would be so much easier if all sam files followed the specs. In reality,
|
||||
// sam files (including those generated by maq or bwa) miss headers alltogether. When
|
||||
// sam files (including those generated by maq or bwa) miss headers altogether. When
|
||||
// reading such a SAM file, reference name is set, but since there is no sequence dictionary,
|
||||
// null is always returned for referenceIndex. Let's be paranoid here, and make sure that
|
||||
// we do not call the read "unmapped" when it has only reference name set with ref. index missing
|
||||
|
|
|
|||
Loading…
Reference in New Issue