Apparently CIGAR elements can have 0 length according to the spec, but 0Ms were causing left alignment of indels to fail. Fixed.

This commit is contained in:
Eric Banks 2012-11-06 20:53:33 -08:00
parent eae2d019cf
commit 15b8c08132
1 changed files with 1 additions and 1 deletions

View File

@ -646,7 +646,7 @@ public class AlignmentUtils {
// get the indel element and move it left one base
CigarElement ce = cigar.getCigarElement(indexOfIndel - 1);
elements.add(new CigarElement(ce.getLength() - 1, ce.getOperator()));
elements.add(new CigarElement(Math.max(ce.getLength() - 1, 0), ce.getOperator()));
elements.add(cigar.getCigarElement(indexOfIndel));
if (indexOfIndel + 1 < cigar.numCigarElements()) {
ce = cigar.getCigarElement(indexOfIndel + 1);