LocARNA-1.8.11
|
An RNA secondary structure. More...
#include <rna_structure.hh>
Public Types | |
typedef std::pair< size_t, size_t > | bp_t |
base pair type | |
typedef std::set< bp_t, std::less< bp_t > > | bps_t |
base pair set type | |
typedef bps_t::const_iterator | const_iterator |
Check whether a loop contains a position. More... | |
Public Member Functions | |
RnaStructure () | |
construct empty | |
RnaStructure (const std::string &structure) | |
construct from dot-bracket string More... | |
bool | operator== (const RnaStructure &s) const |
Equality operator. More... | |
bool | contains (const bp_t &x) const |
Base pair for membership test. More... | |
size_t | length () const |
sequence length | |
size_t | size () const |
number of base pairs | |
void | insert (const bp_t &bp) |
insert base pair More... | |
void | remove (const bp_t &bp) |
remove base pair More... | |
void | clear () |
clear structure set structure to empty | |
const_iterator | begin () const |
begin of base pair set More... | |
const_iterator | end () const |
end of base pair set More... | |
std::string | to_string () const |
convert to dot-bracket string More... | |
bool | empty () const |
Check for empty structure / class PLAIN. More... | |
bool | nested () const |
Check for nested structure / class NESTED. More... | |
bool | crossing () const |
Check for crossing structure / class CROSSING. More... | |
Static Public Member Functions | |
static bool | empty (const bps_t &bps) |
Check base pair set for empty structure / class PLAIN. More... | |
static bool | nested (const bps_t &bps) |
Check for class NESTED. More... | |
static bool | crossing (const bps_t &bps) |
Check for class CROSSING. More... | |
An RNA secondary structure.
Represents a structure (for a sequence of given length) as set of base pairs. Supports parsing of dot-bracket strings (potentially including pseudoknots) and traversal of base pairs.
Generally, base pairs (i,j) have to be oriented, i.e. i<j; compare private method assert_valid_bp()
typedef bps_t::const_iterator LocARNA::RnaStructure::const_iterator |
Check whether a loop contains a position.
k | position |
x | loop; (0,length+1) means external loop |
Definition: the loop enclosed by (i,j) contains k iff i<k<j and there is no base pair (i',j') in the structure, where i<i'<k<j'<j. Note that we don't require (i,j) to be element of the structure.
k can be member of more than one loop unless nested().constant iterator over base pairs
|
explicit |
construct from dot-bracket string
structure | dot-bracket string |
We recognize different bracket pairs: (),[],{},<>, and letter pairs Aa, Bb, etc ; the structure string can encode crossing base pairs like in
.(((..[[.AA...)))..]]..aa.
The parser ignores all other symbols ( including _-,:.~ ) such that e.g. Vienna dot-bracket strings and WUSS notation is parsed correctly. Note that the parser is more general than the WUSS-specification, which forbids crossing of different bracket-symbols like [(...]), so that other common pseudoknot specifications are recognized as well.
|
inline |
begin of base pair set
|
inline |
Base pair for membership test.
x | base pair |
|
static |
Check for class CROSSING.
bps | set of base pairs |
A structure is in the crossing class if no base pairs share common ends.
|
inline |
Check for crossing structure / class CROSSING.
|
static |
Check base pair set for empty structure / class PLAIN.
bps | set of base pairs |
|
inline |
Check for empty structure / class PLAIN.
|
inline |
end of base pair set
|
inline |
insert base pair
bp | base pair |
|
static |
Check for class NESTED.
bps | set of base pairs |
A structure is in the class nested if no base pairs cross or share common ends.
|
inline |
Check for nested structure / class NESTED.
|
inline |
Equality operator.
s | rna structure to be compared |
|
inline |
remove base pair
bp | base pair |
std::string LocARNA::RnaStructure::to_string | ( | ) | const |
convert to dot-bracket string
If the structure contains crossing base pairs, such base pairs are encoded using more than one pair of bracket symbols. ( see constructor from dot bracket string ). The use of bracket symbols is greedy from left to right, following the order defined in the class (by constants open_symbols_ and close_symbols_).