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