LocARNA-1.8.11
stral_score.hh
1 #ifndef LOCARNA_STRAL_SCORE_HH
2 #define LOCARNA_STRAL_SCORE_HH
3 
4 #ifdef HAVE_CONFIG_H
5 # include <config.h>
6 #endif
7 
8 
9 #include <math.h>
10 
11 
12 #include "aux.hh"
13 #include "sequence.hh"
14 
15 namespace LocARNA {
16 
17  template <class T> class Matrix;
18  template <class T> class Alphabet;
19  class RnaData;
20 
22  class StralScore {
23 
24  typedef std::vector<double> p_vec_t;
25 
26  Sequence seqA;
27  Sequence seqB;
28 
29  p_vec_t p_upA;
30  p_vec_t p_downA;
31  p_vec_t p_unA;
32 
33  p_vec_t p_upB;
34  p_vec_t p_downB;
35  p_vec_t p_unB;
36 
37  const Matrix<double> &sim_mat;
38  const Alphabet<char> &alphabet;
39  double pf_struct_weight;
40  double gap_opening;
41  double gap_extension;
42 
43  private:
44  void init_prob_vecs(const RnaData &rna,
45  p_vec_t &p_up,
46  p_vec_t &p_down,
47  p_vec_t &p_un);
48  public:
49 
61  StralScore(const RnaData &rnaA,
62  const RnaData &rnaB,
63  const Matrix<double> &sim_mat_,
64  const Alphabet<char> &alphabet_,
65  double pf_struct_weight_,
66  double gap_opening_,
67  double gap_extension_
68  );
69 
86  double sigma(size_type i, size_type j) const;
87 
93  double alpha() const {
94  return gap_opening;
95  }
96 
102  double beta() const {
103  return gap_extension;
104  }
105 
109  void
110  reverse();
111 
112  };
113 
114 }
115 
116 #endif //LOCARNA_STRAL_SCORE_HH
represent sparsified data of RNA ensemble
Definition: rna_data.hh:42
StralScore(const RnaData &rnaA, const RnaData &rnaB, const Matrix< double > &sim_mat_, const Alphabet< char > &alphabet_, double pf_struct_weight_, double gap_opening_, double gap_extension_)
Definition: stral_score.cc:10
double sigma(size_type i, size_type j) const
Compute STRAL-like similarity of two residues in the two RNAs.
Definition: stral_score.cc:31
size_t size_type
general size type
Definition: aux.hh:94
double beta() const
Read gap extension cost.
Definition: stral_score.hh:102
Definition: aligner.cc:17
double alpha() const
Read gap opening cost.
Definition: stral_score.hh:93
Implements the stral-like scoring function.
Definition: stral_score.hh:22
void reverse()
Reverse the scoring.
Definition: stral_score.cc:77
"Sequence View" of multiple alignment as array of column vectors
Definition: sequence.hh:29