From b6eb193f6040137b068f2f642d0437c0037753d1 Mon Sep 17 00:00:00 2001 From: "Erik Garrison (aider)" Date: Sat, 19 Oct 2024 18:54:59 -0500 Subject: [PATCH] feat: allow hgNumerator parameter to be a double --- src/interface/parse_args.hpp | 12 ++++++------ src/map/include/map_parameters.hpp | 2 +- src/map/include/winSketch.hpp | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/interface/parse_args.hpp b/src/interface/parse_args.hpp index 44478219..a59f824e 100644 --- a/src/interface/parse_args.hpp +++ b/src/interface/parse_args.hpp @@ -92,9 +92,9 @@ void parse_args(int argc, args::ValueFlag map_sparsification(mapping_opts, "FACTOR", "keep this fraction of mappings", {'x', "sparsify-mappings"}); //ToFix: args::Flag keep_ties(mapping_opts, "", "keep all mappings with equal score even if it results in more than n mappings", {'D', "keep-ties"}); args::ValueFlag sketch_size(mapping_opts, "N", "sketch size for sketching.", {'w', "sketch-size"}); - args::ValueFlag hg_numerator(mapping_opts, "N", + args::ValueFlag hg_numerator(mapping_opts, "N", "Set the numerator for the hypergeometric filter's Jaccard similarity calculation. " - "Higher values increase speed at the cost of sensitivity. [default: 1]", + "Higher values increase speed at the cost of sensitivity. [default: 1.0]", {"hg-numerator"}); args::ValueFlag kmer_complexity(mapping_opts, "F", "Drop segments w/ predicted kmer complexity below this cutoff. Kmer complexity defined as #kmers / (s - k + 1)", {'J', "kmer-complexity"}); args::Flag no_hg_filter(mapping_opts, "", "Don't use the hypergeometric filtering and instead use the MashMap2 first pass filtering.", {"no-hg-filter"}); @@ -611,14 +611,14 @@ void parse_args(int argc, } if (hg_numerator) { - int value = args::get(hg_numerator); - if (value < 1) { - std::cerr << "[wfmash] ERROR: hg-numerator must be >= 1." << std::endl; + double value = args::get(hg_numerator); + if (value < 1.0) { + std::cerr << "[wfmash] ERROR: hg-numerator must be >= 1.0." << std::endl; exit(1); } map_parameters.hgNumerator = value; } else { - map_parameters.hgNumerator = 1; // Default value + map_parameters.hgNumerator = 1.0; // Default value } // Set the total reference size diff --git a/src/map/include/map_parameters.hpp b/src/map/include/map_parameters.hpp index b9248ee8..7aa2eb2c 100644 --- a/src/map/include/map_parameters.hpp +++ b/src/map/include/map_parameters.hpp @@ -72,7 +72,7 @@ struct Parameters std::vector query_prefix; // prefix for query sequences to use int sketchSize; - int hgNumerator = 1; // Numerator for the hypergeometric filter's Jaccard similarity calculation + double hgNumerator = 1.0; // Numerator for the hypergeometric filter's Jaccard similarity calculation uint64_t totalReferenceSize = 0; // Total size of all reference sequences uint64_t estimatedUniqueKmers = 0; // Estimate of total unique k-mers bool use_spaced_seeds; // diff --git a/src/map/include/winSketch.hpp b/src/map/include/winSketch.hpp index 9eb51a7b..eff4efb5 100644 --- a/src/map/include/winSketch.hpp +++ b/src/map/include/winSketch.hpp @@ -103,7 +103,7 @@ namespace skch input_queue_t input_queue; output_queue_t output_queue; - int hgNumerator; + double hgNumerator; private: