LocARNA-2.0.0
Classes | Public Types | Public Member Functions | List of all members
LocARNA::EPM Class Reference

a class for the representation of exact pattern matches (EPM) More...

#include <exact_matcher.hh>

Public Types

typedef BasePairs__Arc Arc
 arc class of BasePairs
 
typedef SparsificationMapper::seq_pos_t seqpos_t
 a type for a sequence position
 
typedef SparseTraceController::matpos_t matpos_t
 a type for a position in a sparsified matrix
 
typedef SparsificationMapper::ArcIdx ArcIdx
 arc index
 
typedef SparseTraceController::pair_seqpos_t pair_seqpos_t
 pair of positions in sequence A and B
 
typedef std::pair< ArcIdx, ArcIdxPairArcIdx
 pair of arc indices
 
typedef std::vector< PairArcIdxPairArcIdxVec
 a vector of pairs of arc indices
 
typedef triple< seqpos_t, seqpos_t, char > el_pat_vec
 
typedef std::vector< el_pat_vecpat_vec_t
 type for pattern vector
 

Public Member Functions

 EPM ()
 Constructor.
 
virtual ~EPM ()
 destructor
 
score_t get_score () const
 returns the score of the EPM
 
int get_state () const
 return the current matrix state of the EPM
 
const matpos_tget_cur_pos () const
 returns the current matrix position of the EPM
 
const score_tget_max_tol_left () const
 returns the maximal tolerance that is left for the EPM
 
bool get_first_insertion () const
 returns whether it is the first insertion into the EPM
 
bool is_invalid () const
 
void set_score (score_t score_)
 
void set_state (int state_)
 
void set_cur_pos (const matpos_t &cur_pos_)
 
void set_max_tol_left (score_t tol)
 
void set_first_insertion (bool first_insertion_)
 
void set_invalid ()
 sets the flag invalid for the EPM
 
const PairArcIdxget_am (PairArcIdxVec::size_type idx) const
 
PairArcIdxVec::size_type number_of_am ()
 
void clear_am_to_do ()
 deletes the list am_to_do
 
PairArcIdxVec::const_iterator am_begin () const
 
PairArcIdxVec::const_iterator am_end () const
 
el_pat_vec pat_vec_at (pat_vec_t::size_type idx) const
 
pat_vec_t::size_type pat_vec_size () const
 
pat_vec_t::const_iterator begin () const
 
pat_vec_t::const_iterator end () const
 
pair_seqpos_t last_matched_pos ()
 
void add (seqpos_t posA, seqpos_t posB, char c)
 
void overwrite (seqpos_t posA, seqpos_t posB, char c, pat_vec_t::size_type pos)
 
void add_am (const Arc &a, const Arc &b)
 
void store_am (const Arc &a, const Arc &b)
 
PairArcIdx next_arcmatch ()
 
void sort_patVec ()
 
void sort_am_to_do ()
 
void insert_epm (const EPM &epm_to_insert)
 
bool includes (const EPM &epm_to_test) const
 
bool includes_am (const EPM &epm_to_test) const
 
void print_epm (std::ostream &out, bool verbose) const
 

Detailed Description

a class for the representation of exact pattern matches (EPM)

Member Typedef Documentation

◆ el_pat_vec

type for elements of the pattern vector, <position in seq A, position in sequence B, structure>

Member Function Documentation

◆ add()

void LocARNA::EPM::add ( seqpos_t  posA,
seqpos_t  posB,
char  c 
)
inline

adds an element to the pattern vector

Parameters
posAposition in sequence A that is added to the pattern vector
posBposition in sequence B that is added to the pattern vector
cchar that specifies the match (sequential match '.', structural match '(' or ')' )

◆ add_am()

void LocARNA::EPM::add_am ( const Arc a,
const Arc b 
)
inline

appends an arc match to the EPM

Parameters
aarc in sequence A
barc in sequence B

◆ am_begin()

PairArcIdxVec::const_iterator LocARNA::EPM::am_begin ( ) const
inline

begin of vector that stores the pairs of arc indices that need to be computed

Returns
an iterator to the beginning of am_to_do

◆ am_end()

PairArcIdxVec::const_iterator LocARNA::EPM::am_end ( ) const
inline

end of vector that stores the pairs of arc indices that need to be computed

Returns
an iterator to the end of am_to_do

◆ begin()

pat_vec_t::const_iterator LocARNA::EPM::begin ( ) const
inline

begin of pattern vector

Returns
an iterator to the beginning of the pattern vector pat_vec

◆ end()

pat_vec_t::const_iterator LocARNA::EPM::end ( ) const
inline

