1 #ifndef LOCARNA_ALIGNER_P_HH
2 #define LOCARNA_ALIGNER_P_HH
10 #include "quadmath.hh"
13 #include "aligner_params.hh"
17 #include "sparse_matrix.hh"
19 #include "aligner_restriction.hh"
56 using pf_score_t =
typename PFScoring<T>::pf_score_t;
64 typedef std::pair<size_type, size_type>
69 const std::unique_ptr<AlignerPParams<T>>
params;
451 std::pair<size_type, size_type>
480 std::pair<size_type, size_type>
627 #include "aligner_p.icc"
parameters for AlignerP
Definition: aligner_params.hh:122
Computes partition function of alignment, arc match and base match probabilities.
Definition: aligner_p.hh:54
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)
const Sequence & seqA
sequence A
Definition: aligner_p.hh:73
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)
void init_Erev(size_type al, size_type ar, size_type bl, size_type br)
std::pair< size_type, size_type > rightmost_covering_arcmatch(size_type al, size_type bl, size_type ar, size_type br) const
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
void compute_arcmatch_probabilities()
SparseProbMatrix am_prob
probabilities of arc matchs, as computed by the algo
Definition: aligner_p.hh:205
void alloc_outside_matrices()
allocate space for the outside matrices
void write_arcmatch_probabilities(std::ostream &out)
write the arc match probabilities to a stream
SparsePFScoreMatrix bm_prob
Definition: aligner_p.hh:215
pf_score_t Frev
Definition: aligner_p.hh:160
AlignerP(const AlignerPParams< T > &ap)
Construct from parameters.
bool Dprime_created
flag, is Dprime already created?
Definition: aligner_p.hh:218
PFScoreVector Erev
Definition: aligner_p.hh:154
pf_score_t & Dprime(const Arc &arcA, const Arc &arcB)
returns lvalue of matrix D'
pf_score_t & Dprime(const ArcMatch &am)
returns lvalue of matrix D'
static AlignerPParams< T > create()
create with named parameters
Definition: aligner_p.hh:518
const BasePairs & bpsB
base pairs B
Definition: aligner_p.hh:76
pf_score_t align_inside()
PFScoreVector Eprime
Definition: aligner_p.hh:186
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)
BasePairs__Arc Arc
arc
Definition: aligner_p.hh:67
bool D_created
flag, is D already created?
Definition: aligner_p.hh:217
SparseMatrix< pf_score_t > SparsePFScoreMatrix
sparse matrix for storing partition functions
Definition: aligner_p.hh:61
void fill_D(size_type al, size_type bl, size_type max_ar, size_type max_br)
PFScoreMatrix Erev_mat
Definition: aligner_p.hh:165
size_type leftmost_covering_arc(size_type s, const BasePairs &bps, size_type l, size_type r) const
void align_inside_arcmatch(size_type al, size_type ar, size_type bl, size_type br)
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)
const std::unique_ptr< AlignerPParams< T > > params
the parameter for the alignment
Definition: aligner_p.hh:69
std::pair< size_type, size_type > size_pair
pair of size_type
Definition: aligner_p.hh:65
std::pair< size_type, size_type > leftmost_covering_arcmatch(size_type al, size_type bl, size_type ar, size_type br) const
void freeMprime()
free the space of D, take care!
Definition: aligner_p.hh:619
pf_score_t comp_Frev_entry(size_type i, size_type j)
compute one entry in Frev
void init_Mrev(size_type al, size_type ar, size_type bl, size_type br)
pf_score_t comp_Mrev_entry(size_type i, size_type j, size_type ar, size_type br)
AlignerP(const AlignerP &p)
copy constructor @params p AlignerP object to be copied
AlignerPRestriction r
restriction of alignment
Definition: aligner_p.hh:89
size_type rightmost_covering_arc(const BasePairs &bps, size_type l, size_type r, size_type s) const
void write_basematch_probabilities(std::ostream &out)
write the base match probabilities to a stream
void align_reverse(size_type al, size_type ar, size_type bl, size_type br, bool copy=false)
void freeD()
free the space of D, take care!
Definition: aligner_p.hh:613
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)
pf_score_t pf_scale
Definition: aligner_p.hh:96
double compute_fragment_match_prob(size_type i, size_type j, size_type k, size_type l)
Fragment match probability.
const ArcMatches & arc_matches
(potential) arc matches of A and B
Definition: aligner_p.hh:78
PFScoreMatrix Frev_mat
Definition: aligner_p.hh:171
pf_score_t & D(const Arc &arcA, const Arc &arcB)
returns lvalue of matrix D
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.
PFScoreVector E
Definition: aligner_p.hh:120
PFScoreMatrix M
Definition: aligner_p.hh:141
PFScoreMatrix Mprime
Definition: aligner_p.hh:202
PFScoreMatrix Mrev
Definition: aligner_p.hh:148
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
void compute_basematch_probabilities(bool basematch_probs_include_arcmatch)
pf_score_t Fprime
Definition: aligner_p.hh:195
const Sequence & seqB
sequence B
Definition: aligner_p.hh:75
const PFScoring< T > * scoring
the scores
Definition: aligner_p.hh:71
void init_E(size_type al, size_type ar, size_type bl, size_type br)
initialize E
pf_score_t F
Definition: aligner_p.hh:134
PFScoreMatrix Dmat
Definition: aligner_p.hh:106
pf_score_t & D(const ArcMatch &am)
returns lvalue of matrix D
const BasePairs & bpsA
base pairs A
Definition: aligner_p.hh:74
void align_outside_arcmatch(size_type al, size_type ar, size_type max_ar, size_type bl, size_type br, size_type max_br)
size_t size_type
size
Definition: aligner_p.hh:63
PFScoreMatrix Dmatprime
Definition: aligner_p.hh:178
void alloc_inside_matrices()
allocate space for the inside matrices
pf_score_t comp_Erev_entry(size_type i, size_type j)
compute one entry in Erev
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)
pf_score_t partFunc
Definition: aligner_p.hh:98
Restricts range of an alignment in Aligner.
Definition: aligner_restriction.hh:26
Represents a match of two base pairs (arc match)
Definition: arc_matches.hh:35
Maintains the relevant arc matches and their scores.
Definition: arc_matches.hh:116
Represents a base pair.
Definition: basepairs.hh:39
Describes sequence and structure ensemble of an RNA.
Definition: basepairs.hh:108
Definition: scoring.hh:745
std::vector< pf_score_t > PFScoreVector
Vector of partition functions.
Definition: scoring.hh:750
"Sequence View" of multiple alignment as array of column vectors
Definition: sequence.hh:17
Definition: aligner.cc:15
AlignerRestriction AlignerPRestriction
restriction of AlignerP ( same as for Aligner )
Definition: aligner_p.hh:36
SparseMatrix< double > SparseProbMatrix
sparse matrix for storing probabilities
Definition: aligner_p.hh:33
Matrix< double > ProbMatrix
matrix for storing probabilities
Definition: aligner_p.hh:27