RNAlib-2.4.14
dp_matrices.h
Go to the documentation of this file.
1 #ifndef VIENNA_RNA_PACKAGE_DP_MATRICES_H
2 #define VIENNA_RNA_PACKAGE_DP_MATRICES_H
3 
22 typedef struct vrna_mx_pf_s vrna_mx_pf_t;
23 
26 
32 typedef enum {
42 
46 struct vrna_mx_mfe_s {
50  vrna_mx_type_e type;
51  unsigned int length;
56 #ifndef VRNA_DISABLE_C11_FEATURES
57  /* C11 support for unnamed unions/structs */
58  union {
59  struct {
60 #endif
61 
66  int *c;
67  int *f5;
68  int *f3;
69  int *fc;
70  int *fML;
71  int *fM1;
72  int *fM2;
73  int *ggg;
74  int Fc;
75  int FcH;
76  int FcI;
77  int FcM;
82 #ifndef VRNA_DISABLE_C11_FEATURES
83  /* C11 support for unnamed unions/structs */
84 };
85 struct {
86 #endif
87 
92  int **c_local;
93  int *f3_local;
94  int **fML_local;
95  int **ggg_local;
99 #ifndef VRNA_DISABLE_C11_FEATURES
100  /* C11 support for unnamed unions/structs */
101 };
102 struct {
103 #endif
104 
110  int ***E_F5;
111  int **l_min_F5;
112  int **l_max_F5;
113  int *k_min_F5;
114  int *k_max_F5;
115 
116  int ***E_F3;
117  int **l_min_F3;
118  int **l_max_F3;
119  int *k_min_F3;
120  int *k_max_F3;
121 
122  int ***E_C;
123  int **l_min_C;
124  int **l_max_C;
125  int *k_min_C;
126  int *k_max_C;
127 
128  int ***E_M;
129  int **l_min_M;
130  int **l_max_M;
131  int *k_min_M;
132  int *k_max_M;
133 
134  int ***E_M1;
135  int **l_min_M1;
136  int **l_max_M1;
137  int *k_min_M1;
138  int *k_max_M1;
139 
140  int ***E_M2;
141  int **l_min_M2;
142  int **l_max_M2;
143  int *k_min_M2;
144  int *k_max_M2;
145 
146  int **E_Fc;
147  int *l_min_Fc;
148  int *l_max_Fc;
149  int k_min_Fc;
150  int k_max_Fc;
151 
152  int **E_FcH;
153  int *l_min_FcH;
154  int *l_max_FcH;
155  int k_min_FcH;
156  int k_max_FcH;
157 
158  int **E_FcI;
159  int *l_min_FcI;
160  int *l_max_FcI;
161  int k_min_FcI;
162  int k_max_FcI;
163 
164  int **E_FcM;
165  int *l_min_FcM;
166  int *l_max_FcM;
167  int k_min_FcM;
168  int k_max_FcM;
169 
170  /* auxilary arrays for remaining set of coarse graining (k,l) > (k_max, l_max) */
171  int *E_F5_rem;
172  int *E_F3_rem;
173  int *E_C_rem;
174  int *E_M_rem;
175  int *E_M1_rem;
176  int *E_M2_rem;
177 
178  int E_Fc_rem;
179  int E_FcH_rem;
180  int E_FcI_rem;
181  int E_FcM_rem;
182 
183 #ifdef COUNT_STATES
184  unsigned long ***N_F5;
185  unsigned long ***N_C;
186  unsigned long ***N_M;
187  unsigned long ***N_M1;
188 #endif
189 
194 #ifndef VRNA_DISABLE_C11_FEATURES
195  /* C11 support for unnamed unions/structs */
196 };
197 };
198 #endif
199 };
200 
204 struct vrna_mx_pf_s {
208  vrna_mx_type_e type;
209  unsigned int length;
210  FLT_OR_DBL *scale;
211  FLT_OR_DBL *expMLbase;
212 
213 
218 #ifndef VRNA_DISABLE_C11_FEATURES
219  /* C11 support for unnamed unions/structs */
220  union {
221  struct {
222 #endif
223 
229  FLT_OR_DBL *q;
230  FLT_OR_DBL *qb;
231  FLT_OR_DBL *qm;
232  FLT_OR_DBL *qm1;
233  FLT_OR_DBL *probs;
234  FLT_OR_DBL *q1k;
235  FLT_OR_DBL *qln;
236  FLT_OR_DBL *G;
237 
238  FLT_OR_DBL qo;
239  FLT_OR_DBL *qm2;
240  FLT_OR_DBL qho;
241  FLT_OR_DBL qio;
242  FLT_OR_DBL qmo;
243 
248 #ifndef VRNA_DISABLE_C11_FEATURES
249  /* C11 support for unnamed unions/structs */
250 };
251 struct {
252 #endif
253 
259  FLT_OR_DBL **q_local;
260  FLT_OR_DBL **qb_local;
261  FLT_OR_DBL **qm_local;
262  FLT_OR_DBL **pR;
263  FLT_OR_DBL **qm2_local;
264  FLT_OR_DBL **QI5;
265  FLT_OR_DBL **q2l;
266  FLT_OR_DBL **qmb;
267  FLT_OR_DBL **G_local;
272 #ifndef VRNA_DISABLE_C11_FEATURES
273  /* C11 support for unnamed unions/structs */
274 };
275 struct {
276 #endif
277 
283  FLT_OR_DBL ***Q;
284  int **l_min_Q;
285  int **l_max_Q;
286  int *k_min_Q;
287  int *k_max_Q;
288 
289 
290  FLT_OR_DBL ***Q_B;
291  int **l_min_Q_B;
292  int **l_max_Q_B;
293  int *k_min_Q_B;
294  int *k_max_Q_B;
295 
296  FLT_OR_DBL ***Q_M;
297  int **l_min_Q_M;
298  int **l_max_Q_M;
299  int *k_min_Q_M;
300  int *k_max_Q_M;
301 
302  FLT_OR_DBL ***Q_M1;
303  int **l_min_Q_M1;
304  int **l_max_Q_M1;
305  int *k_min_Q_M1;
306  int *k_max_Q_M1;
307 
308  FLT_OR_DBL ***Q_M2;
309  int **l_min_Q_M2;
310  int **l_max_Q_M2;
311  int *k_min_Q_M2;
312  int *k_max_Q_M2;
313 
314  FLT_OR_DBL **Q_c;
315  int *l_min_Q_c;
316  int *l_max_Q_c;
317  int k_min_Q_c;
318  int k_max_Q_c;
319 
320  FLT_OR_DBL **Q_cH;
321  int *l_min_Q_cH;
322  int *l_max_Q_cH;
323  int k_min_Q_cH;
324  int k_max_Q_cH;
325 
326  FLT_OR_DBL **Q_cI;
327  int *l_min_Q_cI;
328  int *l_max_Q_cI;
329  int k_min_Q_cI;
330  int k_max_Q_cI;
331 
332  FLT_OR_DBL **Q_cM;
333  int *l_min_Q_cM;
334  int *l_max_Q_cM;
335  int k_min_Q_cM;
336  int k_max_Q_cM;
337 
338  /* auxilary arrays for remaining set of coarse graining (k,l) > (k_max, l_max) */
339  FLT_OR_DBL *Q_rem;
340  FLT_OR_DBL *Q_B_rem;
341  FLT_OR_DBL *Q_M_rem;
342  FLT_OR_DBL *Q_M1_rem;
343  FLT_OR_DBL *Q_M2_rem;
344 
345  FLT_OR_DBL Q_c_rem;
346  FLT_OR_DBL Q_cH_rem;
347  FLT_OR_DBL Q_cI_rem;
348  FLT_OR_DBL Q_cM_rem;
353 #ifndef VRNA_DISABLE_C11_FEATURES
354  /* C11 support for unnamed unions/structs */
355 };
356 };
357 #endif
358 };
359 
389 int
391  vrna_mx_type_e type,
392  unsigned int options);
393 
394 
395 int
396 vrna_mx_mfe_add(vrna_fold_compound_t *vc,
397  vrna_mx_type_e mx_type,
398  unsigned int options);
399 
400 
401 int
402 vrna_mx_pf_add(vrna_fold_compound_t *vc,
403  vrna_mx_type_e mx_type,
404  unsigned int options);
405 
406 
407 int
408 vrna_mx_prepare(vrna_fold_compound_t *vc,
409  unsigned int options);
410 
411 
419 void
421 
422 
430 void
432 
433 
438 #endif
int * fc
Energy from i to cutpoint (and vice versa if i>cut)
Definition: dp_matrices.h:69
int vrna_mx_add(vrna_fold_compound_t *vc, vrna_mx_type_e type, unsigned int options)
Add Dynamic Programming (DP) matrices (allocate memory)
Minimum Free Energy (MFE) Dynamic Programming (DP) matrices data structure required within the vrna_f...
Definition: dp_matrices.h:46
int * fM1
Second ML array, only for unique multibrnach loop decomposition.
Definition: dp_matrices.h:71
int * fML
Multi-loop auxiliary energy array.
Definition: dp_matrices.h:70
double FLT_OR_DBL
Typename for floating point number in partition function computations.
Definition: basic.h:43
The most basic data structure required by many functions throughout the RNAlib.
Definition: fold_compound.h:132
unsigned int length
Length of the sequence, therefore an indicator of the size of the DP matrices.
Definition: dp_matrices.h:51
int * fM2
Energy for a multibranch loop region with exactly two stems, extending to 3' end. ...
Definition: dp_matrices.h:72
void vrna_mx_mfe_free(vrna_fold_compound_t *vc)
Free memory occupied by the Minimum Free Energy (MFE) Dynamic Programming (DP) matrices.
DP matrices suitable for local structure prediction using window approach.
Definition: dp_matrices.h:34
Various data structures and pre-processor macros.
int ** ggg_local
Energies of g-quadruplexes.
Definition: dp_matrices.h:95
void vrna_mx_pf_free(vrna_fold_compound_t *vc)
Free memory occupied by the Partition Function (PF) Dynamic Programming (DP) matrices.
int ** c_local
Energy array, given that i-j pair.
Definition: dp_matrices.h:92
Default DP matrices.
Definition: dp_matrices.h:33
int * f3
Energy of 3' end.
Definition: dp_matrices.h:68
DP matrices suitable for distance class partitioned structure prediction.
Definition: dp_matrices.h:38
int * f5
Energy of 5' end.
Definition: dp_matrices.h:67
int Fc
Minimum Free Energy of entire circular RNA.
Definition: dp_matrices.h:74
vrna_mx_type_e
An enumerator that is used to specify the type of a polymorphic Dynamic Programming (DP) matrix data ...
Definition: dp_matrices.h:32
int * c
Energy array, given that i-j pair.
Definition: dp_matrices.h:66
int ** fML_local
Multi-loop auxiliary energy array.
Definition: dp_matrices.h:94
The Basic Fold Compound API.
int * f3_local
Energy of 5' end.
Definition: dp_matrices.h:93
int * ggg
Energies of g-quadruplexes.
Definition: dp_matrices.h:73
Partition function (PF) Dynamic Programming (DP) matrices data structure required within the vrna_fol...
Definition: dp_matrices.h:204