Added QUAL/MINVAR parameters to the walker

This commit is contained in:
Mauricio Carneiro 2011-08-28 19:25:35 -04:00
parent c81675be4c
commit 943876c6eb
1 changed files with 8 additions and 5 deletions

View File

@ -674,11 +674,14 @@ public class ReadUtils {
public static int getRefCoordSoftUnclippedEnd(SAMRecord read) { public static int getRefCoordSoftUnclippedEnd(SAMRecord read) {
int stop = read.getUnclippedStart(); int stop = read.getUnclippedStart();
int shift = 0; int shift = 0;
for (CigarElement cigarElement : read.getCigar().getCigarElements()) CigarOperator lastOperator = null;
if (cigarElement.getOperator().consumesReferenceBases() || cigarElement.getOperator() == CigarOperator.SOFT_CLIP) for (CigarElement cigarElement : read.getCigar().getCigarElements()) {
shift += cigarElement.getLength(); stop += shift;
lastOperator = cigarElement.getOperator();
return (shift == 0) ? stop : stop+shift-1; if (cigarElement.getOperator().consumesReferenceBases() || cigarElement.getOperator() == CigarOperator.SOFT_CLIP || cigarElement.getOperator() == CigarOperator.HARD_CLIP)
shift = cigarElement.getLength();
}
return (lastOperator == CigarOperator.HARD_CLIP) ? stop-1 : stop+shift-1 ;
} }
/** /**