LocARNA-2.0.0
rna_ensemble_impl.hh
1 #ifndef LOCARNA_RNA_ENSEMBLE_IMPL_HH
2 #define LOCARNA_RNA_ENSEMBLE_IMPL_HH
3 
4 #ifdef HAVE_CONFIG_H
5 #include <config.h>
6 #endif
7 
8 #include "rna_ensemble.hh"
9 #include "multiple_alignment.hh"
10 #include "sparse_matrix.hh"
11 
12 #include "mcc_matrices.hh"
13 
14 namespace LocARNA {
15 
20  public:
24 
27 
30 
33 
34  // std::vector<FLT_OR_DBL> qm1; // store qm1 for debugging
35  std::vector<FLT_OR_DBL>
36  qm2_;
37  std::vector<FLT_OR_DBL>
39 
41  std::unique_ptr<McC_matrices_base> McCmat_;
42 
45 
49 
59  RnaEnsembleImpl(const MultipleAlignment &sequence,
60  const PFoldParams &pfparams,
61  bool inLoopProbs,
62  bool use_alifold);
63 
70 
72 
83  int
85 
96  void
97  compute_ensemble_probs(const PFoldParams &params,
98  bool inLoopProbs,
99  bool use_alifold);
100 
108  double
110 
118  double
119  arc_2_prob_ali(size_type i, size_type j) const;
120 
136  double
138 
154  double
156  size_type i,
157  size_type j) const;
158 
176  double
178  size_type jp,
179  size_type i,
180  size_type j) const;
181 
199  double
201  size_type jp,
202  size_type i,
203  size_type j) const;
204 
213  void
214  compute_Qm2();
215 
224  void
225  compute_Qm2_ali();
226 
238  void
239  compute_McCaskill_matrices(const PFoldParams &params, bool inLoopProbs);
240 
251  void
253  bool inLoopProbs);
254  };
255 
256 } // end namespace LocARNA
257 
258 #endif // LOCARNA_RNA_ENSEMBLE_IMPL_HH
Represents a multiple alignment.
Definition: multiple_alignment.hh:65
Parameters for partition folding.
Definition: pfold_params.hh:32
Implementation of RnaEnsemble.
Definition: rna_ensemble_impl.hh:19
bool in_loop_probs_available_
whether "in loop" probabilities are availabe
Definition: rna_ensemble_impl.hh:32
double arc_2_prob_noali(size_type i, size_type j) const
Get joint probability of stacked arcs.
Definition: rna_ensemble.cc:415
double arc_2_prob_ali(size_type i, size_type j) const
Get joint probability of stacked arcs (alifold version)
Definition: rna_ensemble.cc:438
double unpaired_in_loop_prob_noali(size_type k, size_type i, size_type j) const
Unpaired probabilty of base in a specified loop (no alifold)
Definition: rna_ensemble.cc:673
void compute_McCaskill_matrices(const PFoldParams &params, bool inLoopProbs)
Computes the McCaskill matrices and keeps them accessible.
Definition: rna_ensemble.cc:143
void compute_ensemble_probs(const PFoldParams &params, bool inLoopProbs, bool use_alifold)
(re)compute the pair probabilities
Definition: rna_ensemble.cc:118
double min_free_energy_
minimum free energy (if computed anyway)
Definition: rna_ensemble_impl.hh:46
double unpaired_in_loop_prob_ali(size_type k, size_type i, size_type j) const
Unpaired probabilty of base in a specified loop (alifold)
Definition: rna_ensemble.cc:489
void compute_McCaskill_alifold_matrices(const PFoldParams &params, bool inLoopProbs)
Computes the McCaskill matrices and keeps them accessible (alifold)
Definition: rna_ensemble.cc:204
~RnaEnsembleImpl()
Destructor.
Definition: rna_ensemble.cc:114
bool stacking_probs_available_
whether stacking probabilities are available
Definition: rna_ensemble_impl.hh:29
std::vector< FLT_OR_DBL > qm2_
matrix qm2_ (stored VRNA-style in a vector)
Definition: rna_ensemble_impl.hh:36
double arc_in_loop_prob_noali(size_type ip, size_type jp, size_type i, size_type j) const
Probabilty of base pair in a specified loop.
Definition: rna_ensemble.cc:930
std::unique_ptr< McC_matrices_base > McCmat_
DP matrix data structures of VRNA's McCaskill algorithm.
Definition: rna_ensemble_impl.hh:41
RnaEnsembleImpl(const MultipleAlignment &sequence, const PFoldParams &pfparams, bool inLoopProbs, bool use_alifold)
Construct from sequence or multiple alignment.
Definition: rna_ensemble.cc:96
bool pair_probs_available_
whether pair probabilities are availabe
Definition: rna_ensemble_impl.hh:26
void compute_Qm2()
Computes the Qm2 matrix.
Definition: rna_ensemble.cc:271
MultipleAlignment sequence_
Definition: rna_ensemble_impl.hh:23
void compute_Qm2_ali()
Computes the Qm2 matrix (alifold)
Definition: rna_ensemble.cc:331
bool used_alifold_
whether alifold was used to compute the McCaskill matrices
Definition: rna_ensemble_impl.hh:44
double arc_in_loop_prob_ali(size_type ip, size_type jp, size_type i, size_type j) const
Probabilty of base pair in a specified loop (alifold)
Definition: rna_ensemble.cc:799
int ptype_of_admissible_basepair(size_type i, size_type j) const
Pair type of an admissible basepair.
Definition: rna_ensemble.cc:398
std::vector< FLT_OR_DBL > expMLbase_
table for precomputed multi loop terms
Definition: rna_ensemble_impl.hh:38
std::string min_free_energy_structure_
Definition: rna_ensemble_impl.hh:47
Definition: aligner.cc:15
size_t size_type
general size type
Definition: aux.hh:120