Skip to content

Commit

Permalink
missing last CpG in chromosome
Browse files Browse the repository at this point in the history
  • Loading branch information
nloyfer committed Jul 26, 2023
1 parent b6584a4 commit 3220beb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pipeline_wgbs/patter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ void patter::load_genome_ref() {
}
offset = loci.at(0);
//std::cerr << "offset: " << offset << std::endl;
bsize = loci.at(loci.size() - 1);
bsize = loci.at(loci.size() - 1) + 1;

conv = new bool[bsize + 1]();
conv = new bool[bsize]();
for (int locus: loci) {
conv[locus] = true;
}
Expand Down Expand Up @@ -251,7 +251,7 @@ int patter::compareSeqToRef(std::string &seq,

// this deals with the case where a read exceeds
// the last CpG of the chromosome. Ignore the rest of the read.
if ((start_locus + i) > (bsize)) {
if ((start_locus + i) > (bsize - 1)) {
continue;
}
mj = bottom ? (seq.length() - i - 1) : i;
Expand Down

0 comments on commit 3220beb

Please sign in to comment.