Skip to content

Commit

Permalink
v0.1.6 gc fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasrausch committed Mar 22, 2018
1 parent ae0e663 commit e0c0849
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/bamstats.h
Original file line number Diff line number Diff line change
Expand Up @@ -619,16 +619,18 @@ namespace bamstats
++itRg->second.rc.gcContent[gccont];
} else {
// Most likely some tag-counting application, ignore the first 20bp
for(uint32_t i = 20; i < sequence.size(); ++i, ++gcRunnerIdx) {
if ((sequence[i] == 'c') || (sequence[i] == 'C') || (sequence[i] == 'g') || (sequence[i] == 'G')) ++gcRunnerCount;
if (gcRunnerIdx == 100) {
++itRg->second.rc.gcContent[gcRunnerCount];
gcRunnerIdx = 0;
gcRunnerCount = 0;
if (!(rec->core.flag & BAM_FREVERSE)) {
for(uint32_t i = 20; i < sequence.size(); ++i, ++gcRunnerIdx) {
if ((sequence[i] == 'c') || (sequence[i] == 'C') || (sequence[i] == 'g') || (sequence[i] == 'G')) ++gcRunnerCount;
if (gcRunnerIdx == 100) {
++itRg->second.rc.gcContent[gcRunnerCount];
gcRunnerIdx = 0;
gcRunnerCount = 0;
}
}
}
}

// Get the reference slice
std::string refslice = boost::to_upper_copy(std::string(seq + rec->core.pos, seq + lastAlignedPosition(rec)));

Expand Down

0 comments on commit e0c0849

Please sign in to comment.