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() {
|
public int getSoftStart() {
|
||||||
if (softStart < 0) {
|
if (softStart < 0) {
|
||||||
int start = this.getUnclippedStart();
|
softStart = getAlignmentStart();
|
||||||
for (CigarElement cigarElement : this.getCigar().getCigarElements()) {
|
final CigarElement firstCig = getCigar().getCigarElement(0);
|
||||||
if (cigarElement.getOperator() == CigarOperator.HARD_CLIP)
|
if (firstCig.getOperator() == CigarOperator.HARD_CLIP)
|
||||||
start += cigarElement.getLength();
|
softStart -= firstCig.getLength();
|
||||||
else
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
softStart = start;
|
|
||||||
}
|
}
|
||||||
return softStart;
|
return softStart;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue