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