LocARNA-1.8.11
Public Types | Public Member Functions | List of all members
LocARNA::AnchorConstraints Class Reference

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_typesize_pair_t
 size pair
 
typedef size_pair_t range_t
 type of range
 
typedef std::vector< range_trange_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
 

Detailed Description

Represents anchor constraints between two sequences.

Maintains the constraints on (non-structural) alignment edges that have to be satisfied during the alignment

Constructor & Destructor Documentation

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.

Parameters
lenAlength of sequence A
seqCAvector of anchor strings for sequence A
lenBlength of sequence B
seqCBvector 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.

Parameters
lenAlength of sequence A
seqCAconcatenated anchor strings for sequence A (separated by '#')
lenBlength of sequence B
seqCBconcatenated anchor strings for sequence B (separated by '#')

for semantics of anchor strings see first constructor

Member Function Documentation

bool LocARNA::AnchorConstraints::allowed_edge ( size_type  i,
size_type  j 
) const
inline

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

int LocARNA::AnchorConstraints::match_to_a ( size_type  i) const
inline

matching position in b for position i in a

Parameters
iposition in sequence A
Returns
j, 1<=j<=lenB, if there is an anchor from A_i to B_j, 0 if there is no name for position i in A, and -1 if there is a name for A_i, but no match to B
int LocARNA::AnchorConstraints::match_to_b ( size_type  i) const
inline

matching position in b for position i in a

Parameters
iposition in sequence B
Returns
j
See also
match_to_a

The documentation for this class was generated from the following files: