1 #ifndef LOCARNA_ALIGNER_IMPL_HH 2 #define LOCARNA_ALIGNER_IMPL_HH 10 #include "aligner_restriction.hh" 12 #include "alignment.hh" 13 #include "arc_matches.hh" 74 std::vector<M_matrix_t>
Ms_;
84 std::vector<ScoreVector>
Es_;
90 std::vector<infty_score_t>
Fs_;
108 enum {E_NO_NO, E_X_NO, E_NO_X, E_X_X,
109 E_OP_NO, E_NO_OP, E_OP_X, E_X_OP};
188 arc_length(
const Arc &a)
const {
202 : aligner_impl_(aligner_impl),lambda_(0) {}
231 -
FiniteInt(lambda_*(arc_length(a)+arc_length(b)));
308 template <
class ScoringView>
311 bool globalA,
bool exclA,
312 bool globalB,
bool exclB,
333 template<
class ScoringView>
349 bool allow_exclusion);
364 template<
class ScoringView>
381 template<
class ScoringView>
382 void trace_in_arcmatch(
int state,
int al,
int i,
int bl,
int j,
bool top_level,ScoringView sv);
395 template <
class ScoringView>
469 template <
class ScoringView>
470 void trace(ScoringView sv);
477 #endif // LOCARNA_ALIGNER_IMPL_HH size_t left() const
Definition: basepairs.hh:72
void trace_noex(int state, pos_type al, pos_type i, pos_type bl, pos_type j, bool top_level, ScoringView sv)
standard cases in trace back (without handling of exclusions)
Definition: aligner.cc:1073
size_t right() const
Definition: basepairs.hh:80
Scoring * mod_scoring_
used in normalized scoring, when we need to modify the scoring
Definition: aligner_impl.hh:38
bool D_created_
flag, is D already created?
Definition: aligner_impl.hh:98
Provides the standard view on the scoring.
Definition: aligner_impl.hh:122
Description of free end gaps.
Definition: params.hh:28
size_type pos_type
type of a sequence position
Definition: aux.hh:97
void align_in_arcmatch(pos_type al, pos_type ar, pos_type bl, pos_type br, bool allow_exclusion)
Definition: aligner.cc:434
infty_score_t align()
compute the alignment score
Definition: aligner.cc:928
const AlignerParams * params_
the parameter for the alignment
Definition: aligner_impl.hh:35
const Arc & arcA() const
Definition: arc_matches.hh:66
AlignerRestriction r_
restriction of alignment for k-best
Definition: aligner_impl.hh:64
ModifiedScoringView(const AlignerImpl *aligner_impl)
Definition: aligner_impl.hh:201
void align_D()
Definition: aligner.cc:691
void fill_D_entries(pos_type al, pos_type bl)
Definition: aligner.cc:597
Maintains the relevant arc matches and their scores.
Definition: arc_matches.hh:112
infty_score_t D(const Arc &a, const Arc &b) const
Definition: aligner_impl.hh:229
const UnmodifiedScoringView def_scoring_view_
Default scoring view.
Definition: aligner_impl.hh:248
int max_i_
subsequence of A right end, computed by align_top_level
Definition: aligner_impl.hh:95
std::vector< infty_score_t > Fs_
Definition: aligner_impl.hh:90
const Scoring * scoring() const
Definition: aligner_impl.hh:219
int min_i_
subsequence of A left end, computed by trace back
Definition: aligner_impl.hh:92
Definition: aligner.cc:17
UnmodifiedScoringView(const AlignerImpl *aligner_impl)
Definition: aligner_impl.hh:133
const Sequence & seqB_
sequence B
Definition: aligner_impl.hh:41
const Scoring * scoring_
the scores
Definition: aligner_impl.hh:37
Implementation of Aligner.
Definition: aligner_impl.hh:24
Alignment alignment_
resulting alignment
Definition: aligner_impl.hh:100
const ArcMatches & arc_matches_
the potential arc matches between A and B
Definition: aligner_impl.hh:43
ModifiedScoringView mod_scoring_view_
Modified scoring view for normalized alignment.
Definition: aligner_impl.hh:249
BasePairs__Arc Arc
an arc
Definition: aligner_impl.hh:33
const BasePairs & bpsA_
base pairs of A
Definition: aligner_impl.hh:45
infty_score_t align_top_level_free_endgaps()
Definition: aligner.cc:760
Definition: infty_int.hh:344
void trace_arcmatch(const ArcMatch &am)
Definition: aligner.cc:965
const Arc & arcB() const
Definition: arc_matches.hh:74
~AlignerImpl()
Definition: aligner.cc:158
Parameter for alignment by Aligner.
Definition: params.hh:101
Definition: infty_int.hh:464
infty_score_t D(const ArcMatch &am) const
Definition: aligner_impl.hh:241
const Scoring * scoring() const
Definition: aligner_impl.hh:140
infty_score_t align_top_level_locally(ScoringView sv)
Definition: aligner.cc:837
Provides a modified view on the scoring.
Definition: aligner_impl.hh:174
void trace_arcmatch_noLP(const ArcMatch &am)
Definition: aligner.cc:1026
simple 2D matrix class, provides access via operator (int,int)
Definition: aligner_impl.hh:19
infty_score_t D(const ArcMatch &am) const
Definition: aligner_impl.hh:161
void init_state(int state, pos_type al, pos_type ar, pos_type bl, pos_type br, bool globalA, bool exclA, bool globalB, bool exclB, ScoringView sv)
initialize matrices M and E
Definition: aligner.cc:341
const BasePairs & bpsB_
base pairs of B
Definition: aligner_impl.hh:46
std::vector< ScoreVector > Es_
Definition: aligner_impl.hh:84
ScoreMatrix Dmat_
matrix indexed by the arc indices of rnas A and B
Definition: aligner_impl.hh:67
int min_j_
subsequence of B left end, computed by trace back
Definition: aligner_impl.hh:93
void set_lambda(score_t lambda)
Definition: aligner_impl.hh:210
const Sequence & seqA_
sequence A
Definition: aligner_impl.hh:40
Represents a structure-annotated sequence alignment.
Definition: alignment.hh:87
infty_score_t & D(const ArcMatch &am)
Definition: aligner_impl.hh:448
Represents a base pair.
Definition: basepairs.hh:40
void trace_in_arcmatch(int state, int al, int i, int bl, int j, bool top_level, ScoringView sv)
align top level in the scanning version
Definition: aligner.cc:1219
void trace(ScoringView sv)
Definition: aligner.cc:1338
infty_score_t D(const Arc &a, const Arc &b) const
Definition: aligner_impl.hh:150
infty_score_t align_noex(int state, pos_type al, pos_type bl, pos_type i, pos_type j, ScoringView sv)
standard cases for alignment (without exlusion handling).
Definition: aligner.cc:189
Provides methods for the scoring of alignments.
Definition: scoring.hh:285
infty_score_t & D(const Arc &arcA, const Arc &arcB)
Definition: aligner_impl.hh:460
size_t idx() const
Definition: basepairs.hh:88
AlignerImpl(const AlignerImpl &a)
copy constructor
Definition: aligner.cc:88
Describes sequence and structure ensemble of an RNA.
Definition: basepairs.hh:107
long int score_t
type of the locarna score as defined by the class Scoring
Definition: scoring_fwd.hh:13
"Sequence View" of multiple alignment as array of column vectors
Definition: sequence.hh:29
Represents a match of two base pairs (arc match)
Definition: arc_matches.hh:35
Restricts range of an alignment in Aligner.
Definition: aligner_restriction.hh:26
std::vector< M_matrix_t > Ms_
Definition: aligner_impl.hh:74
int max_j_
subsequence of B right end, computed by align_top_level
Definition: aligner_impl.hh:96
ScoreMatrix M_matrix_t
Definition: aligner_impl.hh:30
void fill_D_entries_noLP(pos_type al, pos_type bl)
Definition: aligner.cc:641