Skip to content

Commit

Permalink
Import the freshly re-implemented 'meryl' (and 'sequence').
Browse files Browse the repository at this point in the history
  • Loading branch information
brianwalenz committed Jul 21, 2018
1 parent da012a3 commit 231896d
Show file tree
Hide file tree
Showing 29 changed files with 8,489 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/main.mk
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ SOURCES := AS_global.C \
utility/strings.C \
utility/system.C \
\
utility/sequence.C \
\
utility/kmers.C \
utility/kmers-reader.C \
utility/kmers-writer.C \
utility/kmers-statistics.C \
utility/kmers-exact.C \
\
utility/bits.C \
\
utility/AS_UTL_reverseComplement.C \
utility/AS_UTL_stackTrace.C \
\
Expand Down Expand Up @@ -108,9 +118,7 @@ SOURCES := AS_global.C \
utgcns/libpbutgcns/AlnGraphBoost.C \
\
gfa/gfa.C \
gfa/bed.C \
\

gfa/bed.C


ifeq (${BUILDSTACKTRACE}, 1)
Expand Down Expand Up @@ -177,6 +185,9 @@ SUBMAKEFILES := stores/dumpBlob.mk \
meryl-san/positionDB.mk \
meryl-san/simple-dump.mk \
\
meryl/meryl.mk \
\
sequence/sequence.mk \
\
overlapInCore/overlapInCore.mk \
overlapInCore/overlapInCorePartition.mk \
Expand Down
52 changes: 52 additions & 0 deletions src/meryl/lookup.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

/******************************************************************************
*
* This file is part of 'sequence' and/or 'meryl', software programs for
* working with DNA sequence files and k-mers contained in them.
*
* Modifications by:
*
* Brian P. Walenz beginning on 2018-FEB-26
* are a 'United States Government Work', and
* are released in the public domain
*
* File 'README.license' in the root directory of this distribution contains
* full conditions and disclaimers.
*/

#include "kmers.H"
#include "bits.H"

int
main(int argc, char **argv) {

kmerCountFileReader *rr = new kmerCountFileReader(argv[1], false, true);
kmerCountExactLookup *ll = new kmerCountExactLookup(rr);

delete rr;

rr = new kmerCountFileReader(argv[2], false, true);

uint64 tested = 0;
uint64 found = 0;

while (rr->nextMer()) {
kmer k = rr->theFMer();
uint32 c = rr->theCount();

tested++;

if (ll->exists(k))
found++;

if ((tested % 100000) == 0)
fprintf(stderr, "Tested %lu kmers, found %lu.\n", tested, found);
}

delete ll;
delete rr;

fprintf(stderr, "Tested %lu kmers, found %lu.\n", tested, found);

exit(0);
}
20 changes: 20 additions & 0 deletions src/meryl/lookup.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

# If 'make' isn't run from the root directory, we need to set these to
# point to the upper level build directory.
ifeq "$(strip ${BUILD_DIR})" ""
BUILD_DIR := ../$(OSTYPE)-$(MACHINETYPE)/obj
endif
ifeq "$(strip ${TARGET_DIR})" ""
TARGET_DIR := ../$(OSTYPE)-$(MACHINETYPE)
endif

TARGET := lookup
SOURCES := lookup.C \

SRC_INCDIRS := . utility

TGT_LDFLAGS := -L${TARGET_DIR}/lib
TGT_LDLIBS := -lsequence -lbits -lkmer -lmeryl
TGT_PREREQS := libmeryl.a

SUBMAKEFILES :=
Loading

0 comments on commit 231896d

Please sign in to comment.