LocARNA-1.8.11
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:
21  //RnaEnsemble *self_; //!<- pointer to corresponding RnaEnsemble object
22 
24 
27 
30 
33 
34  // std::vector<FLT_OR_DBL> qm1; // store qm1 for debugging
35  std::vector<FLT_OR_DBL> qm2_;
36  std::vector<FLT_OR_DBL> expMLbase_;
37 
39 
42 
45 
55  RnaEnsembleImpl(const MultipleAlignment &sequence,
56  const PFoldParams &pfparams,
57  bool inLoopProbs,
58  bool use_alifold);
59 
66 
68 
80 
90  void
91  compute_ensemble_probs(const PFoldParams &params,bool inLoopProbs, bool use_alifold);
92 
93 
100  double
102 
109  double
110  arc_2_prob_ali(size_type i, size_type j) const;
111 
127  double
129  size_type i,
130  size_type j) const;
131 
147  double
149 
166  double
168  size_type jp,
169  size_type i,
170  size_type j) const;
171 
188  double
190  size_type jp,
191  size_type i,
192  size_type j) const;
193 
202  void
203  compute_Qm2();
204 
213  void
214  compute_Qm2_ali();
215 
226  void
228  bool inLoopProbs);
229 
238  void
240  bool inLoopProbs);
241 
242  };
243 
244 } // end namespace LocARNA
245 
246 #endif // LOCARNA_RNA_ENSEMBLE_IMPL_HH
247 
int ptype_of_admissible_basepair(size_type i, size_type j) const
Pair type of an admissible basepair.
Definition: rna_ensemble.cc:479
double min_free_energy_
minimum free energy (if computed anyway)
Definition: rna_ensemble_impl.hh:43
void compute_McCaskill_alifold_matrices(const PFoldParams &params, bool inLoopProbs)
Computes the McCaskill matrices and keeps them accessible (alifold)
Definition: rna_ensemble.cc:242
bool in_loop_probs_available_
whether "in loop" probabilities are availabe
Definition: rna_ensemble_impl.hh:32
void compute_McCaskill_matrices(const PFoldParams &params, bool inLoopProbs)
Computes the McCaskill matrices and keeps them accessible.
Definition: rna_ensemble.cc:151
MultipleAlignment sequence_
the sequence
Definition: rna_ensemble_impl.hh:23
std::vector< FLT_OR_DBL > expMLbase_
table for precomputed multi loop terms
Definition: rna_ensemble_impl.hh:36
size_t size_type
general size type
Definition: aux.hh:94
Definition: aligner.cc:17
Definition: mcc_matrices.hh:18
RnaEnsembleImpl(const MultipleAlignment &sequence, const PFoldParams &pfparams, bool inLoopProbs, bool use_alifold)
Construct from sequence or multiple alignment.
Definition: rna_ensemble.cc:100
Parameters for partition folding.
Definition: pfold_params.hh:19
~RnaEnsembleImpl()
Destructor.
Definition: rna_ensemble.cc:119
std::vector< FLT_OR_DBL > qm2_
matrix qm2_ (stored VRNA-style in a vector)
Definition: rna_ensemble_impl.hh:35
Implementation of RnaEnsemble.
Definition: rna_ensemble_impl.hh:19
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:1000
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:866
void compute_Qm2_ali()
Computes the Qm2 matrix (alifold)
Definition: rna_ensemble.cc:413
double arc_2_prob_ali(size_type i, size_type j) const
Get joint probability of stacked arcs (alifold version)
Definition: rna_ensemble.cc:522
std::string min_free_energy_structure_
minimum free energy structure (if computed)
Definition: rna_ensemble_impl.hh:44
void compute_Qm2()
Computes the Qm2 matrix.
Definition: rna_ensemble.cc:351
McC_matrices_base * McCmat_
DP matrix data structures of VRNA&#39;s McCaskill algorithm.
Definition: rna_ensemble_impl.hh:38
bool pair_probs_available_
whether pair probabilities are availabe
Definition: rna_ensemble_impl.hh:26
bool used_alifold_
whether alifold was used to compute the McCaskill matrices
Definition: rna_ensemble_impl.hh:41
Represents a multiple alignment.
Definition: multiple_alignment.hh:65
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:583
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:758
void compute_ensemble_probs(const PFoldParams &params, bool inLoopProbs, bool use_alifold)
(re)compute the pair probabilities
Definition: rna_ensemble.cc:126
double arc_2_prob_noali(size_type i, size_type j) const
Get joint probability of stacked arcs.
Definition: rna_ensemble.cc:498
bool stacking_probs_available_
whether stacking probabilities are available
Definition: rna_ensemble_impl.hh:29