1 #ifndef LOCARNA_ALIGNER_IMPL_HH
2 #define LOCARNA_ALIGNER_IMPL_HH
12 #include "aligner_restriction.hh"
14 #include "alignment.hh"
15 #include "aligner_params.hh"
38 const std::unique_ptr<AlignerParams>
params_;
77 std::vector<M_matrix_t>
Ms_;
87 std::vector<ScoreVector>
Es_;
93 std::vector<infty_score_t>
Fs_;
142 : aligner_impl_(aligner_impl){};
201 : aligner_impl_(aligner_impl),
214 mod_scoring_->modify_by_parameter(lambda);
224 return mod_scoring_.get();
238 FiniteInt(lambda_ * (arc_length(a) + arc_length(b)));
252 (arc_length(am.
arcA()) + arc_length(am.
arcB())));
259 const std::unique_ptr<Scoring> mod_scoring_;
271 arc_length(
const Arc &a)
const {
332 template <
class ScoringView>
343 const ScoringView *sv);
365 template <
class ScoringView>
372 const ScoringView *sv);
392 bool allow_exclusion);
398 template <
class ScoringView>
406 template <
class ScoringView>
425 template <
class ScoringView>
433 const ScoringView *sv);
447 template <
class ScoringView>
455 const ScoringView *sv);
529 template <
class ScoringView>
531 trace(
const ScoringView *sv);
Provides a modified view on the scoring.
Definition: aligner_impl.hh:190
infty_score_t D(const Arc &a, const Arc &b) const
Definition: aligner_impl.hh:236
infty_score_t D(const ArcMatch &am) const
Definition: aligner_impl.hh:249
void set_lambda(score_t lambda)
Definition: aligner_impl.hh:212
const Scoring * scoring() const
Definition: aligner_impl.hh:223
ModifiedScoringView(const AlignerImpl *aligner_impl)
Definition: aligner_impl.hh:200
Provides the standard view on the scoring.
Definition: aligner_impl.hh:134
UnmodifiedScoringView(const AlignerImpl *aligner_impl)
Definition: aligner_impl.hh:141
infty_score_t D(const Arc &a, const Arc &b) const
Definition: aligner_impl.hh:163
infty_score_t D(const ArcMatch &am) const
Definition: aligner_impl.hh:175
const Scoring * scoring() const
Definition: aligner_impl.hh:150
Implementation of Aligner.
Definition: aligner_impl.hh:26
std::vector< infty_score_t > Fs_
Definition: aligner_impl.hh:93
const Scoring * scoring_
the scores
Definition: aligner_impl.hh:40
infty_score_t align()
compute the alignment score
Definition: aligner.cc:925
std::vector< ScoreVector > Es_
Definition: aligner_impl.hh:87
int max_i_
subsequence of A right end, computed by align_top_level
Definition: aligner_impl.hh:98
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, const ScoringView *sv)
initialize matrices M and E
Definition: aligner.cc:266
const Sequence & seqB_
sequence B
Definition: aligner_impl.hh:46
int max_j_
subsequence of B right end, computed by align_top_level
Definition: aligner_impl.hh:99
const UnmodifiedScoringView def_scoring_view_
Default scoring view.
Definition: aligner_impl.hh:277
void trace_noex(int state, pos_type al, pos_type i, pos_type bl, pos_type j, bool top_level, const ScoringView *sv)
standard cases in trace back (without handling of exclusions)
Definition: aligner.cc:1084
void align_D()
Definition: aligner.cc:661
int min_i_
subsequence of A left end, computed by trace back
Definition: aligner_impl.hh:95
ScoreMatrix M_matrix_t
Definition: aligner_impl.hh:33
infty_score_t penalized_align(score_t position_penalty)
Definition: aligner.cc:1604
BasePairs__Arc Arc
an arc
Definition: aligner_impl.hh:36
const ArcMatches & arc_matches_
hold arc matches ref for convenience; equals scoring_->arc_matches()
Definition: aligner_impl.hh:43
void trace_arcmatch(const ArcMatch &am)
Definition: aligner.cc:968
infty_score_t normalized_align(score_t L, bool verbose)
perform normalized local alignment with parameter L
Definition: aligner.cc:1527
void trace(const ScoringView *sv)
Definition: aligner.cc:1347
~AlignerImpl()
Definition: aligner.cc:133
infty_score_t align_noex(int state, pos_type al, pos_type bl, pos_type i, pos_type j, const ScoringView *sv)
standard cases for alignment (without exlusion handling).
Definition: aligner.cc:155
Alignment alignment_
resulting alignment
Definition: aligner_impl.hh:103
ScoreMatrix Dmat_
matrix indexed by the arc indices of rnas A and B
Definition: aligner_impl.hh:70
const std::unique_ptr< AlignerParams > params_
the parameter for the alignment
Definition: aligner_impl.hh:38
const BasePairs & bpsB_
base pairs of B
Definition: aligner_impl.hh:49
infty_score_t & D(const Arc &arcA, const Arc &arcB)
Definition: aligner_impl.hh:520
AlignerRestriction r_
restriction of alignment for k-best
Definition: aligner_impl.hh:67
bool D_created_
flag, is D already created?
Definition: aligner_impl.hh:101
int min_j_
subsequence of B left end, computed by trace back
Definition: aligner_impl.hh:96
AlignerImpl(const AlignerImpl &a)
copy constructor
Definition: aligner.cc:78
std::vector< M_matrix_t > Ms_
Definition: aligner_impl.hh:77
void fill_D_entries(pos_type al, pos_type bl)
Definition: aligner.cc:575
void trace_arcmatch_noLP(const ArcMatch &am)
Definition: aligner.cc:1031
void align_in_arcmatch(pos_type al, pos_type ar, pos_type bl, pos_type br, bool allow_exclusion)
Definition: aligner.cc:374
const BasePairs & bpsA_
base pairs of A
Definition: aligner_impl.hh:48
infty_score_t align_top_level_free_endgaps(const ScoringView *s)
Definition: aligner.cc:738
void trace_in_arcmatch(int state, int al, int i, int bl, int j, bool top_level, const ScoringView *sv)
align top level in the scanning version
Definition: aligner.cc:1235
const Sequence & seqA_
sequence A
Definition: aligner_impl.hh:45
void fill_D_entries_noLP(pos_type al, pos_type bl)
Definition: aligner.cc:613
infty_score_t & D(const ArcMatch &am)
Definition: aligner_impl.hh:507
infty_score_t align_top_level_locally(const ScoringView *sv)
Definition: aligner.cc:825
Parameter for alignment by Aligner.
Definition: aligner_params.hh:49
Restricts range of an alignment in Aligner.
Definition: aligner_restriction.hh:26
Represents a structure-annotated sequence alignment.
Definition: alignment.hh:83
Represents a match of two base pairs (arc match)
Definition: arc_matches.hh:35
const Arc & arcB() const
Definition: arc_matches.hh:72
const Arc & arcA() const
Definition: arc_matches.hh:62
Maintains the relevant arc matches and their scores.
Definition: arc_matches.hh:116
Represents a base pair.
Definition: basepairs.hh:39
size_t right() const
Definition: basepairs.hh:77
size_t idx() const
Definition: basepairs.hh:87
size_t left() const
Definition: basepairs.hh:67
Describes sequence and structure ensemble of an RNA.
Definition: basepairs.hh:108
Definition: infty_int.hh:437
Definition: infty_int.hh:325
Provides methods for the scoring of alignments.
Definition: scoring.hh:271
"Sequence View" of multiple alignment as array of column vectors
Definition: sequence.hh:17
Definition: aligner.cc:15
size_type pos_type
type of a sequence position
Definition: aux.hh:126
long int score_t
type of the locarna score as defined by the class Scoring
Definition: scoring_fwd.hh:13