LocARNA-1.8.11
|
Represents anchor constraints between two sequences. More...
#include <anchor_constraints.hh>
Public Types | |
typedef size_t | size_type |
size type | |
typedef std::pair< size_type, size_type > | size_pair_t |
size pair | |
typedef size_pair_t | range_t |
type of range | |
typedef std::vector< range_t > | range_seq_t |
type for sequence of ranges | |
Public Member Functions | |
AnchorConstraints (size_type lenA, const std::vector< std::string > &seqCA, size_type lenB, const std::vector< std::string > &seqCB) | |
Construct from sequence lengths and anchor names. More... | |
AnchorConstraints (size_type lenA, const std::string &seqCA, size_type lenB, const std::string &seqCB) | |
Construct from sequence lengths and anchor names. More... | |
bool | allowed_edge (size_type i, size_type j) const |
int | match_to_a (size_type i) const |
int | match_to_b (size_type i) const |
bool | aligned_in_a (size_type i) const |
is position i in sequence A aligned to any position in B | |
bool | aligned_in_b (size_type j) const |
is position j in sequence B aligned to any position in A | |
std::string | get_name_a (size_type i) const |
get the name of position i in A | |
std::string | get_name_b (size_type j) const |
get the name of position j in B | |
size_type | name_size () const |
returns length/size of the names | |
bool | empty () const |
is the constraint declaration empty | |
size_pair_t | rightmost_anchor () const |
return the positions (i,j) of the rightmost anchor constraint | |
size_pair_t | leftmost_anchor () const |
return the positions (i,j) of the leftmost anchor constraint | |
Represents anchor constraints between two sequences.
Maintains the constraints on (non-structural) alignment edges that have to be satisfied during the alignment
LocARNA::AnchorConstraints::AnchorConstraints | ( | size_type | lenA, |
const std::vector< std::string > & | seqCA, | ||
size_type | lenB, | ||
const std::vector< std::string > & | seqCB | ||
) |
Construct from sequence lengths and anchor names.
lenA | length of sequence A |
seqCA | vector of anchor strings for sequence A |
lenB | length of sequence B |
seqCB | vector of anchor strings for sequence B |
The constraints (=alignment edges that have to be satisfied) are encoded as follows: equal symbols in the sequences for A and B form an edge
In order to specify an arbitrary number of sequences, the strings can consist of several lines, then a symbol consists of all characters of the column. '.' and ' ' are neutral character, in the sense that columns consisting only of neutral characters do not specify names that have to match. However, neutral characters are not identified in names that contain at least one non-neutral character!
Example: seqCA={"..123...."} seqCB={"...12.3...."}
specifies the edges (3,4), (4,5), and (5,7)
Example 2: seqCA={"..AAB....", "..121...."} seqCB={"...AA.B....", "...12.1...."} specifies the same constraints, allowing a larger name space for constraints.
LocARNA::AnchorConstraints::AnchorConstraints | ( | size_type | lenA, |
const std::string & | seqCA, | ||
size_type | lenB, | ||
const std::string & | seqCB | ||
) |
Construct from sequence lengths and anchor names.
lenA | length of sequence A |
seqCA | concatenated anchor strings for sequence A (separated by '#') |
lenB | length of sequence B |
seqCB | concatenated anchor strings for sequence B (separated by '#') |
for semantics of anchor strings see first constructor
is the alignment edge i~j (i.e. the match of i and j) allowed? an alignment edge is allowed, iff it is not in conflict with any anchor constraint
|
inline |
matching position in b for position i in a
i | position in sequence A |
|
inline |
matching position in b for position i in a
i | position in sequence B |