LocARNA-1.8.11
ribofit.hh
1 #ifndef LOCARNA_RIBOFIT_HH
2 #define LOCARNA_RIBOFIT_HH
3 
4 #ifdef HAVE_CONFIG_H
5 # include <config.h>
6 #endif
7 
8 #include <cstdlib>
9 #include <string>
10 #include <fstream>
11 #include <math.h>
12 
13 #include "sequence.hh"
14 #include "alphabet.hh"
15 #include "matrix.hh"
16 
17 namespace LocARNA {
18 
25  class Ribofit {
26  public:
28 
29  protected:
32 
33  public:
34 
38  explicit
39  Ribofit(const char *alphabet)
40  : alphabet_(alphabet,4) {
41  }
42 
44  virtual
45  ~Ribofit() {};
46 
47  public:
48 
58  virtual
59  double
60  basematch_score(char i,char j,double identity) const = 0;
61 
73  virtual
74  double
75  arcmatch_score(char i,char j,char k,char l,double identity) const = 0;
76 
77  const Alphabet<char> &
78  alphabet() const {return alphabet_;}
79 
86  const matrix_t &get_basematch_scores(double identity, matrix_t &basematch_scores) const;
87 
88  };
89 
90  class Ribofit_will2014 : public Ribofit {
91 
92 # include "ribofit_will2014.ihh"
93 
94  public:
99  : Ribofit(will2014_nucleotides) {
100  }
101 
106 
107  protected:
108 
118  double
119  basematch_score(char i,char j,double identity) const {
120  return will2014_bmscore(alphabet_.idx(i),alphabet_.idx(j),identity);
121  }
122 
134  double
135  arcmatch_score(char i,char j,char k,char l,double identity) const {
136  return will2014_amscore(alphabet_.idx(i),alphabet_.idx(j),
137  alphabet_.idx(k),alphabet_.idx(l),
138  identity);
139  }
140  };
141 
142 } // end namespace LocARNA
143 
144 #endif //LOCARNA_RIBOFIT_HH
virtual double arcmatch_score(char i, char j, char k, char l, double identity) const =0
ribofit arc match score for specific identity
Family of Ribofit matrices.
Definition: ribofit.hh:25
Definition: ribofit.hh:90
const matrix_t & get_basematch_scores(double identity, matrix_t &basematch_scores) const
Get base match scores.
Definition: ribofit.cc:12
double arcmatch_score(char i, char j, char k, char l, double identity) const
ribofit arc match score for specific identity
Definition: ribofit.hh:135
~Ribofit_will2014()
destructor
Definition: ribofit.hh:105
Definition: aligner.cc:17
double basematch_score(char i, char j, double identity) const
ribofit base match score for specific identity
Definition: ribofit.hh:119
Alphabet< char > alphabet_
alphabet of base names as characters
Definition: ribofit.hh:31
Matrix< double > matrix_t
type of a matrix
Definition: ribofit.hh:27
Ribofit(const char *alphabet)
Construct.
Definition: ribofit.hh:39
virtual ~Ribofit()
virtual destructor
Definition: ribofit.hh:45
Ribofit_will2014()
Construct.
Definition: ribofit.hh:98
size_type idx(const elem_type &elem) const
convert element to index
virtual double basematch_score(char i, char j, double identity) const =0
ribofit base match score for specific identity