1 #ifndef LOCARNA_ALIGNER_P_HH 2 #define LOCARNA_ALIGNER_P_HH 13 #include "sparse_matrix.hh" 15 #include "aligner_restriction.hh" 79 AlignerPRestriction
r;
200 void init_M(size_type al, size_type ar, size_type bl, size_type br);
203 void init_E(size_type al, size_type ar, size_type bl, size_type br);
215 void init_Mrev(size_type al, size_type ar, size_type bl, size_type br);
227 void init_Erev(size_type al, size_type ar, size_type bl, size_type br);
295 align_outside_arcmatch(size_type al,size_type ar,size_type max_ar,size_type bl,size_type br,size_type max_br);
315 void align_reverse(size_type al, size_type ar, size_type bl, size_type br,
bool copy=
false);
336 fill_D(size_type al, size_type bl,
337 size_type max_ar, size_type max_br);
346 size_type min_ar, size_type min_br,
347 size_type max_ar, size_type max_br
356 D(
const Arc &arcA,
const Arc &arcB);
364 Dprime(
const Arc &arcA,
const Arc &arcB);
386 std::pair<size_type,size_type>
408 std::pair<size_type,size_type>
505 virtual_Mprime(size_type al, size_type bl, size_type i, size_type j, size_type max_ar, size_type max_br)
const;
Computes partition function of alignment, arc match and base match probabilities. ...
Definition: aligner_p.hh:52
void freeD()
free the space of D, take care!
Definition: aligner_p.hh:528
pf_score_t F
Definition: aligner_p.hh:118
SparseProbMatrix am_prob
probabilities of arc matchs, as computed by the algo
Definition: aligner_p.hh:185
void init_Mrev(size_type al, size_type ar, size_type bl, size_type br)
Definition: aligner_p.cc:437
size_type leftmost_covering_arc(size_type s, const BasePairs &bps, size_type l, size_type r) const
Definition: aligner_p.cc:616
pf_score_t comp_Eprime_entry(size_type al, size_type bl, size_type i, size_type j)
compute one entry in Eprime (outside recursion cases)
Definition: aligner_p.cc:706
size_type rightmost_covering_arc(const BasePairs &bps, size_type l, size_type r, size_type s) const
Definition: aligner_p.cc:640
void freeMprime()
free the space of D, take care!
Definition: aligner_p.hh:531
std::vector< pf_score_t > PFScoreVector
Vector of partition functions.
Definition: scoring.hh:41
void align_outside_arcmatch(size_type al, size_type ar, size_type max_ar, size_type bl, size_type br, size_type max_br)
Definition: aligner_p.cc:818
pf_score_t comp_Fprime_entry(size_type al, size_type bl, size_type i, size_type j)
compute one entry in Fprime (outside recursion cases)
Definition: aligner_p.cc:718
AlignerP(const AlignerParams &ap)
Construct from parameters.
Definition: aligner_p.cc:64
void compute_basematch_probabilities(bool basematch_probs_include_arcmatch)
computes the probabilitites of all base matches and stores them internally (in a 2D-matrix), no probability filtering
Definition: aligner_p.cc:1085
Matrix< double > ProbMatrix
matrix for storing probabilities
Definition: aligner_p.hh:24
~AlignerP()
Destructor.
Definition: aligner_p.cc:122
Maintains the relevant arc matches and their scores.
Definition: arc_matches.hh:112
pf_score_t comp_Mprime_entry(size_type al, size_type bl, size_type i, size_type j, size_type max_ar, size_type max_br)
compute one entry in Mprime (outside recursion cases)
Definition: aligner_p.cc:742
Definition: aligner.cc:17
void compute_arcmatch_probabilities()
computes the probabilitites of all arc matches and stores them internally (in a sparse matrix)...
Definition: aligner_p.cc:1043
PFScoreVector Erev
Definition: aligner_p.hh:138
size_t size_type
size
Definition: aligner_p.hh:54
BasePairs__Arc Arc
arc
Definition: aligner_p.hh:57
void align_outside()
Definition: aligner_p.cc:1008
void init_E(size_type al, size_type ar, size_type bl, size_type br)
initialize E
Definition: aligner_p.cc:197
void fill_Dprime(size_type al, size_type bl, size_type min_ar, size_type min_br, size_type max_ar, size_type max_br)
Definition: aligner_p.cc:917
const BasePairs & bpsA
base pairs A
Definition: aligner_p.hh:64
const ArcMatches & arc_matches
(potential) arc matches of A and B
Definition: aligner_p.hh:68
PFScoreMatrix Dmatprime
Definition: aligner_p.hh:162
const Sequence & seqB
sequence B
Definition: aligner_p.hh:65
double pf_score_t
type of partition functions
Definition: scoring_fwd.hh:26
pf_score_t comp_M_entry(size_type al, size_type bl, size_type i, size_type j)
compute one entry in M (inside recursion cases)
Definition: aligner_p.cc:238
PFScoreMatrix Dmat
Definition: aligner_p.hh:96
SparsePFScoreMatrix bm_prob
Definition: aligner_p.hh:193
static AlignerPParams create()
create with named parameters
Definition: aligner_p.hh:444
bool D_created
flag, is D already created?
Definition: aligner_p.hh:195
AlignerRestriction AlignerPRestriction
restriction of AlignerP ( same as for Aligner )
Definition: aligner_p.hh:36
pf_score_t comp_Erev_entry(size_type i, size_type j)
compute one entry in Erev
Definition: aligner_p.cc:493
double compute_fragment_match_prob(size_type i, size_type j, size_type k, size_type l)
Fragment match probability.
Definition: aligner_p.cc:1303
void clear()
Definition: matrix.hh:178
const Scoring * scoring
the scores
Definition: aligner_p.hh:61
pf_score_t virtual_Mprime(size_type al, size_type bl, size_type i, size_type j, size_type max_ar, size_type max_br) const
Access virtual Mprime matrix.
Definition: aligner_p.cc:727
pf_score_t comp_E_entry(size_type al, size_type bl, size_type i, size_type j)
initialize first column and row of M' for outside recursion
Definition: aligner_p.cc:214
Parameter for alignment by Aligner.
Definition: params.hh:101
PFScoreMatrix M
Definition: aligner_p.hh:125
pf_score_t Frev
Definition: aligner_p.hh:144
void align_inside_arcmatch(size_type al, size_type ar, size_type bl, size_type br)
Definition: aligner_p.cc:283
PFScoreVector Eprime
Definition: aligner_p.hh:169
void fill_D(size_type al, size_type bl, size_type max_ar, size_type max_br)
Definition: aligner_p.cc:317
void align_D()
Definition: aligner_p.cc:347
void write_basematch_probabilities(std::ostream &out)
write the base match probabilities to a stream
Definition: aligner_p.cc:1265
void align_Dprime()
Definition: aligner_p.cc:949
void init_Erev(size_type al, size_type ar, size_type bl, size_type br)
Definition: aligner_p.cc:485
pf_score_t & D(const ArcMatch &am)
returns lvalue of matrix D
Definition: aligner_p.cc:137
parameters for AlignerP
Definition: params.hh:290
pf_score_t comp_Mrev_entry(size_type i, size_type j, size_type ar, size_type br)
Definition: aligner_p.cc:513
std::pair< size_type, size_type > leftmost_covering_arcmatch(size_type al, size_type bl, size_type ar, size_type br) const
Definition: aligner_p.cc:629
pf_score_t & Dprime(const ArcMatch &am)
returns lvalue of matrix D'
Definition: aligner_p.cc:602
SparseMatrix< double > SparseProbMatrix
sparse matrix for storing probabilities
Definition: aligner_p.hh:30
SparseMatrix< pf_score_t > SparsePFScoreMatrix
sparse matrix for storing partition functions
Definition: aligner_p.hh:33
AlignerPRestriction r
restriction of alignment
Definition: aligner_p.hh:79
bool Dprime_created
flag, is Dprime already created?
Definition: aligner_p.hh:196
void init_M(size_type al, size_type ar, size_type bl, size_type br)
initialize first column and row of M, for inside recursion
Definition: aligner_p.cc:158
pf_score_t Fprime
Definition: aligner_p.hh:176
PFScoreVector E
Definition: aligner_p.hh:108
PFScoreMatrix Mprime
Definition: aligner_p.hh:182
Represents a base pair.
Definition: basepairs.hh:40
pf_score_t align_inside()
Definition: aligner_p.cc:402
pf_score_t comp_F_entry(size_type al, size_type bl, size_type i, size_type j)
compute one entry in F (inside recursion cases)
Definition: aligner_p.cc:224
void write_arcmatch_probabilities(std::ostream &out)
write the arc match probabilities to a stream
Definition: aligner_p.cc:1281
Provides methods for the scoring of alignments.
Definition: scoring.hh:285
const Sequence & seqA
sequence A
Definition: aligner_p.hh:63
Describes sequence and structure ensemble of an RNA.
Definition: basepairs.hh:107
pf_score_t pf_scale
Definition: aligner_p.hh:87
pf_score_t comp_Frev_entry(size_type i, size_type j)
compute one entry in Frev
Definition: aligner_p.cc:502
PFScoreMatrix Erev_mat
Definition: aligner_p.hh:149
PFScoreMatrix Mrev
Definition: aligner_p.hh:132
const AlignerPParams * params
the parameter for the alignment
Definition: aligner_p.hh:59
void alloc_inside_matrices()
allocate space for the inside matrices
Definition: aligner_p.cc:23
void alloc_outside_matrices()
allocate space for the outside matrices
Definition: aligner_p.cc:41
"Sequence View" of multiple alignment as array of column vectors
Definition: sequence.hh:29
std::pair< size_type, size_type > size_pair
pair of size_type
Definition: aligner_p.hh:55
void align_reverse(size_type al, size_type ar, size_type bl, size_type br, bool copy=false)
Definition: aligner_p.cc:548
std::pair< size_type, size_type > rightmost_covering_arcmatch(size_type al, size_type bl, size_type ar, size_type br) const
Definition: aligner_p.cc:654
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
const BasePairs & bpsB
base pairs B
Definition: aligner_p.hh:66
pf_score_t partFunc
the total partition function (only defined after call of align_inside())
Definition: aligner_p.hh:90
PFScoreMatrix Frev_mat
Definition: aligner_p.hh:155