From 4c9ebe790be1d982c69b8ce45b73eeac08a9d6be Mon Sep 17 00:00:00 2001 From: Tobias Rausch Date: Fri, 20 Sep 2024 15:39:39 +0200 Subject: [PATCH] fix lower case bug --- src/draw.h | 16 ++++++++-------- src/hilbert.h | 9 +++++---- src/region.h | 9 +++++---- src/version.h | 2 +- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/draw.h b/src/draw.h index d80d5d3..b13bd1f 100644 --- a/src/draw.h +++ b/src/draw.h @@ -347,16 +347,16 @@ namespace wallysworld if (c.pxoffset >= WALLY_PX) { cv::Rect rect(x, y, w, h); cv::rectangle(img, rect, clr, -1); - if ((nuc == 'a') or (nuc == 'A')) { + if (nuc == 'A') { cv::putText(img, text, cv::Point(x + w/2 - textSize.width/2, y+h/2+textSize.height/2), cv::FONT_HERSHEY_DUPLEX, font_scale, WALLY_A, font_thickness, cv::LINE_AA); } - else if ((nuc == 'c') or (nuc == 'C')) { + else if (nuc == 'C') { cv::putText(img, text, cv::Point(x + w/2 - textSize.width/2, y+h/2+textSize.height/2), cv::FONT_HERSHEY_DUPLEX, font_scale, WALLY_C, font_thickness, cv::LINE_AA); } - else if ((nuc == 'g') or (nuc == 'G')) { + else if (nuc == 'G') { cv::putText(img, text, cv::Point(x + w/2 - textSize.width/2, y+h/2+textSize.height/2), cv::FONT_HERSHEY_DUPLEX, font_scale, WALLY_G, font_thickness, cv::LINE_AA); } - else if ((nuc == 't') or (nuc == 'T')) { + else if (nuc == 'T') { cv::putText(img, text, cv::Point(x + w/2 - textSize.width/2, y+h/2+textSize.height/2), cv::FONT_HERSHEY_DUPLEX, font_scale, WALLY_T, font_thickness, cv::LINE_AA); } else { // n or N most likely cv::putText(img, text, cv::Point(x + w/2 - textSize.width/2, y+h/2+textSize.height/2), cv::FONT_HERSHEY_DUPLEX, font_scale, WALLY_N, font_thickness, cv::LINE_AA); @@ -365,16 +365,16 @@ namespace wallysworld int32_t pxw = w; if (pxw < 1) pxw = 1; // Make mismatches always visible cv::Rect rect(x, y, pxw, h); - if ((nuc == 'a') or (nuc == 'A')) { + if (nuc == 'A') { cv::rectangle(img, rect, WALLY_A, -1); } - else if ((nuc == 'c') or (nuc == 'C')) { + else if (nuc == 'C') { cv::rectangle(img, rect, WALLY_C, -1); } - else if ((nuc == 'g') or (nuc == 'G')) { + else if (nuc == 'G') { cv::rectangle(img, rect, WALLY_G, -1); } - else if ((nuc == 't') or (nuc == 'T')) { + else if (nuc == 'T') { cv::rectangle(img, rect, WALLY_T, -1); } } diff --git a/src/hilbert.h b/src/hilbert.h index 452c2d8..85bee5b 100644 --- a/src/hilbert.h +++ b/src/hilbert.h @@ -93,6 +93,7 @@ namespace wallysworld if (seq != NULL) free(seq); seq = faidx_fetch_seq(fai, hdr->target_name[rg[rgIdx].tid], 0, hdr->target_len[rg[rgIdx].tid], &seqlen); oldchr = chrName; + boost::to_upper(seq); } // Parse BAM files @@ -178,19 +179,19 @@ namespace wallysworld uint32_t snpcov = cumsum; cumsum += del[rpadj]; if (cumsum >= c.snvcov) { - if ((seq[rp] == 'a') || (seq[rp] == 'A')) { + if (seq[rp] == 'A') { if (((double) covA[rpadj] / (double) cumsum) < (1 - c.snvvaf)) { snp[rpadj] = true; } - } else if ((seq[rp] == 'c') || (seq[rp] == 'C')) { + } else if (seq[rp] == 'C') { if (((double) covC[rpadj] / (double) cumsum) < (1 - c.snvvaf)) { snp[rpadj] = true; } - } else if ((seq[rp] == 'g') || (seq[rp] == 'G')) { + } else if (seq[rp] == 'G') { if (((double) covG[rpadj] / (double) cumsum) < (1 - c.snvvaf)) { snp[rpadj] = true; } - } else if ((seq[rp] == 't') || (seq[rp] == 'T')) { + } else if (seq[rp] == 'T') { if (((double) covT[rpadj] / (double) cumsum) < (1 - c.snvvaf)) { snp[rpadj] = true; } diff --git a/src/region.h b/src/region.h index 4c3e86f..7e95b8c 100644 --- a/src/region.h +++ b/src/region.h @@ -159,6 +159,7 @@ namespace wallysworld if (seq != NULL) free(seq); seq = faidx_fetch_seq(fai, hdr->target_name[rg[rgIdx].tid], 0, hdr->target_len[rg[rgIdx].tid], &seqlen); oldchr = chrName; + boost::to_upper(seq); } // Header @@ -364,19 +365,19 @@ namespace wallysworld cumsum += covG[rpadj]; cumsum += covT[rpadj]; if (cumsum >= c.snvcov) { - if ((seq[rp] == 'a') || (seq[rp] == 'A')) { + if (seq[rp] == 'A') { if (((double) covA[rpadj] / (double) cumsum) < (1 - c.snvvaf)) { snp[rpadj] = true; } - } else if ((seq[rp] == 'c') || (seq[rp] == 'C')) { + } else if (seq[rp] == 'C') { if (((double) covC[rpadj] / (double) cumsum) < (1 - c.snvvaf)) { snp[rpadj] = true; } - } else if ((seq[rp] == 'g') || (seq[rp] == 'G')) { + } else if (seq[rp] == 'G') { if (((double) covG[rpadj] / (double) cumsum) < (1 - c.snvvaf)) { snp[rpadj] = true; } - } else if ((seq[rp] == 't') || (seq[rp] == 'T')) { + } else if (seq[rp] == 'T') { if (((double) covT[rpadj] / (double) cumsum) < (1 - c.snvvaf)) { snp[rpadj] = true; } diff --git a/src/version.h b/src/version.h index ca5fca1..78401f4 100644 --- a/src/version.h +++ b/src/version.h @@ -9,7 +9,7 @@ namespace wallysworld { - std::string wallyVersionNumber = "0.5.9"; + std::string wallyVersionNumber = "0.6.1"; inline void printTitle(std::string const& title)