Fixed index for getSoftUnclippedEnd()
Unclipped end can be calculated simply by looking at the last cigar element and adding it's length in case it's a soft clip.
This commit is contained in:
parent
07c1e113cd
commit
ed8f769dce
|
|
@ -670,10 +670,11 @@ public class ReadUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getSoftUnclippedStop(SAMRecord read) {
|
public static int getSoftUnclippedStop(SAMRecord read) {
|
||||||
int stop = getSoftUnclippedStart(read);
|
int stop = read.getAlignmentEnd();
|
||||||
for (CigarElement cigarElement : read.getCigar().getCigarElements())
|
List<CigarElement> cigarElementList = read.getCigar().getCigarElements();
|
||||||
if (cigarElement.getOperator().consumesReadBases())
|
CigarElement lastCigarElement = cigarElementList.get(cigarElementList.size()-1);
|
||||||
stop += cigarElement.getLength();
|
if (lastCigarElement.getOperator() == CigarOperator.SOFT_CLIP)
|
||||||
|
stop += lastCigarElement.getLength();
|
||||||
return stop;
|
return stop;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue