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;
if(op==7||op==8){
op=0;
}
switch (op) {
case 0: //M
case 0: //M|=|X
al->Reference.Append(ref_ptr, len);
al->Query.Append(query_ptr, len);
ref_ptr += len;
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;