Skip to content

Commit

Permalink
feat: allow hgNumerator parameter to be a double
Browse files Browse the repository at this point in the history
  • Loading branch information
ekg committed Oct 19, 2024
1 parent 155ebfa commit b6eb193
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/interface/parse_args.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ void parse_args(int argc,
args::ValueFlag<double> 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<int64_t> sketch_size(mapping_opts, "N", "sketch size for sketching.", {'w', "sketch-size"});
args::ValueFlag<int> hg_numerator(mapping_opts, "N",
args::ValueFlag<double> 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<double> 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"});
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/map/include/map_parameters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ struct Parameters
std::vector<std::string> 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; //
Expand Down
2 changes: 1 addition & 1 deletion src/map/include/winSketch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ namespace skch
input_queue_t input_queue;
output_queue_t output_queue;

int hgNumerator;
double hgNumerator;

private:

Expand Down

0 comments on commit b6eb193

Please sign in to comment.