RNAlib-2.4.11
basic.h
Go to the documentation of this file.
1 #ifndef VIENNA_RNA_PACKAGE_PARAMS_H
2 #define VIENNA_RNA_PACKAGE_PARAMS_H
3 
4 #ifdef VRNA_WARN_DEPRECATED
5 # if defined(__clang__)
6 # define DEPRECATED(func, msg) func __attribute__ ((deprecated("", msg)))
7 # elif defined(__GNUC__)
8 # define DEPRECATED(func, msg) func __attribute__ ((deprecated(msg)))
9 # else
10 # define DEPRECATED(func, msg) func
11 # endif
12 #else
13 # define DEPRECATED(func, msg) func
14 #endif
15 
36 typedef struct vrna_param_s vrna_param_t;
39 
42 #include <ViennaRNA/model.h>
43 
44 #define VRNA_GQUAD_MAX_STACK_SIZE 7
45 #define VRNA_GQUAD_MIN_STACK_SIZE 2
46 #define VRNA_GQUAD_MAX_LINKER_LENGTH 15
47 #define VRNA_GQUAD_MIN_LINKER_LENGTH 1
48 #define VRNA_GQUAD_MIN_BOX_SIZE ((4 * VRNA_GQUAD_MIN_STACK_SIZE) + \
49  (3 * VRNA_GQUAD_MIN_LINKER_LENGTH))
50 #define VRNA_GQUAD_MAX_BOX_SIZE ((4 * VRNA_GQUAD_MAX_STACK_SIZE) + \
51  (3 * VRNA_GQUAD_MAX_LINKER_LENGTH))
52 
56 struct vrna_param_s {
57  int id;
58  int stack[NBPAIRS + 1][NBPAIRS + 1];
59  int hairpin[31];
60  int bulge[MAXLOOP + 1];
61  int internal_loop[MAXLOOP + 1];
62  int mismatchExt[NBPAIRS + 1][5][5];
63  int mismatchI[NBPAIRS + 1][5][5];
64  int mismatch1nI[NBPAIRS + 1][5][5];
65  int mismatch23I[NBPAIRS + 1][5][5];
66  int mismatchH[NBPAIRS + 1][5][5];
67  int mismatchM[NBPAIRS + 1][5][5];
68  int dangle5[NBPAIRS + 1][5];
69  int dangle3[NBPAIRS + 1][5];
70  int int11[NBPAIRS + 1][NBPAIRS + 1][5][5];
71  int int21[NBPAIRS + 1][NBPAIRS + 1][5][5][5];
72  int int22[NBPAIRS + 1][NBPAIRS + 1][5][5][5][5];
73  int ninio[5];
74  double lxc;
75  int MLbase;
76  int MLintern[NBPAIRS + 1];
77  int MLclosing;
78  int TerminalAU;
79  int DuplexInit;
80  int Tetraloop_E[200];
81  char Tetraloops[1401];
82  int Triloop_E[40];
83  char Triloops[241];
84  int Hexaloop_E[40];
85  char Hexaloops[1801];
86  int TripleC;
87  int MultipleCA;
88  int MultipleCB;
89  int gquad[VRNA_GQUAD_MAX_STACK_SIZE + 1][3 * VRNA_GQUAD_MAX_LINKER_LENGTH + 1];
90  int gquadLayerMismatch;
91  int gquadLayerMismatchMax;
92 
93  double temperature;
96  char param_file[256];
97 };
98 
103  int id;
106  double expstack[NBPAIRS + 1][NBPAIRS + 1];
107  double exphairpin[31];
108  double expbulge[MAXLOOP + 1];
109  double expinternal[MAXLOOP + 1];
110  double expmismatchExt[NBPAIRS + 1][5][5];
111  double expmismatchI[NBPAIRS + 1][5][5];
112  double expmismatch23I[NBPAIRS + 1][5][5];
113  double expmismatch1nI[NBPAIRS + 1][5][5];
114  double expmismatchH[NBPAIRS + 1][5][5];
115  double expmismatchM[NBPAIRS + 1][5][5];
116  double expdangle5[NBPAIRS + 1][5];
117  double expdangle3[NBPAIRS + 1][5];
118  double expint11[NBPAIRS + 1][NBPAIRS + 1][5][5];
119  double expint21[NBPAIRS + 1][NBPAIRS + 1][5][5][5];
120  double expint22[NBPAIRS + 1][NBPAIRS + 1][5][5][5][5];
121  double expninio[5][MAXLOOP + 1];
122  double lxc;
123  double expMLbase;
124  double expMLintern[NBPAIRS + 1];
125  double expMLclosing;
126  double expTermAU;
127  double expDuplexInit;
128  double exptetra[40];
129  double exptri[40];
130  double exphex[40];
131  char Tetraloops[1401];
132  double expTriloop[40];
133  char Triloops[241];
134  char Hexaloops[1801];
135  double expTripleC;
136  double expMultipleCA;
137  double expMultipleCB;
138  double expgquad[VRNA_GQUAD_MAX_STACK_SIZE + 1][3 * VRNA_GQUAD_MAX_LINKER_LENGTH + 1];
139  double expgquadLayerMismatch;
140  int gquadLayerMismatchMax;
141 
142  double kT;
143  double pf_scale;
145  double temperature;
146  double alpha;
154  char param_file[256];
155 };
156 
157 
169 vrna_param_t *
171 
172 
184 vrna_param_t *
186 
187 
212 
213 
228 vrna_exp_params_comparative(unsigned int n_seq,
229  vrna_md_t *md);
230 
231 
245 
246 
259 void
261  vrna_param_t *par);
262 
263 
281 void
283  vrna_exp_param_t *params);
284 
285 
323 void
325  double *mfe);
326 
327 
342  vrna_md_t *md_p);
343 
344 
360  vrna_md_t *md_p);
361 
362 
363 void vrna_params_prepare(vrna_fold_compound_t *vc,
364  unsigned int options);
365 
366 
367 #ifndef VRNA_DISABLE_BACKWARD_COMPATIBILITY
368 
373 typedef struct vrna_param_s paramT;
374 
380 
381 DEPRECATED(vrna_param_t *get_parameter_copy(vrna_param_t *par),
382 "Use vrna_params_copy() instead");
383 
394 "Use vrna_params() instead");
395 
422  double betaScale,
423  vrna_md_t md,
424  double pf_scale),
425 "Use vrna_exp_params() instead");
426 
438 "Use vrna_exp_params_copy() instead");
439 
447 DEPRECATED(vrna_exp_param_t *get_scaled_alipf_parameters(unsigned int n_seq),
448 "Use vrna_exp_params_comparative() instead");
449 
458 DEPRECATED(vrna_exp_param_t *get_boltzmann_factors_ali(unsigned int n_seq,
459  double temperature,
460  double betaScale,
461  vrna_md_t md,
462  double pf_scale),
463 "Use vrna_exp_params_comparative() instead");
464 
476 DEPRECATED(vrna_param_t *scale_parameters(void),
477 "Use vrna_params() instead");
478 
496  vrna_md_t md),
497 "Usee vrna_params() instead");
498 
499 DEPRECATED(vrna_param_t *copy_parameters(void), "Use vrna_params_copy() instead");
500 DEPRECATED(vrna_param_t *set_parameters(vrna_param_t *dest), "Use vrna_params_copy() instead");
501 DEPRECATED(vrna_exp_param_t *scale_pf_parameters(void), "Use vrna_exp_params() instead");
502 DEPRECATED(vrna_exp_param_t *copy_pf_param(void), "Use vrna_exp_params_copy() instead");
503 DEPRECATED(vrna_exp_param_t *set_pf_param(vrna_param_t *dest), "Use vrna_exp_params_copy() instead");
504 
505 #endif
506 
512 #endif
vrna_param_t * vrna_params(vrna_md_t *md)
Get a data structure containing prescaled free energy parameters.
vrna_param_t * get_scaled_parameters(double temperature, vrna_md_t md)
Get precomputed energy contributions for all the known loop types.
vrna_md_t model_details
Model details to be used in the recursions.
Definition: basic.h:95
#define NBPAIRS
Definition: constants.h:25
double pf_scale
Scaling factor to avoid over-/underflows.
Definition: basic.h:143
Energy parameter constants.
vrna_md_t model_details
Model details to be used in the recursions.
Definition: basic.h:153
The most basic data structure required by many functions throughout the RNAlib.
Definition: fold_compound.h:132
double temperature
Temperature used for loop contribution scaling.
Definition: basic.h:145
vrna_exp_param_t * get_scaled_alipf_parameters(unsigned int n_seq)
Get precomputed Boltzmann factors of the loop type dependent energy contributions (alifold variant) ...
The model details data structure and its corresponding modifiers.
The datastructure that contains temperature scaled energy parameters.
Definition: basic.h:56
vrna_exp_param_t * vrna_exp_params_copy(vrna_exp_param_t *par)
Get a copy of the provided free energy parameters (provided as Boltzmann factors) ...
void vrna_exp_params_subst(vrna_fold_compound_t *vc, vrna_exp_param_t *params)
Update the energy parameters for subsequent partition function computations.
#define MAXLOOP
Definition: constants.h:29
char param_file[256]
The filename the parameters were derived from, or empty string if they represent the default...
Definition: basic.h:96
vrna_param_t * vrna_params_copy(vrna_param_t *par)
Get a copy of the provided free energy parameters.
Various data structures and pre-processor macros.
void vrna_exp_params_rescale(vrna_fold_compound_t *vc, double *mfe)
Rescale Boltzmann factors for partition function computations.
The data structure that contains the complete model details used throughout the calculations.
Definition: model.h:177
double alpha
Scaling factor for the thermodynamic temperature.
Definition: basic.h:146
The data structure that contains temperature scaled Boltzmann weights of the energy parameters...
Definition: basic.h:102
double pf_scale
A scaling factor used by pf_fold() to avoid overflows.
vrna_exp_param_t * get_scaled_pf_parameters(void)
double temperature
Temperature used for loop contribution scaling.
Definition: basic.h:93
vrna_exp_param_t * vrna_exp_params_comparative(unsigned int n_seq, vrna_md_t *md)
Get a data structure containing prescaled free energy parameters already transformed to Boltzmann fac...
void vrna_exp_params_reset(vrna_fold_compound_t *vc, vrna_md_t *md_p)
Reset Boltzmann factors for partition function computations within a vrna_fold_compound_t according t...
vrna_exp_param_t * get_boltzmann_factor_copy(vrna_exp_param_t *parameters)
Get a copy of already precomputed Boltzmann factors.
vrna_exp_param_t * get_boltzmann_factors_ali(unsigned int n_seq, double temperature, double betaScale, vrna_md_t md, double pf_scale)
Get precomputed Boltzmann factors of the loop type dependent energy contributions (alifold variant) w...
vrna_exp_param_t * get_boltzmann_factors(double temperature, double betaScale, vrna_md_t md, double pf_scale)
Get precomputed Boltzmann factors of the loop type dependent energy contributions with independent th...
void vrna_params_reset(vrna_fold_compound_t *vc, vrna_md_t *md_p)
Reset free energy parameters within a vrna_fold_compound_t according to provided, or default model de...
int id
An identifier for the data structure.
Definition: basic.h:103
vrna_exp_param_t * vrna_exp_params(vrna_md_t *md)
Get a data structure containing prescaled free energy parameters already transformed to Boltzmann fac...
vrna_param_t * scale_parameters(void)
Get precomputed energy contributions for all the known loop types.
void vrna_params_subst(vrna_fold_compound_t *vc, vrna_param_t *par)
Update/Reset energy parameters data structure within a vrna_fold_compound_t.