LocARNA-2.0.0
rna_ensemble.hh
1 #ifndef LOCARNA_RNA_ENSEMBLE_HH
2 #define LOCARNA_RNA_ENSEMBLE_HH
3 
4 #ifdef HAVE_CONFIG_H
5 #include <config.h>
6 #endif
7 
8 #include <memory>
9 #include <iosfwd>
10 
11 #include "aux.hh"
12 
13 namespace LocARNA {
14 
15  class MultipleAlignment;
16 
17  class RnaEnsembleImpl; // forward to implementation class
18 
19  class PFoldParams;
20 
41  class RnaEnsemble {
42  public:
59  const PFoldParams &params,
60  bool inLoopProbs,
61  bool use_alifold = true);
62 
68  RnaEnsemble(const RnaEnsemble &rna_ensemble);
69 
70  ~RnaEnsemble();
71 
77  RnaEnsemble &
78  operator=(const RnaEnsemble &rna_ensemble);
79 
85  bool
86  has_base_pair_probs() const;
87 
93  bool
94  has_stacking_probs() const;
95 
101  bool
102  has_in_loop_probs() const;
103 
108  const MultipleAlignment &
109  multiple_alignment() const;
110 
115  size_type
116  length() const;
117 
127  double
128  min_free_energy() const;
129 
139  std::string
141 
142  // ------------------------------------------------------------
143  // methods for base pair probabilities
144 
151  double
152  arc_prob(size_type i, size_type j) const;
153 
161  double
162  arc_2_prob(size_type i, size_type j) const;
163 
172  double
174 
175  // ------------------------------------------------------------
176  // compute probabilities paired upstream, downstream, and unpaired
177 
187  double
189 
199  double
201 
208  double
210 
211  // the following methods need linking to librna
212 
238  double
240 
260  double
262 
290  double
292  size_type jp,
293  size_type i,
294  size_type j) const;
295 
317  double
319 
320  private:
322  std::unique_ptr<RnaEnsembleImpl> pimpl_;
323  };
324 }
325 
326 #endif // LOCARNA_RNA_ENSEMBLE_HH
Represents a multiple alignment.
Definition: multiple_alignment.hh:65
Parameters for partition folding.
Definition: pfold_params.hh:32
Represents the raw structure ensemble data for an RNA.
Definition: rna_ensemble.hh:41
bool has_stacking_probs() const
Availability of stacking probabilities.
Definition: rna_ensemble.cc:51
double arc_stack_prob(size_type i, size_type j) const
Get conditional propability that a base pair is stacked.
bool has_base_pair_probs() const
Availability of pair probabilities.
Definition: rna_ensemble.cc:46
bool has_in_loop_probs() const
Availability of "in loop" probabilities.
Definition: rna_ensemble.cc:56
double arc_prob(size_type i, size_type j) const
Get arc probability.
Definition: rna_ensemble.cc:83
double min_free_energy() const
get minimum free energy
Definition: rna_ensemble.cc:66
RnaEnsemble(const MultipleAlignment &ma, const PFoldParams &params, bool inLoopProbs, bool use_alifold=true)
folding constructor (from sequence or multiple alignment)
Definition: rna_ensemble.cc:33
double unpaired_external_prob(size_type k) const
Unpaired probabilty of base in external 'loop'.
Definition: rna_ensemble.cc:786
size_type length() const
get length of sequence
Definition: rna_ensemble.cc:78
const MultipleAlignment & multiple_alignment() const
Get the sequence.
Definition: rna_ensemble.cc:61
double paired_downstream_prob(size_type i) const
Probability that a position is paired downstream.
RnaEnsemble(const RnaEnsemble &rna_ensemble)
copy constructor
double unpaired_prob(size_type i) const
Unpaired probability.
RnaEnsemble & operator=(const RnaEnsemble &rna_ensemble)
assignment operator
double arc_in_loop_prob(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:915
double arc_2_prob(size_type i, size_type j) const
Get joint probability of stacked arcs.
Definition: rna_ensemble.cc:88
double paired_upstream_prob(size_type i) const
Probability that a position is paired upstream.
double unpaired_in_loop_prob(size_type k, size_type i, size_type j) const
Unpaired probabilty of base in a specified loop.
Definition: rna_ensemble.cc:655
std::string min_free_energy_structure() const
get minimum free energy structure
Definition: rna_ensemble.cc:71
double arc_external_prob(size_type i, size_type j) const
Probability of base pair in the external 'loop'.
Definition: rna_ensemble.cc:1014
Definition: aligner.cc:15
size_t size_type
general size type
Definition: aux.hh:120