LocARNA-1.9.2
src/LocARNA/rna_ensemble_impl.hh
00001 #ifndef LOCARNA_RNA_ENSEMBLE_IMPL_HH
00002 #define LOCARNA_RNA_ENSEMBLE_IMPL_HH
00003 
00004 #ifdef HAVE_CONFIG_H
00005 #include <config.h>
00006 #endif
00007 
00008 #include "rna_ensemble.hh"
00009 #include "multiple_alignment.hh"
00010 #include "sparse_matrix.hh"
00011 
00012 #include "mcc_matrices.hh"
00013 
00014 namespace LocARNA {
00015 
00019     class RnaEnsembleImpl {
00020     public:
00021         // RnaEnsemble *self_; //!<- pointer to corresponding RnaEnsemble object
00022 
00023         MultipleAlignment sequence_; 
00024 
00026         bool pair_probs_available_;
00027 
00029         bool stacking_probs_available_;
00030 
00032         bool in_loop_probs_available_;
00033 
00034         // std::vector<FLT_OR_DBL> qm1; // store qm1 for debugging
00035         std::vector<FLT_OR_DBL>
00036             qm2_; 
00037         std::vector<FLT_OR_DBL>
00038             expMLbase_; 
00039 
00040         McC_matrices_base *McCmat_; 
00041 
00042 
00044         bool used_alifold_;
00045 
00046         double min_free_energy_; 
00047         std::string min_free_energy_structure_; 
00048 
00049 
00059         RnaEnsembleImpl(const MultipleAlignment &sequence,
00060                         const PFoldParams &pfparams,
00061                         bool inLoopProbs,
00062                         bool use_alifold);
00063 
00069         ~RnaEnsembleImpl();
00070 
00072 
00083         int
00084         ptype_of_admissible_basepair(size_type i, size_type j) const;
00085 
00096         void
00097         compute_ensemble_probs(const PFoldParams &params,
00098                                bool inLoopProbs,
00099                                bool use_alifold);
00100 
00108         double
00109         arc_2_prob_noali(size_type i, size_type j) const;
00110 
00118         double
00119         arc_2_prob_ali(size_type i, size_type j) const;
00120 
00136         double
00137         unpaired_in_loop_prob_ali(size_type k, size_type i, size_type j) const;
00138 
00154         double
00155         unpaired_in_loop_prob_noali(size_type k,
00156                                     size_type i,
00157                                     size_type j) const;
00158 
00176         double
00177         arc_in_loop_prob_ali(size_type ip,
00178                              size_type jp,
00179                              size_type i,
00180                              size_type j) const;
00181 
00199         double
00200         arc_in_loop_prob_noali(size_type ip,
00201                                size_type jp,
00202                                size_type i,
00203                                size_type j) const;
00204 
00213         void
00214         compute_Qm2();
00215 
00224         void
00225         compute_Qm2_ali();
00226 
00238         void
00239         compute_McCaskill_matrices(const PFoldParams &params, bool inLoopProbs);
00240 
00251         void
00252         compute_McCaskill_alifold_matrices(const PFoldParams &params,
00253                                            bool inLoopProbs);
00254     };
00255 
00256 } // end namespace LocARNA
00257 
00258 #endif // LOCARNA_RNA_ENSEMBLE_IMPL_HH
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends