Skip to content

Commit

Permalink
Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
eaasna committed Oct 11, 2024
1 parent 80317ef commit bc8f614
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
14 changes: 13 additions & 1 deletion include/raptor/threshold/threshold.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class threshold

size_t get(size_t const minimiser_count) const noexcept;

size_t mean_number_of_minimizers() const noexcept;
size_t minimizer_count_repeat_cutoff() const noexcept;

private:
enum class threshold_kinds
Expand All @@ -49,6 +49,18 @@ class threshold
size_t minimal_number_of_minimizers{};
size_t maximal_number_of_minimizers{};
double threshold_percentage{};

public:
size_t get_min_minimizer_count() const noexcept
{
return minimal_number_of_minimizers;
}

size_t get_max_minimizer_count() const noexcept
{
return maximal_number_of_minimizers;
}

};

} // namespace raptor::threshold
4 changes: 3 additions & 1 deletion include/valik/search/local_prefilter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,16 @@ std::optional<pattern_bounds> make_pattern_bounds(size_t const & begin,

if (arguments.keep_all_repeats ||
(arguments.keep_best_repeats &&
(minimiser_count >= (thresholder.mean_number_of_minimizers()))))
(minimiser_count >= (thresholder.minimizer_count_repeat_cutoff()))))
// ignore low entropy repeat patterns
{
pattern.threshold = thresholder.get(minimiser_count);
return pattern;
}
else
{
return std::nullopt;
}
}

/**
Expand Down
3 changes: 3 additions & 0 deletions include/valik/search/search_local.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,9 @@ bool search_local(search_arguments & arguments, search_time_statistics & time_st
{
using ibf_t = decltype(index.ibf());
raptor::threshold::threshold const thresholder{arguments.make_threshold_parameters()};
seqan3::debug_stream << "min_min" << thresholder.get_min_minimizer_count() << '\n';
seqan3::debug_stream << "max_min" << thresholder.get_max_minimizer_count() << '\n';
seqan3::debug_stream << "minimizer_count_repeat_cutoff\t" << thresholder.minimizer_count_repeat_cutoff() << '\n';
if constexpr (is_split)
{
iterate_split_queries<ibf_t, TSequence>(arguments, index.ibf(), thresholder, queue, query_meta.value());
Expand Down
6 changes: 3 additions & 3 deletions src/raptor/threshold/threshold.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ size_t threshold::get(size_t const minimiser_count) const noexcept
}
}

size_t threshold::mean_number_of_minimizers() const noexcept
{
return (size_t) std::round((maximal_number_of_minimizers - minimal_number_of_minimizers) / 2.0);
size_t threshold::minimizer_count_repeat_cutoff() const noexcept
{
return (size_t) std::round((maximal_number_of_minimizers - minimal_number_of_minimizers) / 4.0);
}

} // namespace raptor::threshold

0 comments on commit bc8f614

Please sign in to comment.