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) {
|
||||
int stop = getSoftUnclippedStart(read);
|
||||
for (CigarElement cigarElement : read.getCigar().getCigarElements())
|
||||
if (cigarElement.getOperator().consumesReadBases())
|
||||
stop += cigarElement.getLength();
|
||||
int stop = read.getAlignmentEnd();
|
||||
List<CigarElement> cigarElementList = read.getCigar().getCigarElements();
|
||||
CigarElement lastCigarElement = cigarElementList.get(cigarElementList.size()-1);
|
||||
if (lastCigarElement.getOperator() == CigarOperator.SOFT_CLIP)
|
||||
stop += lastCigarElement.getLength();
|
||||
return stop;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue