28template <
typename derived_type,
size_t size>
80 template <typename other_qual_type>
83 explicit constexpr
phred_base(other_qual_type const & other) noexcept
133 int64_t difference =
static_cast<int64_t
>(chr) -
static_cast<int64_t
>(derived_type::offset_char);
134 return std::clamp<int64_t>(difference, 0,
alphabet_size - 1);
140 return rank + derived_type::offset_char;
151 i <= std::numeric_limits<phred_type>::max();
154 if (i < derived_type::offset_phred)
159 ret[
static_cast<rank_type>(i)] = i - derived_type::offset_phred;
173 ret[i] = i + derived_type::offset_phred;
Provides seqan3::detail::convert_through_char_representation.
Quality alphabet concept.
Provides seqan3::alphabet_base.
A CRTP-base that makes defining a custom alphabet easier.
Definition alphabet_base.hpp:54
constexpr rank_type to_rank() const noexcept
Return the letter's numeric value (rank in the alphabet).
Definition alphabet_base.hpp:134
static constexpr detail::min_viable_uint_t< size > alphabet_size
The size of the alphabet, i.e. the number of different values it can take.
Definition alphabet_base.hpp:196
constexpr derived_type & assign_rank(rank_type const c) noexcept
Assign from a numeric value.
Definition alphabet_base.hpp:184
rank_type rank
The value of the alphabet letter is stored as the rank.
Definition alphabet_base.hpp:258
A CRTP-base that refines seqan3::alphabet_base and is used by the quality alphabets.
Definition phred_base.hpp:30
constexpr phred_type to_phred() const noexcept
Return the alphabet's value in Phred score representation.
Definition phred_base.hpp:98
friend derived_type
Befriend the derived_type so it can instantiate.
Definition phred_base.hpp:62
static constexpr std::array< phred_type, alphabet_size > rank_to_phred
Rank to phred conversion table.
Definition phred_base.hpp:168
static constexpr char_type rank_to_char(rank_type const rank)
Returns the character representation of rank.
Definition phred_base.hpp:138
static constexpr rank_type char_to_rank(char_type const chr)
Returns the rank representation of character.
Definition phred_base.hpp:131
constexpr phred_base() noexcept=default
Defaulted.
friend base_t
Befriend the base type so it can access seqan3::alphabet_base::char_to_rank and seqan3::alphabet_base...
Definition phred_base.hpp:49
constexpr derived_type & assign_phred(phred_type const p) noexcept
Assign from the numeric Phred score value.
Definition phred_base.hpp:123
static constexpr std::array< rank_type, 256 > phred_to_rank
Phred to rank conversion table.
Definition phred_base.hpp:146
int8_t phred_type
The integer representation of the quality score.
Definition phred_base.hpp:39
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:227
A concept that indicates whether an alphabet represents quality scores.
The main SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
SeqAn specific customisations in the standard namespace.