14#include <seqan3/alphabet/detail/convert.hpp>
39template <
typename derived_type, auto size>
78 template <
typename other_nucl_type>
79 requires (!std::same_as<nucleotide_base, other_nucl_type>) && (!std::same_as<derived_type, other_nucl_type>)
81 && detail::convertable_to_through_char_representation<other_nucl_type, derived_type>
84 static_cast<derived_type &
>(*this) =
85 detail::convert_through_char_representation<other_nucl_type, derived_type>[
seqan3::to_rank(other)];
113 return derived_type{}.assign_rank(derived_type{}.rank_complement(
to_rank()));
140 return valid_char_table[
static_cast<uint8_t
>(c)];
154 for (
size_t rank = 0u; rank < derived_type::alphabet_size; ++rank)
156 uint8_t c = derived_type::rank_to_char(rank);
Provides alphabet helper concepts.
Provides seqan3::nucleotide_alphabet.
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
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
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
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:69
A "pretty printer" for most SeqAn data structures and related types.
Definition debug_stream_type.hpp:79
A CRTP-base that refines seqan3::alphabet_base and is used by the nucleotides.
Definition nucleotide_base.hpp:41
static constexpr bool char_is_valid(char_type const c) noexcept
Validate whether a character value has a one-to-one mapping to an alphabet value.
Definition nucleotide_base.hpp:138
constexpr nucleotide_base(other_nucl_type const &other) noexcept
Allow explicit construction from any other nucleotide type and convert via the character representati...
Definition nucleotide_base.hpp:82
constexpr derived_type complement() const noexcept
Return the complement of the letter.
Definition nucleotide_base.hpp:111
constexpr auto to_rank
Return the rank representation of a (semi-)alphabet object.
Definition alphabet/concept.hpp:152
The main SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
constexpr char_type to_lower(char_type const c) noexcept
Converts 'A'-'Z' to 'a'-'z' respectively; other characters are returned as is.
Definition transform.hpp:74