Better implementation of GATKSAMRecord.getSoftStart()

This commit is contained in:
Eric Banks 2012-10-19 12:11:18 -04:00
parent deca564aef
commit f08e5a44da
1 changed files with 4 additions and 8 deletions

View File

@ -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;
}