end of pattern vector

Returns
an iterator to the end of the pattern vector pat_vec

◆ get_am()

const PairArcIdx& LocARNA::EPM::get_am ( PairArcIdxVec::size_type  idx) const
inline

returns the pair of arc indices at position pos

Parameters
idxindex in the PairArcIdxVec
Returns
returns the PairArcIdx at the index idx in the am_to_do vector

◆ includes()

bool LocARNA::EPM::includes ( const EPM epm_to_test) const
inline

checks whether the current EPM includes the EPM epm_to_test

Parameters
epm_to_testEPM that is checked
Returns
true, if the current EPM includes the EPM epm_to_test false, otherwise

◆ includes_am()

bool LocARNA::EPM::includes_am ( const EPM epm_to_test) const
inline

checks whether the arcmatches of the current EPM includes the arcmatches of the epm_to_test

Parameters
epm_to_testEPM that is checked
Returns
true, if the arcmatches of the current EPM includes the arcmatches of the EPM epm_to_test false, otherwise

◆ insert_epm()

void LocARNA::EPM::insert_epm ( const EPM epm_to_insert)
inline

inserts the pattern vector of the EPM epm_to_insert into the current EPM

Parameters
epm_to_insertEPM that is inserted

◆ is_invalid()

bool LocARNA::EPM::is_invalid ( ) const
inline

returns whether the EPM is invalid (only used in the suboptimal traceback when inexact structural matches are allowed)

◆ last_matched_pos()

pair_seqpos_t LocARNA::EPM::last_matched_pos ( )
inline

returns the last sequence position that is matched in the EPM

Returns
the last sequence position that is matched in the EPM

◆ next_arcmatch()

PairArcIdx LocARNA::EPM::next_arcmatch ( )
inline

returns a pair of arc indices that is processed

Returns
the pair of arc indices that is processed next

◆ number_of_am()

PairArcIdxVec::size_type LocARNA::EPM::number_of_am ( )
inline

returns the number of pairs of arc indices that need to be computed

Returns
the number of arc matches in am_to_do

◆ overwrite()

void LocARNA::EPM::overwrite ( seqpos_t  posA,
seqpos_t  posB,
char  c,
pat_vec_t::size_type  pos 
)
inline

overwrites the element at position pos of the pattern vector

Parameters
posAposition in sequence A that is added to the pattern vector
posBposition in sequence B that is added to the pattern vector
cchar that specifies the match (sequential match '.', structural match '(' or ')' )
posposition in the pattern vector

◆ pat_vec_at()

el_pat_vec LocARNA::EPM::pat_vec_at ( pat_vec_t::size_type  idx) const
inline

returns the element of the pattern vector at position pos

Parameters
idxindex
Returns
the element of the pattern vector at idx

◆ pat_vec_size()

pat_vec_t::size_type LocARNA::EPM::pat_vec_size ( ) const
inline

return the size of the pattern vector

Returns
the size of the pattern vector pat_vec

◆ print_epm()

void LocARNA::EPM::print_epm ( std::ostream &  out,
bool  verbose 
) const
inline

prints the EPM

Parameters
outoutput stream object
verbosewhether to write additional information

◆ set_cur_pos()

void LocARNA::EPM::set_cur_pos ( const matpos_t cur_pos_)
inline

sets the matrix position of the EPM

Parameters
cur_pos_matrix position

◆ set_first_insertion()

void LocARNA::EPM::set_first_insertion ( bool  first_insertion_)
inline

sets the flag first_insertion for the EPM

Parameters
first_insertion_whether it is the first_insertion

◆ set_max_tol_left()

void LocARNA::EPM::set_max_tol_left ( score_t  tol)
inline

sets the maximal tolerance that is left for the EPM

Parameters
tolmaximal tolerance

◆ set_score()

void LocARNA::EPM::set_score ( score_t  score_)
inline

sets the score of the EPM

Parameters
score_score

◆ set_state()

void LocARNA::EPM::set_state ( int  state_)
inline

sets the matrix state of the EPM

Parameters
state_matrix state

◆ sort_am_to_do()

void LocARNA::EPM::sort_am_to_do ( )
inline

sorts the list of arcmatches am_to_do, such that includes_am works

◆ sort_patVec()

void LocARNA::EPM::sort_patVec ( )
inline

sorts the pattern vector according to the positions in the first sequence (automatically also sorted according to the positions in the second sequence)

◆ store_am()

void LocARNA::EPM::store_am ( const Arc a,
const Arc b 
)
inline

stores an arc match in the am_to_do data structure

Parameters
aarc in sequence A
barc in sequence B

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