LocARNA-2.0.0
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 #include <math.h>
9 
10 #include "aux.hh"
11 #include "sequence.hh"
12 
13 namespace LocARNA {
14 
15  template <class T>
16  class Matrix;
17 
18  template <class T, size_t N>
19  class Alphabet;
20 
21  class RnaData;
22 
29  class StralScore {
30  typedef std::vector<double> p_vec_t;
31 
32  Sequence seqA_;
33  Sequence seqB_;
34 
35  p_vec_t p_upA_;
36  p_vec_t p_downA_;
37  p_vec_t p_unA_;
38 
39  p_vec_t p_upB_;
40  p_vec_t p_downB_;
41  p_vec_t p_unB_;
42 
43  const Matrix<double> &sim_mat_;
44  const Alphabet<char, 4> &alphabet_;
45  double struct_weight_;
46  double indel_opening_;
47  double indel_;
48 
49  private:
50  void
51  init_prob_vecs(const RnaData &rna,
52  p_vec_t &p_up,
53  p_vec_t &p_down,
54  p_vec_t &p_un);
55 
56  public:
68  StralScore(const RnaData &rnaA,
69  const RnaData &rnaB,
70  const Matrix<double> &sim_mat,
71  const Alphabet<char, 4> &alphabet,
72  double pf_struct_weight,
73  double indel_opening,
74  double indel);
75 
91  double
92  sigma(size_type i, size_type j) const;
93 
99  double
100  indel_opening() const {
101  return indel_opening_;
102  }
103 
109  double
110  indel() const {
111  return indel_;
112  }
113 
117  void
118  reverse();
119  };
120 }
121 
122 #endif // LOCARNA_STRAL_SCORE_HH
represent sparsified data of RNA ensemble
Definition: rna_data.hh:44
"Sequence View" of multiple alignment as array of column vectors
Definition: sequence.hh:17
Implements the stral-like scoring function.
Definition: stral_score.hh:29
double indel() const
Read gap extension cost.
Definition: stral_score.hh:110
StralScore(const RnaData &rnaA, const RnaData &rnaB, const Matrix< double > &sim_mat, const Alphabet< char, 4 > &alphabet, double pf_struct_weight, double indel_opening, double indel)
Definition: stral_score.cc:10
double indel_opening() const
Read gap opening cost.
Definition: stral_score.hh:100
double sigma(size_type i, size_type j) const
Compute STRAL-like similarity of two residues in the two RNAs.
Definition: stral_score.cc:30
void reverse()
Reverse the scoring.
Definition: stral_score.cc:81
Definition: aligner.cc:15
size_t size_type
general size type
Definition: aux.hh:120