21namespace bio::ranges::detail
32 template <
typename threshold_t>
33 constexpr auto operator()(threshold_t
const threshold)
const
35 static_assert(alphabet::quality<threshold_t> || std::integral<threshold_t>,
36 "The threshold must either be a quality alphabet or an integral type "
37 "in which case it is compared with the underlying phred type.");
39 return adaptor_from_functor{*
this, threshold};
47 template <std::ranges::input_range irng_t,
typename threshold_t>
48 constexpr auto operator()(irng_t && irange, threshold_t
const threshold)
const
50 static_assert(alphabet::quality<std::ranges::range_reference_t<irng_t>>,
51 "views::trim_quality can only operate on ranges over bio::alphabet::quality.");
54 std::integral<std::remove_cvref_t<threshold_t>>,
55 "The threshold must either be a letter of the underlying alphabet or an integral type "
56 "in which case it is compared with the underlying phred type.");
58 return std::views::take_while(
59 std::forward<irng_t>(irange),
60 [threshold](
auto const value)
62 if constexpr (std::same_as<std::remove_cvref_t<threshold_t>,
A wrapper type around an existing view adaptor that enables "deep view" behaviour for that view.
Definition: deep.hpp:104
Provides bio::views::deep.
constexpr auto to_phred
The public getter function for the phred representation of a quality score.
Definition: concept.hpp:65
constexpr auto trim_quality
A view that does quality-threshold trimming on a range of bio::alphabet::quality.
Definition: trim_quality.hpp:132
The BioC++ namespace for views.
Provides quality alphabet composites.