RNAlib-2.2.0c
~data_structures.h
1 #ifndef __VIENNA_RNA_PACKAGE_DATA_STRUCTURES_H__
2 #define __VIENNA_RNA_PACKAGE_DATA_STRUCTURES_H__
3 
5 #include <ViennaRNA/model.h>
6 #include <ViennaRNA/params.h>
7 
8 
18 /* to use floats instead of doubles in pf_fold() comment next line */
19 #define LARGE_PF
20 
21 #ifdef LARGE_PF
22 #define FLT_OR_DBL double
23 #else
24 #define FLT_OR_DBL float
25 #endif
26 
27 #ifndef NBASES
28 #define NBASES 8
29 #endif
30 
34 #define MAXDOS 1000
35 
36 /*
37 * ############################################################
38 * Here are the type definitions of various datastructures
39 * shared among the Vienna RNA Package
40 * ############################################################
41 */
42 
46 typedef struct plist {
47  int i;
48  int j;
49  float p;
50  int type;
51 } plist;
52 
56 typedef struct cpair {
57  int i,j,mfe;
58  float p, hue, sat;
59 } cpair;
60 
61 
65 typedef struct sect {
66  int i;
67  int j;
68  int ml;
69 } sect;
70 
74 typedef struct bondT {
75  unsigned int i;
76  unsigned int j;
77 } bondT;
78 
82 typedef struct bondTEn {
83  int i;
84  int j;
85  int energy;
86 } bondTEn;
87 
88 
89 /*
90 * ############################################################
91 * SUBOPT data structures
92 * ############################################################
93 */
94 
98 typedef struct {
99  int i;
100  int j;
101 } PAIR;
102 
106 typedef struct {
107  int i;
108  int j;
109  int array_flag;
110 } INTERVAL;
111 
115 typedef struct {
116  float energy;
117  char *structure;
118 } SOLUTION;
119 
120 /*
121 * ############################################################
122 * COFOLD data structures
123 * ############################################################
124 */
125 
129 typedef struct cofoldF {
130  /* free energies for: */
131  double F0AB;
132  double FAB;
133  double FcAB;
134  double FA;
135  double FB;
136 } cofoldF;
137 
141 typedef struct ConcEnt {
142  double A0;
143  double B0;
144  double ABc;
145  double AAc;
146  double BBc;
147  double Ac;
148  double Bc;
149 } ConcEnt;
150 
154 typedef struct pairpro{
155  struct plist *AB;
156  struct plist *AA;
157  struct plist *A;
158  struct plist *B;
159  struct plist *BB;
160 } pairpro;
161 
172 typedef struct {
173  unsigned i;
174  unsigned j;
175  float p;
176  float ent;
177  short bp[8];
178  char comp;
179 } pair_info;
180 
181 
182 /*
183 * ############################################################
184 * FINDPATH data structures
185 * ############################################################
186 */
187 
191 typedef struct move {
192  int i; /* i,j>0 insert; i,j<0 delete */
193  int j;
194  int when; /* 0 if still available, else resulting distance from start */
195  int E;
196 } move_t;
197 
201 typedef struct intermediate {
202  short *pt;
203  int Sen;
204  int curr_en;
205  move_t *moves;
207 
211 typedef struct path {
212  double en;
213  char *s;
214 } path_t;
215 
216 /*
217 * ############################################################
218 * RNAup data structures
219 * ############################################################
220 */
221 
225 typedef struct pu_contrib {
226  double **H;
227  double **I;
228  double **M;
229  double **E;
230  int length;
231  int w;
232 } pu_contrib;
233 
237 typedef struct interact {
238  double *Pi;
239  double *Gi;
240  double Gikjl;
242  double Gikjl_wo;
243  int i;
244  int k;
245  int j;
246  int l;
247  int length;
248 } interact;
249 
253 typedef struct pu_out {
254  int len;
255  int u_vals;
256  int contribs;
257  char **header;
258  double **u_values;
259 } pu_out;
260 
264 typedef struct constrain{
265  int *indx;
266  char *ptype;
267 } constrain;
268 
269 /*
270 * ############################################################
271 * RNAduplex data structures
272 * ############################################################
273 */
274 
278 typedef struct {
279  int i;
280  int j;
281  int end;
282  char *structure;
283  double energy;
284  double energy_backtrack;
285  double opening_backtrack_x;
286  double opening_backtrack_y;
287  int offset;
288  double dG1;
289  double dG2;
290  double ddG;
291  int tb;
292  int te;
293  int qb;
294  int qe;
295 } duplexT;
296 
297 /*
298 * ############################################################
299 * RNAsnoop data structures
300 * ############################################################
301 */
302 
306 typedef struct node {
307  int k;
308  int energy;
309  struct node *next;
310 } folden;
311 
315 typedef struct {
316  int i;
317  int j;
318  int u;
319  char *structure;
320  float energy;
321  float Duplex_El;
322  float Duplex_Er;
323  float Loop_E;
324  float Loop_D;
325  float pscd;
326  float psct;
327  float pscg;
328  float Duplex_Ol;
329  float Duplex_Or;
330  float Duplex_Ot;
331  float fullStemEnergy;
332 } snoopT;
333 
334 
335 /*
336 * ############################################################
337 * PKplex data structures
338 * ############################################################
339 */
340 
344 typedef struct dupVar{
345  int i;
346  int j;
347  int end;
348  char *pk_helix;
349  char *structure;
350  double energy;
351  int offset;
352  double dG1;
353  double dG2;
354  double ddG;
355  int tb;
356  int te;
357  int qb;
358  int qe;
359  int inactive;
360  int processed;
361 } dupVar;
362 
368 /*
369 * ############################################################
370 * VRNA fold compound related functions
371 * ############################################################
372 */
373 
390 typedef struct{
391  unsigned int allocated;
392  unsigned int length;
393  int *c;
394  int *f5;
395  int *f3;
396  int *fc;
397  int *fML;
398  int *fM1;
399  int *fM2;
400  int *ggg;
401  int Fc;
402  int FcH;
403  int FcI;
404  int FcM;
405 } vrna_mx_mfe_t;
406 
410 typedef struct{
411  unsigned int allocated;
412  unsigned int length;
413  FLT_OR_DBL *q;
414  FLT_OR_DBL *qb;
415  FLT_OR_DBL *qm;
416  FLT_OR_DBL *qm1;
417  FLT_OR_DBL *probs;
418  FLT_OR_DBL *q1k;
419  FLT_OR_DBL *qln;
420  FLT_OR_DBL *G;
421 
422  FLT_OR_DBL qo;
423  FLT_OR_DBL *qm2;
424  FLT_OR_DBL qho;
425  FLT_OR_DBL qio;
426  FLT_OR_DBL qmo;
427 
428  FLT_OR_DBL *scale;
429  FLT_OR_DBL *expMLbase;
430 } vrna_mx_pf_t;
431 
438 typedef struct{
439 
440  unsigned int type;
447  unsigned int length;
448  int cutpoint;
451  union {
452  struct {
453  char *sequence;
456  short *sequence_encoding;
460  short *sequence_encoding2;
461  char *ptype;
470  char *ptype_pf_compat;
475  struct vrna_sc_t *sc;
478  };
479  struct {
480  char **sequences;
484  unsigned int n_seq;
487  char *cons_seq;
488  short *S_cons;
489  short **S;
490  short **S5;
493  short **S3;
496  char **Ss;
497  unsigned short **a2s;
498  int *pscore;
501  struct vrna_sc_t **scs;
502  int oldAliEn;
503  };
504  };
505 
506  struct vrna_hc_t *hc;
507 
508  vrna_mx_mfe_t *matrices;
509  vrna_mx_pf_t *exp_matrices;
510 
511  struct vrna_param_t *params;
512  struct vrna_exp_param_t *exp_params;
513 
514  int *iindx;
515  int *jindx;
516 
518 
522 #define VRNA_VC_TYPE_SINGLE 1
523 
527 #define VRNA_VC_TYPE_ALIGNMENT 2
528 
529 /* the definitions below should be used for functions that return/receive/destroy fold compound data structures */
530 
537 #define VRNA_OPTION_MFE 1
538 
545 #define VRNA_OPTION_PF 2
546 
547 #define VRNA_OPTION_HYBRID 4
548 
558 #define VRNA_OPTION_EVAL_ONLY 8
559 
560 
561 
589 vrna_fold_compound *vrna_get_fold_compound( const char *sequence,
590  vrna_md_t *md_p,
591  unsigned int options);
592 
620 vrna_fold_compound *vrna_get_fold_compound_ali( const char **sequences,
621  vrna_md_t *md_p,
622  unsigned int options);
623 
632 
641 
650 
655 #endif
Definition: data_structures.h:306
double FAB
all states with DuplexInit correction
Definition: data_structures.h:132
char ** header
header line
Definition: data_structures.h:257
int w
longest unpaired region
Definition: data_structures.h:231
double ** H
hairpin loops
Definition: data_structures.h:226
The hard constraints data structure.
Definition: constraints.h:323
int contribs
[-c "SHIME"]
Definition: data_structures.h:256
Base pair with associated energy.
Definition: data_structures.h:82
int oldAliEn
use old alifold energies (with gaps)
Definition: data_structures.h:201
Definition: data_structures.h:129
double FcAB
true hybrid states only
Definition: data_structures.h:133
The model details data structure and its corresponding modifiers.
Definition: data_structures.h:191
Definition: data_structures.h:315
double FB
monomer B
Definition: data_structures.h:135
int length
length of longer sequence
Definition: data_structures.h:247
Collection of all free_energy of beeing unpaired values for output.
Definition: data_structures.h:253
double Gikjl
full free energy for interaction between [k,i] k
Definition: data_structures.h:240
Definition: data_structures.h:344
double * Gi
free energies of interaction
Definition: data_structures.h:239
void vrna_free_mfe_matrices(vrna_fold_compound *vc)
Free memory occupied by the Minimum Free Energy (MFE) Dynamic Programming (DP) matrices.
The most basic data structure required by many functions throughout the RNAlib.
Definition: data_structures.h:437
Solution element from subopt.c.
Definition: data_structures.h:115
constraints for cofolding
Definition: data_structures.h:264
Definition: data_structures.h:278
double ** u_values
(the -u values * [-c "SHIME"]) * seq len
Definition: data_structures.h:258
double * Pi
probabilities of interaction
Definition: data_structures.h:238
A base pair info structure.
Definition: data_structures.h:172
this datastructure is used as input parameter in functions of PS_dot.h and others ...
Definition: data_structures.h:46
void vrna_free_fold_compound(vrna_fold_compound *vc)
Free memory occupied by a vrna_fold_compound.
vrna_fold_compound * vrna_get_fold_compound(const char *sequence, vrna_md_t *md_p, unsigned int options)
Retrieve a vrna_fold_compound data structure for single sequences and hybridizing sequences...
void vrna_free_pf_matrices(vrna_fold_compound *vc)
Free memory occupied by the Partition Function (PF) Dynamic Programming (DP) matrices.
Partition function (PF) Dynamic Programming (DP) matrices data structure required within the vrna_fol...
Definition: data_structures.h:410
double F0AB
Null model without DuplexInit.
Definition: data_structures.h:131
int k
k
Definition: data_structures.h:244
double A0
start concentration A
Definition: data_structures.h:142
Sequence interval stack element used in subopt.c.
Definition: data_structures.h:106
Definition: data_structures.h:237
int l
j
Definition: data_structures.h:246
double ABc
End concentration AB.
Definition: data_structures.h:144
Base pair.
Definition: data_structures.h:74
Stack of partial structures for backtracking.
Definition: data_structures.h:65
int len
sequence length
Definition: data_structures.h:254
double ** E
exterior loop
Definition: data_structures.h:229
The datastructure that contains temperature scaled energy parameters.
Definition: params.h:41
The soft constraints data structure.
Definition: constraints.h:346
double ** I
interior loops
Definition: data_structures.h:227
The data structure that contains the complete model details used throughout the calculations.
Definition: model.h:63
this datastructure is used as input parameter in functions of PS_dot.c
Definition: data_structures.h:56
int i
k
Definition: data_structures.h:243
Definition: data_structures.h:211
int length
length of the input sequence
Definition: data_structures.h:230
double Gikjl_wo
Gikjl without contributions for prob_unpaired.
Definition: data_structures.h:242
int j
j
Definition: data_structures.h:245
vrna_fold_compound * vrna_get_fold_compound_ali(const char **sequences, vrna_md_t *md_p, unsigned int options)
Retrieve a vrna_fold_compound data structure for sequence alignments.
Base pair data structure used in subopt.c.
Definition: data_structures.h:98
double ** M
multi loops
Definition: data_structures.h:228
contributions to p_u
Definition: data_structures.h:225
Definition: data_structures.h:154
The datastructure that contains temperature scaled Boltzmann weights of the energy parameters...
Definition: params.h:86
int * iindx
index array to move through pr.
double B0
start concentration B
Definition: data_structures.h:143
Definition: data_structures.h:141
Minimum Free Energy (MFE) Dynamic Programming (DP) matrices data structure required within the vrna_f...
Definition: data_structures.h:390
int u_vals
number of different -u values
Definition: data_structures.h:255
double FA
monomer A
Definition: data_structures.h:134