33template <
typename structure_alph_type,
typename bpp_type, std::ranges::range structure_type>
37 throw parse_error{
"Cannot create base pair probabilities from a structure that is not RNA structure."};
40 if constexpr (std::ranges::sized_range<structure_type>)
45 for (structure_alph_type symbol :
structure)
50 if (symbol.is_pair_open())
54 else if (symbol.is_pair_close())
56 if (!brackets[
id].empty())
58 bpp[pos].emplace(weight, brackets[
id].top());
59 bpp[brackets[
id].
top()].emplace(weight, pos);
71 for (uint8_t
id = 0u; id < max_pseudoknot_depth<structure_alph_type>; ++
id)
73 if (!brackets[
id].empty())
Provides seqan3::rna_structure_alphabet.
constexpr auto pseudoknot_id
Retrieve an id for the level of a pseudoknotted interaction (also known as 'page number').
Definition alphabet/structure/concept.hpp:456
void bpp_from_rna_structure(bpp_type &bpp, structure_type const &structure, double weight=1.)
Transforms a structure annotation string into a base pair probability matrix.
Definition io/structure_file/detail.hpp:34
@ structure
Fixed interactions, usually a string of structure alphabet characters.
@ bpp
Base pair probability matrix of interactions, usually a matrix of float numbers.
@ id
The identifier, usually a string.
A concept that indicates whether an alphabet represents RNA structure.
Provides exceptions used in the I/O module.
The internal SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
Thrown if there is a parse error, such as reading an unexpected character from an input stream.
Definition io/exception.hpp:45