LocARNA-1.8.11
mcc_matrices.hh
1 #ifndef LOCARNA_MCC_MATRICES_HH
2 #define LOCARNA_MCC_MATRICES_HH
3 
4 #ifdef HAVE_CONFIG_H
5 # include <config.h>
6 #endif
7 
8 #include <assert.h>
9 
10 #define PUBLIC // for Vienna
11 
12 extern "C" {
13 #include <ViennaRNA/params.h> // import pf_paramT definition
14 }
15 
16 namespace LocARNA {
17 
19  protected:
26  vrna_fold_compound_t *vc_;
27 
31  McC_matrices_base(vrna_fold_compound_t *vc);
32 
33  public:
34 
40  virtual
42 
45  size_t iidx(size_t i,size_t j) const {
46  assert(1<=i);
47  assert(i<=j);
48  assert(j<=vc_->length);
49 
50  return vc_->iindx[i]-j;
51  }
52 
55  size_t jidx(size_t i,size_t j) const {
56  assert(1<=i);
57  assert(i<=j);
58  assert(j<=vc_->length);
59 
60  return vc_->jindx[j]+i;
61  }
62 
71  FLT_OR_DBL bppm(size_t i, size_t j) const { return vc_->exp_matrices->probs[iidx(i,j)]; }
72 
81  FLT_OR_DBL qb(size_t i, size_t j) const { return vc_->exp_matrices->qb[iidx(i,j)]; }
82 
91  FLT_OR_DBL qm(size_t i, size_t j) const { return vc_->exp_matrices->qm[iidx(i,j)]; }
92 
96  vrna_exp_param_t *exp_params() const { return vc_->exp_params; }
97 
103  FLT_OR_DBL scale(size_t i) const { return vc_->exp_matrices->scale[i]; }
104 
110  FLT_OR_DBL expMLbase(size_t i) const { return vc_->exp_matrices->expMLbase[i]; }
111 
116  FLT_OR_DBL kT() const {return vc_->exp_params->kT; }
117 
118 
126  FLT_OR_DBL q1k(size_t k) const { return vc_->exp_matrices->q1k[k]; }
127 
135  FLT_OR_DBL qln(size_t l) const { return vc_->exp_matrices->qln[l]; }
136 
137 
146  int
147  pair(size_t c, size_t d) const {
148  assert(vc_);
149  assert(vc_->exp_params);
150  return vc_->exp_params->model_details.pair[c][d];
151  }
152 
153 
154  };
155 
161  public:
162 
168  McC_matrices_t(vrna_fold_compound_t *vc);
169 
173  virtual
174  ~McC_matrices_t();
175 
184  char ptype(size_t i, size_t j) const { return vc_->ptype[jidx(i,j)]; }
185 
194  char
195  rev_ptype(size_t i, size_t j) const {
196  return vc_->exp_params->model_details.rtype[(size_t)ptype(i,j)];
197  }
198 
199 
207  short
208  S1(size_t i) const { return vc_->sequence_encoding[i]; }
209 
210  char *sequence() const {return vc_->sequence;}
211 
212  };
213 
217 
218  public:
219 
225  McC_ali_matrices_t(vrna_fold_compound_t *vc);
226 
230  virtual
232 
241  short pscore(size_t i, size_t j) const { return vc_->pscore[jidx(i,j)]; }
242 
251  short
252  S(size_t s,size_t i) const {
253  return vc_->S[s][i];
254  }
255 
264  short
265  S3(size_t s,size_t i) const { return vc_->S3[s][i]; }
266 
275  short
276  S5(size_t s,size_t i) const { return vc_->S5[s][i]; }
277 
286  short
287  a2s(size_t s,size_t i) const { return vc_->a2s[s][i]; }
288 
289  char *Ss(size_t s) const {return vc_->Ss[s];}
290 
291  };
292 
293 } // end namespace LocARNA
294 
295 
296 #endif // LOCARNA_MCC_MATRICES_HH
297 
298 
FLT_OR_DBL bppm(size_t i, size_t j) const
Read access matrix bppm.
Definition: mcc_matrices.hh:71
double FLT_OR_DBL
select FLT_OR_DBL
Definition: aux.hh:302
int pair(size_t c, size_t d) const
Read access matrix pair.
Definition: mcc_matrices.hh:147
FLT_OR_DBL qln(size_t l) const
Read access matrix qln.
Definition: mcc_matrices.hh:135
Alifold-McCaskill matrices.
Definition: mcc_matrices.hh:216
FLT_OR_DBL kT() const
kT
Definition: mcc_matrices.hh:116
FLT_OR_DBL qm(size_t i, size_t j) const
Read access matrix qm.
Definition: mcc_matrices.hh:91
size_t iidx(size_t i, size_t j) const
index in triagonal matrix
Definition: mcc_matrices.hh:45
short S1(size_t i) const
Read access to sequence encoding S1.
Definition: mcc_matrices.hh:208
short S5(size_t s, size_t i) const
Read access to sequence encoding S5.
Definition: mcc_matrices.hh:276
McC_matrices_base(vrna_fold_compound_t *vc)
construct empty
Definition: mcc_matrices.cc:26
FLT_OR_DBL scale(size_t i) const
scale
Definition: mcc_matrices.hh:103
Definition: aligner.cc:17
Definition: mcc_matrices.hh:18
char rev_ptype(size_t i, size_t j) const
Reverse ptype.
Definition: mcc_matrices.hh:195
FLT_OR_DBL expMLbase(size_t i) const
expMLbase
Definition: mcc_matrices.hh:110
vrna_exp_param_t * exp_params() const
exp params
Definition: mcc_matrices.hh:96
vrna_fold_compound_t * vc_
vrna fold compound
Definition: mcc_matrices.hh:26
size_t jidx(size_t i, size_t j) const
index in triagonal matrix
Definition: mcc_matrices.hh:55
virtual ~McC_matrices_base()
Destructor.
Definition: mcc_matrices.cc:31
FLT_OR_DBL qb(size_t i, size_t j) const
Read access matrix qb.
Definition: mcc_matrices.hh:81
char ptype(size_t i, size_t j) const
Access matrix ptype.
Definition: mcc_matrices.hh:184
short S3(size_t s, size_t i) const
Read access to sequence encoding S3.
Definition: mcc_matrices.hh:265
McCaskill matrices.
Definition: mcc_matrices.hh:160
short S(size_t s, size_t i) const
Read access to sequence encoding S.
Definition: mcc_matrices.hh:252
short a2s(size_t s, size_t i) const
Read access to a2s.
Definition: mcc_matrices.hh:287
short pscore(size_t i, size_t j) const
Access matrix pscore.
Definition: mcc_matrices.hh:241
FLT_OR_DBL q1k(size_t k) const
Read access matrix q1k.
Definition: mcc_matrices.hh:126