Skip to content

Commit

Permalink
fix lower case bug
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasrausch committed Sep 20, 2024
1 parent 3270025 commit 4c9ebe7
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
16 changes: 8 additions & 8 deletions src/draw.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}
}
Expand Down
9 changes: 5 additions & 4 deletions src/hilbert.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down
9 changes: 5 additions & 4 deletions src/region.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4c9ebe7

Please sign in to comment.