jeffdaily / parasail

Pairwise Sequence Alignment Library
Other
241 stars 34 forks source link

Bug in CIGAR Construction #67

Closed nlfortier closed 5 years ago

nlfortier commented 5 years ago

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);

jeffdaily commented 5 years ago

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.