16 #include <seqan3/alphabet/detail/convert.hpp>
29 template <
typename derived_type,
size_t size>
60 #ifdef SEQAN3_DEPRECATED_310
91 template <
typename other_qual_type>
93 requires (!std::same_as<phred_base, other_qual_type>) &&
94 (!std::same_as<derived_type, other_qual_type>) &&
97 explicit constexpr
phred_base(other_qual_type
const & other) noexcept
114 return rank_to_phred[
to_rank()];
153 if (i < derived_type::offset_phred)
158 ret[
static_cast<rank_type>(i)] = i - derived_type::offset_phred;
172 ret[i] = i + derived_type::offset_phred;
181 int64_t difference =
static_cast<int64_t
>(chr) -
static_cast<int64_t
>(derived_type::offset_char);
182 return std::clamp<int64_t>(difference, 0,
alphabet_size - 1);
188 return rank + derived_type::offset_char;
Quality alphabet concept.
Provides seqan3::alphabet_base.
A CRTP-base that makes defining a custom alphabet easier.
Definition: alphabet_base.hpp:81
constexpr rank_type to_rank() const noexcept
Return the letter's numeric value (rank in the alphabet).
Definition: alphabet_base.hpp:185
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:104
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:276
constexpr derived_type & assign_rank(rank_type const c) noexcept
Assign from a numeric value.
Definition: alphabet_base.hpp:264
std::conditional_t< std::same_as< char, void >, char, char > char_type
The char representation; conditional needed to make semi alphabet definitions legal.
Definition: alphabet_base.hpp:96
A CRTP-base that refines seqan3::alphabet_base and is used by the quality alphabets.
Definition: phred_base.hpp:31
constexpr phred_type to_phred() const noexcept
Return the alphabet's value in Phred score representation.
Definition: phred_base.hpp:112
constexpr derived_type & assign_phred(phred_type const p) noexcept
Assign from the numeric Phred score value.
Definition: phred_base.hpp:137
constexpr phred_base(other_qual_type const &other) noexcept
Allow explicit construction from any other quality type by means of the Phred score representation.
Definition: phred_base.hpp:97
int8_t phred_type
The integer representation of the quality score.
Definition: phred_base.hpp:40
constexpr auto to_phred
The public getter function for the Phred representation of a quality score.
Definition: concept.hpp:100
constexpr auto assign_phred_to
Assign a Phred score to a quality alphabet object.
Definition: concept.hpp:231
A concept that indicates whether an alphabet represents quality scores.
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29