Better implementation of GATKSAMRecord.getSoftStart()
This commit is contained in:
parent
deca564aef
commit
f08e5a44da
|
|
@ -387,14 +387,10 @@ public class GATKSAMRecord extends BAMRecord {
|
|||
*/
|
||||
public int getSoftStart() {
|
||||
if (softStart < 0) {
|
||||
int start = this.getUnclippedStart();
|
||||
for (CigarElement cigarElement : this.getCigar().getCigarElements()) {
|
||||
if (cigarElement.getOperator() == CigarOperator.HARD_CLIP)
|
||||
start += cigarElement.getLength();
|
||||
else
|
||||
break;
|
||||
}
|
||||
softStart = start;
|
||||
softStart = getAlignmentStart();
|
||||
final CigarElement firstCig = getCigar().getCigarElement(0);
|
||||
if (firstCig.getOperator() == CigarOperator.HARD_CLIP)
|
||||
softStart -= firstCig.getLength();
|
||||
}
|
||||
return softStart;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue