15#include <seqan3/alphabet/detail/convert.hpp>
28template <
typename derived_type, auto size>
41 constexpr aminoacid_base()
noexcept =
default;
42 constexpr aminoacid_base(aminoacid_base
const &)
noexcept =
default;
43 constexpr aminoacid_base(aminoacid_base &&)
noexcept =
default;
44 constexpr aminoacid_base & operator=(aminoacid_base
const &)
noexcept =
default;
45 constexpr aminoacid_base & operator=(aminoacid_base &&)
noexcept =
default;
46 ~aminoacid_base()
noexcept =
default;
70 template <
typename other_aa_type>
71 requires (!std::same_as<aminoacid_base, other_aa_type>) && (!std::same_as<derived_type, other_aa_type>)
73 && detail::convertable_to_through_char_representation<other_aa_type, derived_type>
76 if constexpr (is_constexpr_default_constructible_v<other_aa_type>
77 && detail::writable_constexpr_alphabet<other_aa_type>)
79 static_cast<derived_type &
>(*this) =
80 detail::convert_through_char_representation<other_aa_type, derived_type>[
seqan3::to_rank(other)];
110 return valid_char_table[
static_cast<uint8_t
>(c)];
123 for (
size_t rank = 0u; rank < derived_type::alphabet_size; ++rank)
125 uint8_t c = derived_type::rank_to_char(rank);
Provides seqan3::aminoacid_alphabet.
Provides alphabet helper concepts.
Provides seqan3::alphabet_base.
constexpr alphabet_base() noexcept=default
constexpr rank_type to_rank() const noexcept
Definition alphabet_base.hpp:134
detail::min_viable_uint_t< size - 1 > rank_type
Definition alphabet_base.hpp:77
static constexpr detail::min_viable_uint_t< size > alphabet_size
Definition alphabet_base.hpp:196
std::conditional_t< std::same_as< char, void >, char, char > char_type
Definition alphabet_base.hpp:69
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 aminoacid_base.hpp:108
constexpr aminoacid_base(other_aa_type const other) noexcept
Allow explicit construction from any other aminoacid type and convert via the character representatio...
Definition aminoacid_base.hpp:74
constexpr auto assign_char_to
Assign a character to an alphabet object.
Definition alphabet/concept.hpp:517
constexpr auto to_char
Return the char representation of an alphabet object.
Definition alphabet/concept.hpp:381
constexpr auto to_rank
Return the rank representation of a (semi-)alphabet object.
Definition alphabet/concept.hpp:152
A concept that indicates whether an alphabet represents amino acids.
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
This is an empty base class that can be inherited by types that shall model seqan3::aminoacid_alphabe...
Definition alphabet/aminoacid/concept.hpp:32