diff --git a/include/valik/split/metadata.hpp b/include/valik/split/metadata.hpp index 28425f7f..16b78a60 100644 --- a/include/valik/split/metadata.hpp +++ b/include/valik/split/metadata.hpp @@ -579,6 +579,7 @@ struct metadata { double fpr{1}; double p = kmer_spurious_match_prob(params.k); + const double precision{1e-9}; /* For parameters @@ -604,12 +605,14 @@ struct metadata size_t kmers_per_pattern = pattern_size - params.k + 1; for (uint8_t matching_kmer_count{0}; matching_kmer_count < params.t; matching_kmer_count++) { + if (fpr < precision) + break; fpr -= combinations(matching_kmer_count, kmers_per_pattern) * pow(p, matching_kmer_count) * pow(1 - p, kmers_per_pattern - matching_kmer_count); } - return std::max(0.0, fpr); + return std::max(0.0, fpr - precision); } /** diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b917e2b8..bac31c8c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -8,11 +8,12 @@ add_library ("${PROJECT_NAME}_interface" INTERFACE) target_link_libraries ("${PROJECT_NAME}_interface" INTERFACE seqan3::seqan3) target_link_libraries ("${PROJECT_NAME}_interface" INTERFACE sharg::sharg) target_include_directories ("${PROJECT_NAME}_interface" INTERFACE ../include) -target_include_directories ("${PROJECT_NAME}_interface" INTERFACE ../lib/raptor/include) +# SYSTEM keyword turns off compiler warnings for subprojects +target_include_directories ("${PROJECT_NAME}_interface" SYSTEM INTERFACE ../lib/raptor/include) target_include_directories ("${PROJECT_NAME}_interface" SYSTEM INTERFACE ../lib/stellar3/include) -target_include_directories ("${PROJECT_NAME}_interface" INTERFACE ../lib/seqan/include) -target_include_directories ("${PROJECT_NAME}_interface" INTERFACE ../lib/robin-hood-hashing/src/include) -target_compile_options ("${PROJECT_NAME}_interface" INTERFACE "-pedantic" "-Wall" "-Wextra") +target_include_directories ("${PROJECT_NAME}_interface" SYSTEM INTERFACE ../lib/seqan/include) +target_include_directories ("${PROJECT_NAME}_interface" SYSTEM INTERFACE ../lib/robin-hood-hashing/src/include) +target_compile_options ("${PROJECT_NAME}_interface" INTERFACE "-pedantic" "-Wall" "-Wextra" "-Wno-interference-size") # Parameter tuning add_library ("${PROJECT_NAME}_threshold_lib" STATIC threshold/find.cpp) diff --git a/src/argument_parsing/search.cpp b/src/argument_parsing/search.cpp index d695d46e..b3610edf 100644 --- a/src/argument_parsing/search.cpp +++ b/src/argument_parsing/search.cpp @@ -46,10 +46,6 @@ void init_search_parser(sharg::parser & parser, search_arguments & arguments) sharg::config{.short_id = '\0', .long_id = "fast", .description = "Execute the search in fast mode when few false negatives can be tolerated."}); - parser.add_flag(arguments.compressed, - sharg::config{.short_id = '\0', - .long_id = "compressed", - .description = "Build a compressed IBF."}); parser.add_flag(arguments.write_time, sharg::config{.short_id = '\0', .long_id = "time", diff --git a/src/threshold/find.cpp b/src/threshold/find.cpp index 161e9108..1e07db99 100755 --- a/src/threshold/find.cpp +++ b/src/threshold/find.cpp @@ -89,8 +89,8 @@ param_set get_best_params(search_pattern const & pattern, * Consider different error rates up to max_err. */ search_kmer_profile find_thresholds_for_kmer_size(metadata const & ref_meta, - kmer_loss const attr, - uint8_t const max_errors) + kmer_loss const attr, + uint8_t const max_errors) { param_space space;