From f978ef64d7dd7e62380b08918962c4f145856255 Mon Sep 17 00:00:00 2001 From: "Brian P. Walenz" Date: Fri, 18 Sep 2020 08:44:45 -0400 Subject: [PATCH] Actually enforce minReadLength when computing corrected reads. --- src/correction/falconConsensus.H | 3 --- src/correction/falconsense.C | 20 +++++++++----------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/correction/falconConsensus.H b/src/correction/falconConsensus.H index c298e7c29..20065bd4e 100644 --- a/src/correction/falconConsensus.H +++ b/src/correction/falconConsensus.H @@ -165,12 +165,10 @@ public: class falconConsensus { public: falconConsensus(uint32 minOutputCoverage_, - uint32 minOutputLength_, double minOlapIdentity_, uint32 minOlapLength_, bool restrictToOverlap_ = true) { minOutputCoverage = minOutputCoverage_; - minOutputLength = minOutputLength_; minOlapIdentity = minOlapIdentity_; minOlapLength = minOlapLength_; restrictToOverlap = restrictToOverlap_; @@ -229,7 +227,6 @@ public: private: uint32 minOutputCoverage; - uint32 minOutputLength; double minOlapIdentity; uint32 minOlapLength; diff --git a/src/correction/falconsense.C b/src/correction/falconsense.C index 79c5a028a..05ee4824c 100644 --- a/src/correction/falconsense.C +++ b/src/correction/falconsense.C @@ -458,7 +458,7 @@ main(int argc, char **argv) { // partitioning, but that would be wrong, because partitioning uses these objects to determine // the base amount of memory needed. - falconConsensus *fc = new falconConsensus(minOutputCoverage, minOutputLength, minOlapIdentity, minOlapLength, restrictToOverlap); + falconConsensus *fc = new falconConsensus(minOutputCoverage, minOlapIdentity, minOlapLength, restrictToOverlap); map reads; if (memoryLimit == 0) { @@ -485,11 +485,10 @@ main(int argc, char **argv) { trimToAlign, minOlapLength); - if (cnsFile) - layout->saveToStream(cnsFile); - - if (seqFile) - layout->dumpFASTQ(seqFile); + if (layout->length() >= minOutputLength) { + if (cnsFile) layout->saveToStream(cnsFile); + if (seqFile) layout->dumpFASTQ(seqFile); + } delete layout; layout = new tgTig(); // Next loop needs an existing empty layout. @@ -701,11 +700,10 @@ main(int argc, char **argv) { fc = NULL; #endif - if (cnsFile) - layout->saveToStream(cnsFile); - - if (seqFile) - layout->dumpFASTQ(seqFile); + if (layout->length() >= minOutputLength) { + if (cnsFile) layout->saveToStream(cnsFile); + if (seqFile) layout->dumpFASTQ(seqFile); + } corStore->unloadTig(layout->tigID()); }