Skip to content

Commit

Permalink
Fix glaring error in -wig-depth that would fail to find some kmers in…
Browse files Browse the repository at this point in the history
… non-canonical databases.
  • Loading branch information
brianwalenz committed May 17, 2021
1 parent bb77ede commit 6a08212
Showing 1 changed file with 8 additions and 24 deletions.
32 changes: 8 additions & 24 deletions src/meryl-lookup/dump.C
Original file line number Diff line number Diff line change
Expand Up @@ -203,19 +203,11 @@ processSequence(void *G, void *T, void *S) {
#ifdef SIMPLE_DEPTH

while (kiter.nextMer()) {
kmer f = kiter.fmer(), c;
kmer r = kiter.rmer(), n;

if (f < r) { // A small optimization; since (hopefully)
c = f; // the usual use case will be with a
n = r; // canonical DB, we can test for the
} else { // canonical and non-canonical kmers,
c = r; // instead of the f and r kmers. If we
n = n; // test the canonical first, we'll skip the
} // non-canonical lookup.
kmer f = kiter.fmer();
kmer r = kiter.rmer();

if ((L->exists(c) == true) ||
(L->exists(n) == true)) {
if ((L->exists(f) == true) ||
(L->exists(r) == true)) {
for (uint64 p=kiter.bgnPosition(); p<kiter.endPosition(); p++)
s->depth[p]++;

Expand All @@ -226,19 +218,11 @@ processSequence(void *G, void *T, void *S) {
#else

while (kiter.nextMer()) {
kmer f = kiter.fmer(), c;
kmer r = kiter.rmer(), n;

if (f < r) { // A small optimization; since (hopefully)
c = f; // the usual use case will be with a
n = r; // canonical DB, we can test for the
} else { // canonical and non-canonical kmers,
c = r; // instead of the f and r kmers. If we
n = n; // test the canonical first, we'll skip the
} // non-canonical lookup.
kmer f = kiter.fmer();
kmer r = kiter.rmer();

if ((L->exists(c) == true) ||
(L->exists(n) == true)) {
if ((L->exists(f) == true) ||
(L->exists(r) == true)) {
s->depth[kiter.bgnPosition()] += 1;
s->depth[kiter.endPosition()] -= 1;

Expand Down

0 comments on commit 6a08212

Please sign in to comment.