Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
eaasna committed Mar 19, 2024
1 parent b211f66 commit 74e1693
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
5 changes: 4 additions & 1 deletion include/valik/split/metadata.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@ struct metadata
{
double fpr{1};
double p = kmer_spurious_match_prob(params.k);
const double precision{1e-9};
/*
For parameters
Expand All @@ -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);
}

/**
Expand Down
9 changes: 5 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 0 additions & 4 deletions src/argument_parsing/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/threshold/find.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 74e1693

Please sign in to comment.