return copy;
}
public Cigar convertToCigar(boolean negativeStrand) {
Cigar cigar = new Cigar();
Iterator<AlignmentMatchSequenceEntry> iterator = negativeStrand ? entries.descendingIterator() : entries.iterator();
while( iterator.hasNext() ) {
AlignmentMatchSequenceEntry entry = iterator.next();
CigarOperator operator;
switch( entry.getAlignmentState() ) {
case MATCH_MISMATCH: operator = CigarOperator.MATCH_OR_MISMATCH; break;
case INSERTION: operator = CigarOperator.INSERTION; break;
case DELETION: operator = CigarOperator.DELETION; break;
default: throw new ReviewedGATKException("convertToCigar: cannot process state: " + entry.getAlignmentState());
}
cigar.add( new CigarElement(entry.count,operator) );
}
return cigar;
}