Skip to content

Commit

Permalink
Allow running with empty merylDB filename, for testing the threshold …
Browse files Browse the repository at this point in the history
…computation. Issue marbl#1538.
  • Loading branch information
brianwalenz committed Nov 13, 2019
1 parent 5d248dd commit 0fbbd0f
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/haplotyping/splitHaplotype.C
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,6 @@ getMinFreqFromHistogram(char *histoName) {

void
hapData::initializeKmerTable(uint32 maxMemory) {
kmerCountFileReader *reader = new kmerCountFileReader(merylName);

// Decide on a threshold below which we consider the kmers as useless noise.

Expand All @@ -412,18 +411,27 @@ hapData::initializeKmerTable(uint32 maxMemory) {
fprintf(stderr, "-- use kmers with frequency at least %u.\n", minFreq);

// Construct an exact lookup table.
//
// If there is not valid merylName, do not load data. This is only useful
// for testing getMinFreqFromHistogram() above.
//
// Get this behavior with option '-H "" histo out.fasta',

lookup = new kmerCountExactLookup(reader, maxMemory, minFreq, UINT32_MAX);
if (merylName[0]) {
kmerCountFileReader *reader = new kmerCountFileReader(merylName);

if (lookup->configure() == false) {
exit(1);
}
lookup = new kmerCountExactLookup(reader, maxMemory, minFreq, UINT32_MAX);

lookup->load();
if (lookup->configure() == false) {
exit(1);
}

lookup->load();

nKmers = lookup->nKmers();
nKmers = lookup->nKmers();

delete reader;
delete reader;
}

// And report what we loaded.

Expand Down

0 comments on commit 0fbbd0f

Please sign in to comment.