LocARNA-2.0.0
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
LocARNA::TraceRange Class Reference

Represents a range of traces. More...

#include <trace_controller.hh>

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

Public Types

typedef MultipleAlignment::SeqEntry SeqEntry
 alias for MultipleAlignment::SeqEntry
 
typedef std::pair< SeqEntry, SeqEntryseqentry_pair_t
 pair of sequence entries
 

Public Member Functions

 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
 

Static Public Member Functions

static seqentry_pair_t remove_common_gaps (const SeqEntry &aliA, const SeqEntry &aliB)
 

Protected Types

using idx_vec_t = std::vector< size_t >
 

Protected Member Functions

 TraceRange (size_t lenA, size_t lenB)
 Construct "empty". More...
 

Protected Attributes

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

Represents a range of traces.

Represents a range of possible traces in a dynamic programming matrix for aligning two sequences

See also
TraceController

Constructor & Destructor Documentation

◆ TraceRange() [1/3]

LocARNA::TraceRange::TraceRange ( const SeqEntry pseqA,
const SeqEntry pseqB,
const SeqEntry aliA,
const SeqEntry aliB,
size_type  delta 
)

Construct from pair of alignment strings.

construct trace range of two sequences given two alignment strings of the sequences and the allowed deviation delta the sequences can contain gaps themselves (which happens, when sequences orignate from a sequence profile).

Parameters
pseqASeqEntry of sequence A
pseqBSeqEntry of sequence B
aliAalignment SeqEntry for sequence A
aliBalignment SeqEntry for sequence B
deltathe allowed deviation

side conditions: remove_gaps(seqA) == remove_gaps(aliA) && remove_gaps(seqB) == remove_gaps(aliB) where remove_gaps is a function that removes all gap symbols length(aliA)==length(aliB)

◆ TraceRange() [2/3]

LocARNA::TraceRange::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.

Constructs object as consensus trace ranges of the traces trs. The construction follows an idea of relaxing the deviation constraints by computing a trace with minimal accumulated distance to all traces and then determining its delta environment.

Parameters
lenAlength of sequence A
lenBlength of sequence B
trsset of traces
deltadeviation

◆ TraceRange() [3/3]

LocARNA::TraceRange::TraceRange ( size_t  lenA,
size_t  lenB 
)
inlineprotected

Construct "empty".

only sets lengths

Member Function Documentation

◆ consensus_cost()

size_type LocARNA::TraceRange::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.

Parameters
icut.first
jcut.second
trsset of trace ranges
Returns
cost of cut (i,j) in consensus of trs

◆ max_col()

size_t LocARNA::TraceRange::max_col ( size_t  i) const
inline

Maximal column of trace in a row.

Parameters
irow of matrix, 0<=i<=rows()
Returns
maximal valid trace cell in the row i

◆ min_col()

size_t LocARNA::TraceRange::min_col ( size_t  i) const
inline

Minimal column of trace in a row.

Parameters
irow of matrix, 0<=i<=rows()
Returns
minimal valid trace cell in the row i

◆ print_debug()

void LocARNA::TraceRange::print_debug ( std::ostream &  out = std::cerr) const

Print object to ouptut stream for debugging

Parameters
outoutput stream

◆ remove_common_gaps()

TraceRange::seqentry_pair_t LocARNA::TraceRange::remove_common_gaps ( const SeqEntry aliA,
const SeqEntry aliB 
)
static

Remove common gaps in pairwise alignment

Parameters
aliAalignment string A with name (SeqEntry)
aliBalignment string B with name (SeqEntry)
Returns
pair of "sequence entries" that represent the pairwise alignment given by aliA and aliB where gap-only columns are removed

◆ reverse()

TraceRange LocARNA::TraceRange::reverse ( ) const

Ranges for reversed sequences.

Returns
the "reversed" ranges

◆ rows()

size_t LocARNA::TraceRange::rows ( ) const
inline

Read number of rows.

Returns
length of seqA, i.e. the maximal row of the trace

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