15#include <seqan3/alphabet/detail/convert.hpp>
28template <
typename derived_type,
size_t size>
54 constexpr phred_base() noexcept = default;
55 constexpr phred_base(phred_base const &) noexcept = default;
56 constexpr phred_base(phred_base &&) noexcept = default;
57 constexpr phred_base & operator=(phred_base const &) noexcept = default;
58 constexpr phred_base & operator=(phred_base &&) noexcept = default;
59 ~phred_base() noexcept = default;
80 template <typename other_qual_type>
81 requires (!
std::same_as<phred_base, other_qual_type>) && (!
std::same_as<derived_type, other_qual_type>)
83 explicit constexpr phred_base(other_qual_type const & other) noexcept
100 return rank_to_phred[
to_rank()];
133 int64_t difference =
static_cast<int64_t
>(chr) -
static_cast<int64_t
>(derived_type::offset_char);
140 return rank + derived_type::offset_char;
144 static constexpr std::array<rank_type, 256> phred_to_rank{
147 std::array<rank_type, 256> ret{};
152 if (i < derived_type::offset_phred)
157 ret[
static_cast<rank_type>(i)] = i - derived_type::offset_phred;
164 static constexpr std::array<phred_type, alphabet_size> rank_to_phred{
167 std::array<phred_type, alphabet_size> ret{};
170 ret[i] = i + derived_type::offset_phred;
Quality alphabet concept.
Provides seqan3::alphabet_base.
constexpr alphabet_base() noexcept=default
detail::min_viable_uint_t< size - 1 > rank_type
The type of the alphabet when represented as a number (e.g. via to_rank()).
Definition alphabet_base.hpp:77
std::conditional_t< std::same_as< char_t, void >, char, char_t > char_type
The char representation; conditional needed to make semi alphabet definitions legal.
Definition alphabet_base.hpp:69
constexpr phred_type to_phred() const noexcept
Return the alphabet's value in Phred score representation.
Definition phred_base.hpp:98
static constexpr detail::min_viable_uint_t< size > alphabet_size
constexpr phred42 & assign_rank(rank_type const c) noexcept
constexpr derived_type & assign_phred(phred_type const p) noexcept
Assign from the numeric Phred score value.
Definition phred_base.hpp:123
constexpr rank_type to_rank() const noexcept
int8_t phred_type
Definition phred_base.hpp:39
constexpr auto alphabet_size
A type trait that holds the size of a (semi-)alphabet.
Definition alphabet/concept.hpp:834
A concept that indicates whether an alphabet represents quality scores.
The main SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
constexpr auto to_phred
The public getter function for the Phred representation of a quality score.
Definition alphabet/quality/concept.hpp:97
constexpr auto assign_phred_to
Assign a Phred score to a quality alphabet object.
Definition alphabet/quality/concept.hpp:225
SeqAn specific customisations in the standard namespace.