Actually a better implementation of GATKSAMRecord.getSoftStart(). Last commit was all wrong. Oops.
This commit is contained in:
parent
f7bd4998fc
commit
9c088fe3fe
|
|
@ -388,9 +388,14 @@ public class GATKSAMRecord extends BAMRecord {
|
|||
public int getSoftStart() {
|
||||
if (softStart < 0) {
|
||||
softStart = getAlignmentStart();
|
||||
final CigarElement firstCig = getCigar().getCigarElement(0);
|
||||
if (firstCig.getOperator() == CigarOperator.HARD_CLIP)
|
||||
softStart -= firstCig.getLength();
|
||||
for (final CigarElement cig : getCigar().getCigarElements()) {
|
||||
final CigarOperator op = cig.getOperator();
|
||||
|
||||
if (op == CigarOperator.SOFT_CLIP)
|
||||
softStart -= cig.getLength();
|
||||
else if (op != CigarOperator.HARD_CLIP)
|
||||
break;
|
||||
}
|
||||
}
|
||||
return softStart;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue