wanpinglee / MOSAIK

reference-guided aligner for next-generation sequencing technologies
http://code.google.com/p/mosaik-aligner/
55 stars 19 forks source link

Cigar modified by CalculateNumberMismatch gives empty sequence and segfault #9

Open karlol opened 10 years ago

karlol commented 10 years ago

diff --git a/src/CommonSource/PairwiseAlignment/ConvertSswToAlignment.cpp b/src/CommonSo The changes to the cigar with M replaced by = and X by CalculateNumberMismatch in ssw_cpp.cpp are not handled in ConvertSswToAlignment which has no case to handle these cigar values and thus creates alignments with empty sequences, causing downstream segfault.

The below patch seems to correct it. //Olof

index fb2e8c0..d63a70f 100644 --- a/src/CommonSource/PairwiseAlignment/ConvertSswToAlignment.cpp +++ b/src/CommonSource/PairwiseAlignment/ConvertSswToAlignment.cpp @@ -26,8 +26,11 @@ bool ConvertSswToAlignment( for (unsigned int i = 0; i < ssw_al.cigar.size(); ++i) { int op = ssw_al.cigar[i] & 0x0000000f; int len = ssw_al.cigar[i] >> 4;