1 #ifndef LOCARNA_ALIGNER_N_HH
2 #define LOCARNA_ALIGNER_N_HH
9 #include "basepairs.hh"
10 #include "sparsification_mapper.hh"
11 #include "arc_matches.hh"
12 #include "alignment.hh"
14 #include "aligner_params.hh"
19 #include "aligner_restriction.hh"
52 const std::unique_ptr<AlignerNParams>
params;
180 D(
bool isA,
const Arc &arcX,
const Arc &arcY) {
182 return D(arcX, arcY);
184 return D(arcY, arcX);
307 template <
class ScoringView>
323 template <
bool isA,
class ScoringView>
350 template <
bool isA,
class ScoringView>
390 template <
class ScoringView>
411 template <
class ScoringView>
432 template <
class ScoringView>
468 template <
class ScoringView>
487 template <
class ScoringView>
506 template <
class ScoringView>
525 template <
class ScoringView>
542 template <
bool isA,
class ScoringView>
552 template <
class ScoringView>
572 template <
bool isA,
class ScoringView>
696 template <
class ScoringView>
698 trace(ScoringView sv);
parameters for AlignerN
Definition: aligner_params.hh:161
Provides a modified view on the scoring.
Definition: aligner_n.hh:208
void set_lambda(score_t lambda)
Definition: aligner_n.hh:245
score_t lambda_
factor for modifying scoring
Definition: aligner_n.hh:213
infty_score_t D(const Arc &a, const Arc &b) const
Definition: aligner_n.hh:268
size_t arc_length(const Arc &a) const
Definition: aligner_n.hh:223
ModifiedScoringViewN(const AlignerN *alignerN)
Definition: aligner_n.hh:236
const AlignerN * alignerN_
aligner object for that the view is provided
Definition: aligner_n.hh:211
const Scoring * scoring() const
Definition: aligner_n.hh:255
infty_score_t D(const ArcMatch &am) const
Definition: aligner_n.hh:281
Provides the standard view on the scoring.
Definition: aligner_n.hh:135
const Scoring * scoring() const
Definition: aligner_n.hh:154
infty_score_t D(const Arc &a, const Arc &b) const
Definition: aligner_n.hh:167
infty_score_t D(const ArcMatch &am) const
Definition: aligner_n.hh:195
const AlignerN * alignerN_
aligner object for that the view is provided
Definition: aligner_n.hh:138
UnmodifiedScoringViewN(const AlignerN *alignerN)
Definition: aligner_n.hh:145
infty_score_t D(bool isA, const Arc &arcX, const Arc &arcY)
Definition: aligner_n.hh:180
Implements SPARSE, next generation alignment algorithm for locarna.
Definition: aligner_n.hh:36
const ArcMatches & arc_matches
the potential arc matches between A and B
Definition: aligner_n.hh:66
const SparsificationMapper & mapperA
sparsification mapping for seq A
Definition: aligner_n.hh:61
infty_score_t compute_E_entry(index_t al, matidx_t i_index, matidx_t j_index, seq_pos_t i_seq_pos, seq_pos_t i_prev_seq_pos, ScoringView sv)
compute E matrix value of single matrix element
Definition: aligner_n.cc:220
infty_score_t & D(const Arc &arcA, const Arc &arcB)
Definition: aligner_n.hh:629
ScoreMatrix IBDmat
Definition: aligner_n.hh:89
Alignment alignment
resulting alignment
Definition: aligner_n.hh:123
infty_score_t & IXD(const Arc &arc1, const Arc &arc2)
Definition: aligner_n.hh:660
infty_score_t compute_IX(pos_type xl, const Arc &arcY, pos_type i, ScoringView sv)
compute IA/IB value of single element
Definition: aligner_n.cc:154
void trace_M(pos_type al, matidx_t i_index, pos_type bl, matidx_t j_index, bool tl, ScoringView sv)
trace back within an arc match
Definition: aligner_n.cc:1668
infty_score_t compute_M_entry(index_t al, index_t bl, matidx_t index_i, matidx_t index_j, ScoringView sv)
compute M value of single matrix element
Definition: aligner_n.cc:275
infty_score_t getGapCostBetween(pos_type leftSide, pos_type rightSide)
return score of aligning a subsequence to gaps
Definition: aligner_n.cc:139
const Sequence & seqA
sequence A
Definition: aligner_n.hh:57
void align_D()
Definition: aligner_n.cc:773
infty_score_t & IB(const Arc &a, const pos_type k)
Definition: aligner_n.hh:687
void fill_D_entries(pos_type al, pos_type bl)
Definition: aligner_n.cc:643
void fill_IA_entries(pos_type al, Arc arcB, pos_type max_ar)
fills all IA values using default scoring scheme
Definition: aligner_n.cc:521
const SparsificationMapper & mapperB
sparsification mapping for seq B
Definition: aligner_n.hh:63
const Scoring * scoring
the scores
Definition: aligner_n.hh:54
int max_i
subsequence of A right end, not used in sparse
Definition: aligner_n.hh:118
void trace_D(const Arc &arcA, const Arc &arcB, ScoringView sv)
Definition: aligner_n.cc:1140
~AlignerN()
destructor
Definition: aligner_n.cc:100
ScoreMatrix IADmat
Definition: aligner_n.hh:86
ScoreMatrix Emat
matrix for the affine gap cost model base deletion
Definition: aligner_n.hh:92
ScoreMatrix Fmat
matrix for the affine gap cost model base insertion
Definition: aligner_n.hh:94
void trace()
offer trace as public method. Calls trace(def_scoring_view).
Definition: aligner_n.cc:1757
void initGapCostMat(ScoringView sv)
compute and stores score of aligning subsequences to gaps
Definition: aligner_n.cc:109
int max_j
subsequence of B right end, not used in sparse
Definition: aligner_n.hh:119
SparsificationMapper::ArcIdx ArcIdx
type for arc index
Definition: aligner_n.hh:39
void trace_F(pos_type al, matidx_t i_index, pos_type bl, matidx_t j_index, bool top_level, ScoringView sv)
trace back base insertion within a match of arcs
Definition: aligner_n.cc:1316
infty_score_t & D(const Arc &arcX, const Arc &arcY)
Definition: aligner_n.hh:613
const BasePairs & bpsA
base pairs of A
Definition: aligner_n.hh:68
ScoreMatrix Dmat
matrix indexed by the arc indices of rnas A and B
Definition: aligner_n.hh:75
const Sequence & seqB
sequence B
Definition: aligner_n.hh:58
ScoreMatrix M_matrix_t
type of matrix M
Definition: aligner_n.hh:49
infty_score_t & IX(const pos_type i, const Arc &arc)
Definition: aligner_n.hh:643
void trace_E(pos_type al, matidx_t i_index, pos_type bl, matidx_t j_index, bool top_level, ScoringView sv)
trace back base deletion within a match of arcs
Definition: aligner_n.cc:1267
SparsificationMapper::ArcIdxVec ArcIdxVec
vector of arc indices
Definition: aligner_n.hh:41
const BasePairs & bpsB
base pairs of B
Definition: aligner_n.hh:69
ScoreMatrix IAmat
Definition: aligner_n.hh:79
ModifiedScoringViewN mod_scoring_view
Definition: aligner_n.hh:288
void fill_IB_entries(Arc arcA, pos_type bl, pos_type max_br)
fills all IB values using default scoring scheme
Definition: aligner_n.cc:552
ScoreMatrix gapCostMatA
Definition: aligner_n.hh:108
void fill_M_entries(pos_type al, pos_type ar, pos_type bl, pos_type br)
Definition: aligner_n.cc:594
BasePairs__Arc Arc
type for an arc a.k.a base pair
Definition: aligner_n.hh:38
int min_j
subsequence of B left end, not used in sparse
Definition: aligner_n.hh:117
Alignment const & get_alignment() const
return the alignment that was computed by trace()
Definition: aligner_n.hh:717
ScoreMatrix IBmat
Definition: aligner_n.hh:82
const std::unique_ptr< AlignerNParams > params
the parameter for the alignment
Definition: aligner_n.hh:52
AlignerN(const AlignerN &a)
copy constructor
Definition: aligner_n.cc:25
SparsificationMapper::index_t index_t
type for an index
Definition: aligner_n.hh:46
void init_M_E_F(pos_type al, pos_type ar, pos_type bl, pos_type br, ScoringView sv)
initialize matrices M
Definition: aligner_n.cc:438
void trace_IXD(const Arc &arcA, const Arc &arcB, ScoringView sv)
Definition: aligner_n.cc:1068
infty_score_t align()
compute the alignment score
Definition: aligner_n.cc:865
void trace_IX(pos_type xl, pos_type i, const Arc &arcY, ScoringView sv)
Definition: aligner_n.cc:937
AlignerRestriction r
restriction of AlignerN
Definition: aligner_n.hh:72
const UnmodifiedScoringViewN def_scoring_view
Default scoring view.
Definition: aligner_n.hh:287
infty_score_t compute_F_entry(index_t bl, matidx_t i_index, matidx_t j_index, seq_pos_t i_seq_pos, seq_pos_t i_prev_seq_pos, ScoringView sv)
compute F matrix value of single matrix element
Definition: aligner_n.cc:248
infty_score_t & IA(const pos_type i, const Arc &b)
Definition: aligner_n.hh:675
bool D_created
flag, is D already created?
Definition: aligner_n.hh:121
infty_score_t & D(const ArcMatch &am)
Definition: aligner_n.hh:599
M_matrix_t M
M matrix.
Definition: aligner_n.hh:102
void trace_M_noex(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_n.cc:1366
SparsificationMapper::matidx_t matidx_t
type for a matrix position
Definition: aligner_n.hh:43
Scoring * mod_scoring
Definition: aligner_n.hh:55
ScoreMatrix gapCostMatB
Definition: aligner_n.hh:114
int min_i
subsequence of A left end, not used in sparse
Definition: aligner_n.hh:116
SparsificationMapper::seq_pos_t seq_pos_t
type for a sequence position
Definition: aligner_n.hh:45
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: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
Represents the mapping for sparsification.
Definition: sparsification_mapper.hh:30
std::vector< ArcIdx > ArcIdxVec
vector of arc indices
Definition: sparsification_mapper.hh:34
size_t ArcIdx
type of arc index
Definition: sparsification_mapper.hh:33
pos_type seq_pos_t
type for a sequence position
Definition: sparsification_mapper.hh:36
pos_type matidx_t
type for a matrix position
Definition: sparsification_mapper.hh:35
size_t index_t
type for an index
Definition: sparsification_mapper.hh:38
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