From a0f71f5eb6b3a6771d9d8e0bc1b5780c724d4cea Mon Sep 17 00:00:00 2001 From: arangrhie Date: Wed, 14 Jul 2021 16:10:33 -0400 Subject: [PATCH] fix -completeness --- src/merfin/merfin-globals.C | 9 --------- src/merfin/merfin.C | 10 ++++++++++ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/merfin/merfin-globals.C b/src/merfin/merfin-globals.C index acc18de..2f05f9a 100644 --- a/src/merfin/merfin-globals.C +++ b/src/merfin/merfin-globals.C @@ -114,11 +114,6 @@ merfinGlobal::getK(kmer fmer, void merfinGlobal::load_Kmers(void) { - if (reportType == OP_COMPL) { - fprintf(stderr, "-- Not loading kmers; not necessary for -completeness mode.\n"); - return; - } - double minMem, minMemTotal = 0; double optMem, optMemTotal = 0; bool useOpt = false; @@ -175,10 +170,6 @@ merfinGlobal::load_Kmers(void) { void merfinGlobal::load_Sequence(void) { - if (reportType == OP_COMPL) { - return; - } - if (seqDBname == nullptr) { seqDBname = new char[FILENAME_MAX+1]; snprintf(seqDBname, FILENAME_MAX, "%s.meryl", basename(seqName)); diff --git a/src/merfin/merfin.C b/src/merfin/merfin.C index aa7562f..3055631 100644 --- a/src/merfin/merfin.C +++ b/src/merfin/merfin.C @@ -160,6 +160,11 @@ main(int32 argc, char **argv) { if (G->peak == 0) err.push_back("No haploid peak (-peak) supplied.\n"); } + if (G->reportType == OP_COMPL) { + if (G->seqName == nullptr && + G->seqDBname == nullptr) err.push_back("No sequence meryl database (-seqmers) nor sequence (-sequence) supplied.\n"); + } + if (G->reportType == OP_NONE) { err.push_back("No report type (-filter, -polish, -hist, -dump, -completeness) supplied.\n"); } @@ -255,6 +260,11 @@ main(int32 argc, char **argv) { fprintf(stderr, "\n\n"); fprintf(stderr, " -completeness\n"); fprintf(stderr, " Compute kmer completeness using expected copy numbers for all kmers.\n"); + fprintf(stderr, "\n"); + fprintf(stderr, " Required: -seqmers (or -sequence), -readmers, -peak\n"); + fprintf(stderr, " Optional: -prob use probabilities to adjust multiplicity to copy number (recommended)\n"); + fprintf(stderr, "\n"); + fprintf(stderr, " Output: total kmers in reads, number of kmers under the expected copy number, and completeness\n"); fprintf(stderr, "\n\n"); fprintf(stderr, " Optional output from -debug in -filter and -polish:\n"); fprintf(stderr, " .THREAD_ID.debug.gz : some useful info for debugging.\n");