LocARNA-2.0.0
Public Member Functions | List of all members
LocARNA::TraceController Class Reference

Controls the matrix cells valid for traces. More...

#include <trace_controller.hh>

Inheritance diagram for LocARNA::TraceController:
Inheritance graph
[legend]
Collaboration diagram for LocARNA::TraceController:
Collaboration graph
[legend]

Public Member Functions

 TraceController (const Sequence &seqA, const Sequence &seqB, const MultipleAlignment *ma, int delta, bool relaxed_merging=false)
 Constructs for the general case of alignment of alignments. More...
 
virtual ~TraceController ()
 Virtual destructor.
 
void restrict_by_anchors (const AnchorConstraints &constraints)
 Restrict by anchor constraints. More...
 
void restrict_by_trace_probabilities (const TraceProbs &trace_probs, double min_prob)
 Restrict by anchor constraints. More...
 
TraceController reverse () const
 Controller for the reversed sequences. More...
 
bool is_valid (size_type i, size_type j) const
 Is (i,j) a valid cell of the DP matrices (i.e. on some possible trace)? More...
 
virtual bool is_valid_match (size_type i, size_type j) const
 
size_type get_delta () const
 Read deviation. More...
 
- Public Member Functions inherited from LocARNA::TraceRange
 TraceRange (const SeqEntry &pseqA, const SeqEntry &pseqB, const SeqEntry &aliA, const SeqEntry &aliB, size_type delta)
 Construct from pair of alignment strings. More...
 
 TraceRange (size_type lenA, size_type lenB, const std::vector< TraceRange > &trs, size_type delta)
 Construct as consensus trace range from a set of traces. More...
 
size_type consensus_cost (size_type i, size_type j, const std::vector< TraceRange > &trs) const
 Computes cost of a cut in the consensus trace of a trace range set. More...
 
size_t rows () const
 Read number of rows. More...
 
size_t min_col (size_t i) const
 Minimal column of trace in a row. More...
 
size_t max_col (size_t i) const
 Maximal column of trace in a row. More...
 
TraceRange reverse () const
 Ranges for reversed sequences. More...
 
void print_debug (std::ostream &out=std::cerr) const
 

Additional Inherited Members

- Public Types inherited from LocARNA::TraceRange
typedef MultipleAlignment::SeqEntry SeqEntry
 alias for MultipleAlignment::SeqEntry
 
typedef std::pair< SeqEntry, SeqEntryseqentry_pair_t
 pair of sequence entries
 
- Static Public Member Functions inherited from LocARNA::TraceRange
static seqentry_pair_t remove_common_gaps (const SeqEntry &aliA, const SeqEntry &aliB)
 
- Protected Types inherited from LocARNA::TraceRange
using idx_vec_t = std::vector< size_t >
 
- Protected Member Functions inherited from LocARNA::TraceRange
 TraceRange (size_t lenA, size_t lenB)
 Construct "empty". More...
 
- Protected Attributes inherited from LocARNA::TraceRange
size_t lenA_
 length of sequence A
 
size_t lenB_
 length of sequence B
 
idx_vec_t min_col_
 minimal column in row
 
idx_vec_t max_col_
 maximal column in row
 

Detailed Description

Controls the matrix cells valid for traces.

Controls the matrix cells that need to be filled in a dynamic programming algorithm because they occur on valid traces due to the max-diff heuristic

The valid traces can be defined either unrestricted, or by a maximal difference of i and j for matrix cells (i,j) or due to a maximal difference to a given alignment (trace).

Constructor & Destructor Documentation

◆ TraceController()

LocARNA::TraceController::TraceController ( const Sequence seqA,
const Sequence seqB,
const MultipleAlignment ma,
int  delta,
bool  relaxed_merging = false 
)

Constructs for the general case of alignment of alignments.

Parameters
seqAsequence A
seqBsequence B
mamultiple reference alignment
deltathe allowed difference
relaxed_mergingwhether to use relaxed merging of trace ranges
Note
If delta == -1 then min_col is 1 and max_col is lenB
If delta != -1 and ma==NULL, then define min j, max j by deviation |i-(lenA/lenB)*j|<=delta
These values are chosen such that for all j between min and max, the delta constraint holds for all pairs of sequences in seqA and seqB.

Member Function Documentation

◆ get_delta()

size_type LocARNA::TraceController::get_delta ( ) const
inline

Read deviation.

Returns
deviation Delta

◆ is_valid()

bool LocARNA::TraceController::is_valid ( size_type  i,
size_type  j 
) const
inline

Is (i,j) a valid cell of the DP matrices (i.e. on some possible trace)?

test for matrix entries on valid trace

Parameters
iposition in sequence A in 1..lenA or 0
jposition in sequence B in 1..lenB or 0
Returns
whether matrix cell (i.j) is valid
Parameters
iindex
jindex
Returns
flag, whether (i,j) is valid
Note
(i,j) must be matrix entry, i.e. in correct range

◆ is_valid_match()

bool LocARNA::TraceController::is_valid_match ( size_type  i,
size_type  j 
) const
inlinevirtual

test for allowed matches due to valid traces

Parameters
iposition in sequence A in 1..lenA
jposition in sequence B in 1..lenB
Returns
whether i~j is an allowed match due to valid traces

Implements LocARNA::MatchController.

◆ restrict_by_anchors()

void LocARNA::TraceController::restrict_by_anchors ( const AnchorConstraints constraints)

Restrict by anchor constraints.

Limits trace ranges due to anchor constraints

Parameters
constraintsanchor constraints

◆ restrict_by_trace_probabilities()

void LocARNA::TraceController::restrict_by_trace_probabilities ( const TraceProbs trace_probs,
double  min_prob 
)

Restrict by anchor constraints.

Limits trace ranges due to anchor constraints

Parameters
trace_probstrace probabilities
min_probminimum trace probability

Limit trace to the ranges that contain all trace cells (i,j) that have at least the threshold probability min_prob

◆ reverse()

TraceController LocARNA::TraceController::reverse ( ) const

Controller for the reversed sequences.

Note
useful for backward alignment e.g. for computing edge probabilities; for an example
See also
PFGotoh::PFGotoh()

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