RNAlib-2.2.9

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

data_structures.h
Go to the documentation of this file.
1 #ifndef VIENNA_RNA_PACKAGE_DATA_STRUCTURES_H
2 #define VIENNA_RNA_PACKAGE_DATA_STRUCTURES_H
3
13 /* below are several convenience typedef's we use throughout the ViennaRNA library */
14
18 typedef struct vrna_fc_s vrna_fold_compound_t;
19
21 typedef struct vrna_basepair_s vrna_basepair_t;
22
24 typedef struct vrna_plist_s vrna_plist_t;
25
27 typedef struct vrna_bp_stack_s vrna_bp_stack_t;
28
30 typedef struct vrna_cpair_s vrna_cpair_t;
31
33 typedef struct vrna_sect_s vrna_sect_t;
34
36 #ifdef USE_FLOAT_PF
37 typedef float FLT_OR_DBL;
38 #else
39 typedef double FLT_OR_DBL;
40 #endif
41
51 typedef void (vrna_callback_free_auxdata)(void *data);
52
62 typedef void (vrna_callback_recursion_status)(unsigned char status, void *data);
63
64
72 #define VRNA_STATUS_MFE_PRE (unsigned char)1
73
81 #define VRNA_STATUS_MFE_POST (unsigned char)2
82
89 #define VRNA_STATUS_PF_PRE (unsigned char)3
90
97 #define VRNA_STATUS_PF_POST (unsigned char)4
98
99
100 /* make this interface backward compatible with RNAlib < 2.2.0 */
101 #define VRNA_BACKWARD_COMPAT
102
103
104 #ifdef VRNA_BACKWARD_COMPAT
105
106 /* the following typedefs are for backward compatibility only */
107
112 typedef struct vrna_basepair_s PAIR;
113
118 typedef struct vrna_plist_s plist;
119
124 typedef struct vrna_cpair_s cpair;
125
130 typedef struct vrna_sect_s sect;
131
136 typedef struct vrna_bp_stack_s bondT;
137
138 #endif
139
140 #include <ViennaRNA/energy_const.h>
141 #include <ViennaRNA/model.h>
142 #include <ViennaRNA/params.h>
143 #include <ViennaRNA/dp_matrices.h>
144 #include <ViennaRNA/constraints.h>
145
146 /*
147 * ############################################################
148 * Here are the type definitions of various datastructures
149 * shared among the Vienna RNA Package
150 * ############################################################
151 */
152
156 struct vrna_basepair_s {
157 int i;
158 int j;
159 };
160
164 struct vrna_plist_s {
165 int i;
166 int j;
167 float p;
168 int type;
169 };
170
174 struct vrna_cpair_s {
175 int i,j,mfe;
176 float p, hue, sat;
177 };
178
179
183 struct vrna_sect_s {
184 int i;
185 int j;
186 int ml;
187 };
188
192 struct vrna_bp_stack_s {
193 unsigned int i;
194 unsigned int j;
195 };
196
197
198 /*
199 * ############################################################
200 * RNAup data structures
201 * ############################################################
202 */
203
207 typedef struct pu_contrib {
208 double **H;
209 double **I;
210 double **M;
211 double **E;
212 int length;
213 int w;
214 } pu_contrib;
215
219 typedef struct interact {
220 double *Pi;
221 double *Gi;
222 double Gikjl;
224 double Gikjl_wo;
225 int i;
226 int k;
227 int j;
228 int l;
229 int length;
230 } interact;
231
235 typedef struct pu_out {
236 int len;
237 int u_vals;
238 int contribs;
239 char **header;
240 double **u_values;
241 } pu_out;
242
246 typedef struct constrain{
247 int *indx;
248 char *ptype;
249 } constrain;
250
251 /*
252 * ############################################################
253 * RNAduplex data structures
254 * ############################################################
255 */
256
260 typedef struct {
261 int i;
262 int j;
263 int end;
264 char *structure;
265 double energy;
266 double energy_backtrack;
267 double opening_backtrack_x;
268 double opening_backtrack_y;
269 int offset;
270 double dG1;
271 double dG2;
272 double ddG;
273 int tb;
274 int te;
275 int qb;
276 int qe;
277 } duplexT;
278
279 /*
280 * ############################################################
281 * RNAsnoop data structures
282 * ############################################################
283 */
284
288 typedef struct node {
289 int k;
290 int energy;
291 struct node *next;
292 } folden;
293
297 typedef struct {
298 int i;
299 int j;
300 int u;
301 char *structure;
302 float energy;
303 float Duplex_El;
304 float Duplex_Er;
305 float Loop_E;
306 float Loop_D;
307 float pscd;
308 float psct;
309 float pscg;
310 float Duplex_Ol;
311 float Duplex_Or;
312 float Duplex_Ot;
313 float fullStemEnergy;
314 } snoopT;
315
316
317 /*
318 * ############################################################
319 * PKplex data structures
320 * ############################################################
321 */
322
326 typedef struct dupVar{
327 int i;
328 int j;
329 int end;
330 char *pk_helix;
331 char *structure;
332 double energy;
333 int offset;
334 double dG1;
335 double dG2;
336 double ddG;
337 int tb;
338 int te;
339 int qb;
340 int qe;
341 int inactive;
342 int processed;
343 } dupVar;
344
375 #ifndef VRNA_DISABLE_C11_FEATURES
376 void vrna_C11_features(void);
377 #endif
378
384 /*
385 * ############################################################
386 * VRNA fold compound related functions
387 * ############################################################
388 */
389
406 typedef enum {
407 VRNA_VC_TYPE_SINGLE,
408 VRNA_VC_TYPE_ALIGNMENT
409 } vrna_fc_type_e;
410
411
424 struct vrna_fc_s{
425
430 vrna_fc_type_e type;
437 unsigned int length;
438 int cutpoint;
442 vrna_hc_t *hc;
444 vrna_mx_mfe_t *matrices;
445 vrna_mx_pf_t *exp_matrices;
447 vrna_param_t *params;
448 vrna_exp_param_t *exp_params;
450 int *iindx;
451 int *jindx;
459 vrna_callback_recursion_status *stat_cb;
464 void *auxdata;
468 vrna_callback_free_auxdata *free_auxdata;
476 #ifndef VRNA_DISABLE_C11_FEATURES
477 /* C11 support for unnamed unions/structs */
478 union {
479 struct {
480 #endif
481
486 char *sequence;
489 short *sequence_encoding;
493 short *sequence_encoding2;
494 char *ptype;
503 char *ptype_pf_compat;
508 vrna_sc_t *sc;
516 #ifndef VRNA_DISABLE_C11_FEATURES
517 /* C11 support for unnamed unions/structs */
518 };
519 struct {
520 #endif
521
526 char **sequences;
530 unsigned int n_seq;
533 char *cons_seq;
536 short *S_cons;
539 short **S;
542 short **S5;
545 short **S3;
548 char **Ss;
549 unsigned short **a2s;
550 int *pscore;
553 short *pscore_pf_compat;
557 vrna_sc_t **scs;
560 int oldAliEn;
561
565 #ifndef VRNA_DISABLE_C11_FEATURES
566 };
567 };
568 #endif
569
576 unsigned int maxD1;
577 unsigned int maxD2;
578 short *reference_pt1;
579 short *reference_pt2;
581 unsigned int *referenceBPs1;
582 unsigned int *referenceBPs2;
583 unsigned int *bpdist;
585 unsigned int *mm1;
586 unsigned int *mm2;
598 int window_size;
599 char **ptype_local;
604 };
605
606
607 /* the definitions below should be used for functions that return/receive/destroy fold compound data structures */
608
612 #define VRNA_OPTION_DEFAULT 0U
613
620 #define VRNA_OPTION_MFE 1U
621
628 #define VRNA_OPTION_PF 2U
629
633 #define VRNA_OPTION_HYBRID 4U
634
644 #define VRNA_OPTION_EVAL_ONLY 8U
645
649 #define VRNA_OPTION_WINDOW 16U
650
690 vrna_fold_compound_t *
691 vrna_fold_compound( const char *sequence,
692 vrna_md_t *md_p,
693 unsigned int options);
694
732 vrna_fold_compound_t *
733 vrna_fold_compound_comparative( const char **sequences,
734 vrna_md_t *md_p,
735 unsigned int options);
736
737 vrna_fold_compound_t *
738 vrna_fold_compound_TwoD(const char *sequence,
739 const char *s1,
740 const char *s2,
741 vrna_md_t *md_p,
742 unsigned int options);
743
744 int
745 vrna_fold_compound_prepare( vrna_fold_compound_t *vc,
746 unsigned int options);
747
755 void
756 vrna_fold_compound_free(vrna_fold_compound_t *vc);
757
775 void vrna_fold_compound_add_auxdata(vrna_fold_compound_t *vc,
776 void *data,
777 vrna_callback_free_auxdata *f);
778
794 void vrna_fold_compound_add_callback( vrna_fold_compound_t *vc,
795 vrna_callback_recursion_status *f);
796
797
802 #endif
vrna_fc_s::S3
short ** S3
Sl[s][i] holds next base 3&#39; of i in sequence s.
Definition: data_structures.h:545
vrna_fc_s::S
short ** S
Numerical encoding of the sequences in the alignment.
Definition: data_structures.h:539
vrna_fold_compound_add_callback
void vrna_fold_compound_add_callback(vrna_fold_compound_t *vc, vrna_callback_recursion_status *f)
Add a recursion status callback to the vrna_fold_compound_t.
interact::l
int l
j<l in shorter seq
Definition: data_structures.h:228
pu_contrib::M
double ** M
multi loops
Definition: data_structures.h:210
vrna_fc_s::mm1
unsigned int * mm1
Maximum matching matrix, reference struct 1 disallowed.
Definition: data_structures.h:585
vrna_mx_mfe_s
Minimum Free Energy (MFE) Dynamic Programming (DP) matrices data structure required within the vrna_f...
Definition: dp_matrices.h:39
vrna_fold_compound_comparative
vrna_fold_compound_t * vrna_fold_compound_comparative(const char **sequences, vrna_md_t *md_p, unsigned int options)
Retrieve a vrna_fold_compound_t data structure for sequence alignments.
vrna_fc_s::S_cons
short * S_cons
Numerical encoding of the consensus sequence.
Definition: data_structures.h:536
vrna_C11_features
void vrna_C11_features(void)
Dummy symbol to check whether the library was build using C11/C++11 features.
vrna_fc_s::ptype
char * ptype
Pair type array.
Definition: data_structures.h:494
dp_matrices.h
vrna_fc_s::sequence_encoding
short * sequence_encoding
Numerical encoding of the input sequence.
Definition: data_structures.h:489
pu_contrib::H
double ** H
hairpin loops
Definition: data_structures.h:208
vrna_fc_s::exp_params
vrna_exp_param_t * exp_params
The precomputed free energy contributions as Boltzmann factors.
Definition: data_structures.h:448
dupVar
struct dupVar dupVar
Data structure used in RNApkplex.
constrain
struct constrain constrain
constraints for cofolding
pu_out::u_vals
int u_vals
number of different -u values
Definition: data_structures.h:237
dupVar
Data structure used in RNApkplex.
Definition: data_structures.h:326
vrna_fc_s::bpdist
unsigned int * bpdist
Matrix containing base pair distance of reference structure 1 and 2 on interval [i,j].
Definition: data_structures.h:583
vrna_fc_s::reference_pt1
short * reference_pt1
A pairtable of the first reference structure.
Definition: data_structures.h:578
vrna_fc_s::sc
vrna_sc_t * sc
The soft constraints for usage in structure prediction and evaluation.
Definition: data_structures.h:508
pu_contrib
struct pu_contrib pu_contrib
contributions to p_u
FLT_OR_DBL
double FLT_OR_DBL
Typename for floating point number in partition function computations.
Definition: data_structures.h:39
vrna_fc_s
The most basic data structure required by many functions throughout the RNAlib.
Definition: data_structures.h:424
vrna_fc_s::sequences
char ** sequences
The aligned sequences.
Definition: data_structures.h:526
interact::j
int j
j<l in shorter seq
Definition: data_structures.h:227
node
Data structure for RNAsnoop (fold energy list)
Definition: data_structures.h:288
pu_contrib
contributions to p_u
Definition: data_structures.h:207
pu_out::contribs
int contribs
[-c "SHIME"]
Definition: data_structures.h:238
model.h
The model details data structure and its corresponding modifiers.
vrna_fc_s::auxdata
void * auxdata
A pointer to auxiliary, user-defined data.
Definition: data_structures.h:464
vrna_param_s
The datastructure that contains temperature scaled energy parameters.
Definition: params.h:50
vrna_fc_s::pscore_pf_compat
short * pscore_pf_compat
Precomputed array of pair types expressed as pairing scores indexed via iindx.
Definition: data_structures.h:553
interact::i
int i
k<i in longer seq
Definition: data_structures.h:225
vrna_fold_compound_add_auxdata
void vrna_fold_compound_add_auxdata(vrna_fold_compound_t *vc, void *data, vrna_callback_free_auxdata *f)
Add auxiliary data to the vrna_fold_compound_t.
snoopT
Data structure for RNAsnoop.
Definition: data_structures.h:297
pu_out::u_values
double ** u_values
(the -u values * [-c "SHIME"]) * seq len
Definition: data_structures.h:240
vrna_fc_s::cons_seq
char * cons_seq
The consensus sequence of the aligned sequences.
Definition: data_structures.h:533
vrna_fc_s::hc
vrna_hc_t * hc
The hard constraints data structure used for structure prediction.
Definition: data_structures.h:442
vrna_fc_s::ptype_pf_compat
char * ptype_pf_compat
ptype array indexed via iindx
Definition: data_structures.h:503
VRNA_VC_TYPE_SINGLE
Definition: data_structures.h:407
vrna_sect_s
Stack of partial structures for backtracking.
Definition: data_structures.h:183
vrna_cpair_s
this datastructure is used as input parameter in functions of PS_dot.c
Definition: data_structures.h:174
vrna_fc_s::jindx
int * jindx
DP matrix accessor.
Definition: data_structures.h:451
vrna_fold_compound_free
void vrna_fold_compound_free(vrna_fold_compound_t *vc)
Free memory occupied by a vrna_fold_compound_t.
vrna_fc_type_e
vrna_fc_type_e
An enumerator that is used to specify the type of a vrna_fold_compound_t.
Definition: data_structures.h:406
energy_const.h
vrna_fold_compound
vrna_fold_compound_t * vrna_fold_compound(const char *sequence, vrna_md_t *md_p, unsigned int options)
Retrieve a vrna_fold_compound_t data structure for single sequences and hybridizing sequences...
vrna_basepair_s
Base pair data structure used in subopt.c.
Definition: data_structures.h:156
vrna_md_s
The data structure that contains the complete model details used throughout the calculations.
Definition: model.h:188
vrna_sc_s
The soft constraints data structure.
Definition: constraints_soft.h:111
pu_contrib::w
int w
longest unpaired region
Definition: data_structures.h:213
pu_out
struct pu_out pu_out
Collection of all free_energy of beeing unpaired values for output.
vrna_fc_s::S5
short ** S5
S5[s][i] holds next base 5&#39; of i in sequence s.
Definition: data_structures.h:542
params.h
vrna_exp_param_s
The datastructure that contains temperature scaled Boltzmann weights of the energy parameters...
Definition: params.h:94
vrna_fc_s::scs
vrna_sc_t ** scs
A set of soft constraints (for each sequence in the alignment)
Definition: data_structures.h:557
vrna_callback_free_auxdata
void( vrna_callback_free_auxdata)(void *data)
Callback to free memory allocated for auxiliary user-provided data.
Definition: data_structures.h:51
interact::k
int k
k<i in longer seq
Definition: data_structures.h:226
vrna_hc_s
The hard constraints data structure.
Definition: constraints_hard.h:305
interact
interaction data structure for RNAup
Definition: data_structures.h:219
interact::Pi
double * Pi
probabilities of interaction
Definition: data_structures.h:220
oldAliEn
int oldAliEn
use old alifold energies (with gaps)
constrain
constraints for cofolding
Definition: data_structures.h:246
pu_contrib::I
double ** I
interior loops
Definition: data_structures.h:209
folden
struct node folden
Data structure for RNAsnoop (fold energy list)
pu_out::len
int len
sequence length
Definition: data_structures.h:236
vrna_callback_recursion_status
void( vrna_callback_recursion_status)(unsigned char status, void *data)
Callback to perform specific user-defined actions before, or after recursive computations.
Definition: data_structures.h:62
pu_contrib::length
int length
length of the input sequence
Definition: data_structures.h:212
pu_out::header
char ** header
header line
Definition: data_structures.h:239
vrna_plist_s
this datastructure is used as input parameter in functions of PS_dot.h and others ...
Definition: data_structures.h:164
vrna_fc_s::params
vrna_param_t * params
The precomputed free energy contributions for each type of loop.
Definition: data_structures.h:447
vrna_fc_s::pscore
int * pscore
Precomputed array of pair types expressed as pairing scores.
Definition: data_structures.h:550
vrna_fc_s::n_seq
unsigned int n_seq
The number of sequences in the alignment.
Definition: data_structures.h:530
vrna_fc_s::referenceBPs2
unsigned int * referenceBPs2
Matrix containing number of basepairs of reference structure2 in interval [i,j].
Definition: data_structures.h:582
interact::length
int length
length of longer sequence
Definition: data_structures.h:229
vrna_fc_s::sequence
char * sequence
The input sequence string.
Definition: data_structures.h:486
vrna_fc_s::matrices
vrna_mx_mfe_t * matrices
The MFE DP matrices.
Definition: data_structures.h:444
VRNA_VC_TYPE_ALIGNMENT
Definition: data_structures.h:408
interact
struct interact interact
interaction data structure for RNAup
vrna_fc_s::stat_cb
vrna_callback_recursion_status * stat_cb
Recursion status callback (usually called just before, and after recursive computations in the librar...
Definition: data_structures.h:459
vrna_fc_s::cutpoint
int cutpoint
The position of the (cofold) cutpoint within the provided sequence. If there is no cutpoint...
Definition: data_structures.h:438
vrna_fc_s::free_auxdata
vrna_callback_free_auxdata * free_auxdata
A callback to free auxiliary user data whenever the fold_compound itself is free&#39;d.
Definition: data_structures.h:468
pu_out
Collection of all free_energy of beeing unpaired values for output.
Definition: data_structures.h:235
interact::Gikjl
double Gikjl
full free energy for interaction between [k,i] k<i in longer seq and [j,l] j<l in shorter seq ...
Definition: data_structures.h:222
vrna_fc_s::length
unsigned int length
The length of the sequence (or sequence alignment)
Definition: data_structures.h:437
vrna_bp_stack_s
Base pair stack element.
Definition: data_structures.h:192
constraints.h
Functions and data structures for constraining secondary structure predictions and evaluation...
interact::Gi
double * Gi
free energies of interaction
Definition: data_structures.h:221
vrna_fc_s::reference_pt2
short * reference_pt2
A pairtable of the second reference structure.
Definition: data_structures.h:579
vrna_fc_s::maxD1
unsigned int maxD1
Maximum allowed base pair distance to first reference.
Definition: data_structures.h:576
vrna_fc_s::mm2
unsigned int * mm2
Maximum matching matrix, reference struct 2 disallowed.
Definition: data_structures.h:586
duplexT
Data structure for RNAduplex.
Definition: data_structures.h:260
vrna_fc_s::referenceBPs1
unsigned int * referenceBPs1
Matrix containing number of basepairs of reference structure1 in interval [i,j].
Definition: data_structures.h:581
vrna_fc_s::type
vrna_fc_type_e type
The type of the vrna_fold_compound_t.
Definition: data_structures.h:430
vrna_fc_s::window_size
int window_size
window size for local folding sliding window approach
Definition: data_structures.h:598
vrna_fc_s::ptype_local
char ** ptype_local
Pair type array (for local folding)
Definition: data_structures.h:599
interact::Gikjl_wo
double Gikjl_wo
Gikjl without contributions for prob_unpaired.
Definition: data_structures.h:224
vrna_fc_s::iindx
int * iindx
DP matrix accessor.
Definition: data_structures.h:450
pu_contrib::E
double ** E
exterior loop
Definition: data_structures.h:211
vrna_mx_pf_s
Partition function (PF) Dynamic Programming (DP) matrices data structure required within the vrna_fol...
Definition: dp_matrices.h:197
vrna_fc_s::maxD2
unsigned int maxD2
Maximum allowed base pair distance to second reference.
Definition: data_structures.h:577
vrna_fc_s::exp_matrices
vrna_mx_pf_t * exp_matrices
The PF DP matrices.
Definition: data_structures.h:445