jeffdaily/parasail

Bug in CIGAR Construction

nlfortier opened this issue · 1 comments

I noticed that the CIGAR strings were not matching the alignments. Here is an output showing an alignment traceback produced by parasail_traceback_generic along with the erroneous CIGAR string:
ACTGA
AC-GA
Cigar: 2X1D2X
The correct CIGAR should be "2=1D2=".

I tracked down to bug to line 169 of cigar_template.c. It seems index i was erroneously being used to access seqB instead of index j. Below is the offending code snippet with the error corrected:
char a = case_sensitive ? seqA[i] : toupper(seqA[i]);
char b = case_sensitive ? seqB[j] : toupper(seqB[j]);
int matches = (a == b);

Thank you for reporting this issue. It was a regression in the 2.4 release and is not present in prior releases. I apologize if this has caused you any harm in your research.