81 template <u
int8_t SIZE = 51>
105 constexpr wuss(wuss
const &) =
default;
106 constexpr wuss(wuss &&) =
default;
107 constexpr wuss & operator=(wuss
const &) =
default;
108 constexpr wuss & operator=(wuss &&) =
default;
120 static this_type_deferred constexpr
UNPAIRED = this_type_deferred{}.assign_char(
'.');
122 static this_type_deferred constexpr
UNPAIRED1 = this_type_deferred{}.assign_char(
':');
124 static this_type_deferred constexpr
UNPAIRED2 = this_type_deferred{}.assign_char(
',');
126 static this_type_deferred constexpr
UNPAIRED3 = this_type_deferred{}.assign_char(
'-');
128 static this_type_deferred constexpr
UNPAIRED4 = this_type_deferred{}.assign_char(
'_');
130 static this_type_deferred constexpr
UNPAIRED5 = this_type_deferred{}.assign_char(
'~');
132 static this_type_deferred constexpr
UNPAIRED6 = this_type_deferred{}.assign_char(
';');
135 static this_type_deferred constexpr
PAIR_OPEN = this_type_deferred{}.assign_char(
'<');
137 static this_type_deferred constexpr
PAIR_OPEN1 = this_type_deferred{}.assign_char(
'(');
139 static this_type_deferred constexpr
PAIR_OPEN2 = this_type_deferred{}.assign_char(
'[');
141 static this_type_deferred constexpr
PAIR_OPEN3 = this_type_deferred{}.assign_char(
'{');
144 static this_type_deferred constexpr
PAIR_CLOSE = this_type_deferred{}.assign_char(
'>');
146 static this_type_deferred constexpr
PAIR_CLOSE1 = this_type_deferred{}.assign_char(
')');
148 static this_type_deferred constexpr
PAIR_CLOSE2 = this_type_deferred{}.assign_char(
']');
150 static this_type_deferred constexpr
PAIR_CLOSE3 = this_type_deferred{}.assign_char(
'}');
162 return interaction_tab[
to_rank()] < 0;
170 return interaction_tab[
to_rank()] > 0;
178 return interaction_tab[
to_rank()] == 0;
194 if (interaction_tab[
to_rank()] != 0)
195 return std::abs(interaction_tab[
to_rank()]) - 1;
204 static constexpr std::array<char_type, value_size> rank_to_char
208 std::array<char_type, value_size> chars
210 '.',
':',
',',
'-',
'_',
'~',
';',
'<',
'(',
'[',
'{',
'>',
')',
']',
'}' 217 chars[rnk] =
'A' + off;
218 chars[rnk + 1u] =
'a' + off;
226 static constexpr std::array<rank_type, 256> char_to_rank
230 std::array<rank_type, 256> rank_table{};
238 rank_table[rank_to_char[rnk]] = rnk;
244 static std::array<int8_t, SIZE>
const interaction_tab;
247 template <u
int8_t SIZE>
250 std::array<int8_t, value_size> interaction_table{};
258 interaction_table[rnk] = 0;
265 interaction_table[rnk] = --cnt_open;
272 interaction_table[rnk] = ++cnt_close;
277 interaction_table[rnk] = --cnt_open;
278 interaction_table[rnk + 1] = ++cnt_close;
281 return interaction_table;
308 inline std::vector<wuss51>
operator""_wuss51(
const char * str, std::size_t len)
310 std::vector<wuss51> vec;
313 for (
size_t idx = 0; idx < len; ++idx)
constexpr bool is_unpaired() const noexcept
Check whether the character represents an unpaired position in an RNA structure.
Definition: wuss.hpp:176
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:89
char char_type
The type of the alphabet when converted to char (e.g. via to_char()).
Definition: alphabet_base.hpp:87
constexpr bool is_pair_close() const noexcept
Check whether the character represents a leftward interaction in an RNA structure.
Definition: wuss.hpp:168
constexpr std::optional< uint8_t > pseudoknot_id() const noexcept
Get an identifier for a pseudoknotted interaction. Opening and closing brackets of the same type have...
Definition: wuss.hpp:192
wuss< 51 > wuss51
Alias for the default type wuss51.
Definition: wuss.hpp:285
static this_type_deferred constexpr UNPAIRED4
_ not paired (hairpin loop)
Definition: wuss.hpp:128
static this_type_deferred constexpr PAIR_CLOSE2
] bracket right (internal helix enclosing ())
Definition: wuss.hpp:148
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:58
static this_type_deferred constexpr PAIR_CLOSE
> bracket right (simple terminal stem)
Definition: wuss.hpp:144
static this_type_deferred constexpr PAIR_OPEN1
( bracket left (internal helix enclosing <>)
Definition: wuss.hpp:137
constexpr bool is_pair_open() const noexcept
Check whether the character represents a rightward interaction in an RNA structure.
Definition: wuss.hpp:160
static this_type_deferred constexpr PAIR_OPEN2
[ bracket left (internal helix enclosing ())
Definition: wuss.hpp:139
static this_type_deferred constexpr UNPAIRED1
: not paired (external residue outside structure)
Definition: wuss.hpp:122
static detail::min_viable_uint_t< size > constexpr value_size
The size of the alphabet, i.e. the number of different values it can take.
Definition: alphabet_base.hpp:198
static this_type_deferred constexpr PAIR_CLOSE1
) bracket right (internal helix enclosing <>)
Definition: wuss.hpp:146
The WUSS structure alphabet of the characters .<>:,-_~;()[]{}AaBbCcDd...
Definition: wuss.hpp:82
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:89
Provides seqan3::alphabet_base.
static this_type_deferred constexpr UNPAIRED2
, not paired (multifurcation loop)
Definition: wuss.hpp:124
Metafunction that indicates to what extent an alphabet can handle pseudoknots. [value metafunction ba...
Definition: concept_pre.hpp:228
constexpr char_type to_char() const noexcept
Return the letter as a character of char_type.
Definition: alphabet_base.hpp:120
constexpr wuss< SIZE > & assign_char(std::conditional_t< std::Same< char_type, void >, char, char_type > const c) noexcept
Assign from a character.
Definition: alphabet_base.hpp:165
static this_type_deferred constexpr UNPAIRED3
- not paired (bulge, interior loop)
Definition: wuss.hpp:126
Provides utilities for modifying characters.
constexpr rank_type to_rank() const noexcept
Return the letter's numeric value (rank in the alphabet).
Definition: alphabet_base.hpp:142
static this_type_deferred constexpr PAIR_OPEN
< bracket left (simple terminal stem)
Definition: wuss.hpp:135
Core alphabet concept and free function/metafunction wrappers.
A CRTP-base that makes defining a custom alphabet easier.
Definition: alphabet_base.hpp:77
static this_type_deferred constexpr PAIR_CLOSE3
} bracket right (internal helix enclosing [])
Definition: wuss.hpp:150
static this_type_deferred constexpr UNPAIRED
. not paired (insertion to known structure)
Definition: wuss.hpp:120
static this_type_deferred constexpr UNPAIRED5
~ not paired (due to local alignment)
Definition: wuss.hpp:130
static this_type_deferred constexpr UNPAIRED6
; not paired
Definition: wuss.hpp:132
static this_type_deferred constexpr PAIR_OPEN3
{ bracket left (internal helix enclosing [])
Definition: wuss.hpp:141
char_t char_type
The type of the alphabet when converted to char (e.g. via to_char()).
Definition: alphabet_base.hpp:87