fixed soft unclipped calculation
* getRefCoordSoftUnclippedEnd was not resetting the shift when hitting insertions. Fixed. * getReadCoordinateForReferenceCoordinateBeforeAlignmentEnd was returning the wrong read coordinate position. Fixed.
This commit is contained in:
parent
39d8dccc9c
commit
0cd9438ac2
|
|
@ -680,6 +680,8 @@ public class ReadUtils {
|
||||||
lastOperator = cigarElement.getOperator();
|
lastOperator = cigarElement.getOperator();
|
||||||
if (cigarElement.getOperator().consumesReferenceBases() || cigarElement.getOperator() == CigarOperator.SOFT_CLIP || cigarElement.getOperator() == CigarOperator.HARD_CLIP)
|
if (cigarElement.getOperator().consumesReferenceBases() || cigarElement.getOperator() == CigarOperator.SOFT_CLIP || cigarElement.getOperator() == CigarOperator.HARD_CLIP)
|
||||||
shift = cigarElement.getLength();
|
shift = cigarElement.getLength();
|
||||||
|
else
|
||||||
|
shift = 0;
|
||||||
}
|
}
|
||||||
return (lastOperator == CigarOperator.HARD_CLIP) ? stop-1 : stop+shift-1 ;
|
return (lastOperator == CigarOperator.HARD_CLIP) ? stop-1 : stop+shift-1 ;
|
||||||
}
|
}
|
||||||
|
|
@ -710,8 +712,8 @@ public class ReadUtils {
|
||||||
*/
|
*/
|
||||||
@Requires({"refCoord <= read.getUnclippedEnd()", "refCoord > read.getAlignmentEnd()"})
|
@Requires({"refCoord <= read.getUnclippedEnd()", "refCoord > read.getAlignmentEnd()"})
|
||||||
private static int getReadCoordinateForReferenceCoordinateBeforeAlignmentEnd(SAMRecord read, int refCoord) {
|
private static int getReadCoordinateForReferenceCoordinateBeforeAlignmentEnd(SAMRecord read, int refCoord) {
|
||||||
if (getRefCoordSoftUnclippedEnd(read) > refCoord)
|
if (getRefCoordSoftUnclippedEnd(read) >= refCoord)
|
||||||
return refCoord - read.getAlignmentEnd() + 1;
|
return refCoord - getRefCoordSoftUnclippedStart(read) + 1;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue