From a275cb27691da9476442e37ccaeb5e6fb2b947b1 Mon Sep 17 00:00:00 2001 From: Zilong-Li Date: Sun, 17 Nov 2024 15:00:26 +0100 Subject: [PATCH] fix parsing reads with 'X' or '=' instead of 'M' in cigar --- STITCH/src/bam_access.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/STITCH/src/bam_access.cpp b/STITCH/src/bam_access.cpp index edac04d..c5ce5b0 100644 --- a/STITCH/src/bam_access.cpp +++ b/STITCH/src/bam_access.cpp @@ -22,10 +22,11 @@ int get_read_span(std::vector cigarLengthVec, std::vector ciga for(std::size_t iM=0; iM < cigarLengthVec.size(); iM++) { cigarLength = cigarLengthVec[iM]; cigarType = cigarTypeVec[iM]; - // keep if it is an M or a D. basically, - if((cigarType == "M") | (cigarType == "D")) { - readLength = readLength + cigarLength; - } + // keep if it is an M or D. basically, + // keep X and = as well + if((cigarType == "M") || (cigarType == "D") || (cigarType == "=") || (cigarType == "X")) { + readLength = readLength + cigarLength; + } } return readLength; } @@ -303,7 +304,7 @@ std::tuple, std::vector, std::vector, std::vector