RNAlib-2.2.7
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 
16 typedef struct vrna_mx_pf_s vrna_mx_pf_t;
17 
19 
25 typedef enum {
35 
39 struct vrna_mx_mfe_s {
43  vrna_mx_type_e type;
44  unsigned int length;
49 #if ( __STDC_VERSION__ >= 201112L ) || ( __cplusplus >= 201103L )
50  /* C11 support for unnamed unions/structs */
51  union {
52  struct {
53 #endif
54 
59  int *c;
60  int *f5;
61  int *f3;
62  int *fc;
63  int *fML;
64  int *fM1;
65  int *fM2;
66  int *ggg;
67  int Fc;
68  int FcH;
69  int FcI;
70  int FcM;
75 #if ( __STDC_VERSION__ >= 201112L ) || ( __cplusplus >= 201103L )
76  /* C11 support for unnamed unions/structs */
77  };
78  struct {
79 #endif
80 
85  int **c_local;
86  int *f3_local;
87  int **fML_local;
88  int **ggg_local;
92 #if ( __STDC_VERSION__ >= 201112L ) || ( __cplusplus >= 201103L )
93  /* C11 support for unnamed unions/structs */
94  };
95  struct {
96 #endif
97 
103  int ***E_F5;
104  int **l_min_F5;
105  int **l_max_F5;
106  int *k_min_F5;
107  int *k_max_F5;
108 
109  int ***E_F3;
110  int **l_min_F3;
111  int **l_max_F3;
112  int *k_min_F3;
113  int *k_max_F3;
114 
115  int ***E_C;
116  int **l_min_C;
117  int **l_max_C;
118  int *k_min_C;
119  int *k_max_C;
120 
121  int ***E_M;
122  int **l_min_M;
123  int **l_max_M;
124  int *k_min_M;
125  int *k_max_M;
126 
127  int ***E_M1;
128  int **l_min_M1;
129  int **l_max_M1;
130  int *k_min_M1;
131  int *k_max_M1;
132 
133  int ***E_M2;
134  int **l_min_M2;
135  int **l_max_M2;
136  int *k_min_M2;
137  int *k_max_M2;
138 
139  int **E_Fc;
140  int *l_min_Fc;
141  int *l_max_Fc;
142  int k_min_Fc;
143  int k_max_Fc;
144 
145  int **E_FcH;
146  int *l_min_FcH;
147  int *l_max_FcH;
148  int k_min_FcH;
149  int k_max_FcH;
150 
151  int **E_FcI;
152  int *l_min_FcI;
153  int *l_max_FcI;
154  int k_min_FcI;
155  int k_max_FcI;
156 
157  int **E_FcM;
158  int *l_min_FcM;
159  int *l_max_FcM;
160  int k_min_FcM;
161  int k_max_FcM;
162 
163  /* auxilary arrays for remaining set of coarse graining (k,l) > (k_max, l_max) */
164  int *E_F5_rem;
165  int *E_F3_rem;
166  int *E_C_rem;
167  int *E_M_rem;
168  int *E_M1_rem;
169  int *E_M2_rem;
170 
171  int E_Fc_rem;
172  int E_FcH_rem;
173  int E_FcI_rem;
174  int E_FcM_rem;
175 
176 #ifdef COUNT_STATES
177  unsigned long ***N_F5;
178  unsigned long ***N_C;
179  unsigned long ***N_M;
180  unsigned long ***N_M1;
181 #endif
182 
187 #if ( __STDC_VERSION__ >= 201112L ) || ( __cplusplus >= 201103L )
188  /* C11 support for unnamed unions/structs */
189  };
190  };
191 #endif
192 };
193 
197 struct vrna_mx_pf_s {
201  vrna_mx_type_e type;
202  unsigned int length;
203  FLT_OR_DBL *scale;
204  FLT_OR_DBL *expMLbase;
205 
206 
211 #if ( __STDC_VERSION__ >= 201112L ) || ( __cplusplus >= 201103L )
212  /* C11 support for unnamed unions/structs */
213  union {
214  struct {
215 #endif
216 
222  FLT_OR_DBL *q;
223  FLT_OR_DBL *qb;
224  FLT_OR_DBL *qm;
225  FLT_OR_DBL *qm1;
226  FLT_OR_DBL *probs;
227  FLT_OR_DBL *q1k;
228  FLT_OR_DBL *qln;
229  FLT_OR_DBL *G;
230 
231  FLT_OR_DBL qo;
232  FLT_OR_DBL *qm2;
233  FLT_OR_DBL qho;
234  FLT_OR_DBL qio;
235  FLT_OR_DBL qmo;
236 
241 #if ( __STDC_VERSION__ >= 201112L ) || ( __cplusplus >= 201103L )
242  /* C11 support for unnamed unions/structs */
243  };
244  struct {
245 #endif
246 
252  FLT_OR_DBL ***Q;
253  int **l_min_Q;
254  int **l_max_Q;
255  int *k_min_Q;
256  int *k_max_Q;
257 
258 
259  FLT_OR_DBL ***Q_B;
260  int **l_min_Q_B;
261  int **l_max_Q_B;
262  int *k_min_Q_B;
263  int *k_max_Q_B;
264 
265  FLT_OR_DBL ***Q_M;
266  int **l_min_Q_M;
267  int **l_max_Q_M;
268  int *k_min_Q_M;
269  int *k_max_Q_M;
270 
271  FLT_OR_DBL ***Q_M1;
272  int **l_min_Q_M1;
273  int **l_max_Q_M1;
274  int *k_min_Q_M1;
275  int *k_max_Q_M1;
276 
277  FLT_OR_DBL ***Q_M2;
278  int **l_min_Q_M2;
279  int **l_max_Q_M2;
280  int *k_min_Q_M2;
281  int *k_max_Q_M2;
282 
283  FLT_OR_DBL **Q_c;
284  int *l_min_Q_c;
285  int *l_max_Q_c;
286  int k_min_Q_c;
287  int k_max_Q_c;
288 
289  FLT_OR_DBL **Q_cH;
290  int *l_min_Q_cH;
291  int *l_max_Q_cH;
292  int k_min_Q_cH;
293  int k_max_Q_cH;
294 
295  FLT_OR_DBL **Q_cI;
296  int *l_min_Q_cI;
297  int *l_max_Q_cI;
298  int k_min_Q_cI;
299  int k_max_Q_cI;
300 
301  FLT_OR_DBL **Q_cM;
302  int *l_min_Q_cM;
303  int *l_max_Q_cM;
304  int k_min_Q_cM;
305  int k_max_Q_cM;
306 
307  /* auxilary arrays for remaining set of coarse graining (k,l) > (k_max, l_max) */
308  FLT_OR_DBL *Q_rem;
309  FLT_OR_DBL *Q_B_rem;
310  FLT_OR_DBL *Q_M_rem;
311  FLT_OR_DBL *Q_M1_rem;
312  FLT_OR_DBL *Q_M2_rem;
313 
314  FLT_OR_DBL Q_c_rem;
315  FLT_OR_DBL Q_cH_rem;
316  FLT_OR_DBL Q_cI_rem;
317  FLT_OR_DBL Q_cM_rem;
322 #if ( __STDC_VERSION__ >= 201112L ) || ( __cplusplus >= 201103L )
323  /* C11 support for unnamed unions/structs */
324  };
325  };
326 #endif
327 };
328 
358 int
360  vrna_mx_type_e type,
361  unsigned int options);
362 
363 int
364 vrna_mx_mfe_add(vrna_fold_compound_t *vc,
365  vrna_mx_type_e mx_type,
366  unsigned int options);
367 
368 int
369 vrna_mx_pf_add( vrna_fold_compound_t *vc,
370  vrna_mx_type_e mx_type,
371  unsigned int options);
372 
380 void
382 
390 void
392 
397 #endif
int * fc
Energy from i to cutpoint (and vice versa if i>cut)
Definition: dp_matrices.h:62
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:39
int * fM1
Second ML array, only for unique multibrnach loop decomposition.
Definition: dp_matrices.h:64
int * fML
Multi-loop auxiliary energy array.
Definition: dp_matrices.h:63
double FLT_OR_DBL
Typename for floating point number in partition function computations.
Definition: data_structures.h:39
The most basic data structure required by many functions throughout the RNAlib.
Definition: data_structures.h:390
unsigned int length
Length of the sequence, therefore an indicator of the size of the DP matrices.
Definition: dp_matrices.h:44
int * fM2
Energy for a multibranch loop region with exactly two stems, extending to 3' end. ...
Definition: dp_matrices.h:65
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:27
int ** ggg_local
Energies of g-quadruplexes.
Definition: dp_matrices.h:88
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:85
Default DP matrices.
Definition: dp_matrices.h:26
int * f3
Energy of 3' end.
Definition: dp_matrices.h:61
DP matrices suitable for distance class partitioned structure prediction.
Definition: dp_matrices.h:31
int * f5
Energy of 5' end.
Definition: dp_matrices.h:60
int Fc
Minimum Free Energy of entire circular RNA.
Definition: dp_matrices.h:67
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:25
int * c
Energy array, given that i-j pair.
Definition: dp_matrices.h:59
int ** fML_local
Multi-loop auxiliary energy array.
Definition: dp_matrices.h:87
int * f3_local
Energy of 5' end.
Definition: dp_matrices.h:86
int * ggg
Energies of g-quadruplexes.
Definition: dp_matrices.h:66
Partition function (PF) Dynamic Programming (DP) matrices data structure required within the vrna_fol...
Definition: dp_matrices.h:197