1#ifndef VIENNA_RNA_PACKAGE_LOOPS_HAIRPIN_H
2#define VIENNA_RNA_PACKAGE_LOOPS_HAIRPIN_H
12#ifdef VRNA_WARN_DEPRECATED
13# if defined(DEPRECATED)
16# if defined(__clang__)
17# define DEPRECATED(func, msg) func __attribute__ ((deprecated("", msg)))
18# elif defined(__GNUC__)
19# define DEPRECATED(func, msg) func __attribute__ ((deprecated(msg)))
21# define DEPRECATED(func, msg) func
24# define DEPRECATED(func, msg) func
159 int energy, salt_correction;
165 salt_correction = P->SaltLoop[size+1];
171 energy = P->hairpin[size];
173 energy = P->hairpin[30] + (int)(P->lxc * log((size) / 30.));
175 energy += salt_correction;
186 memcpy(tl,
string,
sizeof(
char) * 6);
188 if ((ts = strstr(P->Tetraloops, tl)))
189 return P->Tetraloop_E[(ts - P->Tetraloops) / 7] + salt_correction;
190 }
else if (size == 6) {
194 memcpy(tl,
string,
sizeof(
char) * 8);
196 if ((ts = strstr(P->Hexaloops, tl)))
197 return P->Hexaloop_E[(ts - P->Hexaloops) / 9] + salt_correction;
198 }
else if (size == 3) {
202 memcpy(tl,
string,
sizeof(
char) * 5);
204 if ((ts = strstr(P->Triloops, tl)))
205 return P->Triloop_E[(ts - P->Triloops) / 6] + salt_correction;
207 return energy + (type > 2 ? P->TerminalAU : 0);
211 energy += P->mismatchH[type][si1][sj1];
253 double q, kT, salt_correction;
256 salt_correction = 1.;
260 salt_correction = P->expSaltLoop[u+1];
266 q = P->exphairpin[u];
268 q = P->exphairpin[30] * exp(-(P->lxc * log(u / 30.)) * 10. / kT);
270 q *= salt_correction;
280 memcpy(tl,
string,
sizeof(
char) * 6);
282 if ((ts = strstr(P->Tetraloops, tl))) {
284 return (
FLT_OR_DBL)(P->exptetra[(ts - P->Tetraloops) / 7] * salt_correction);
286 q *= P->exptetra[(ts - P->Tetraloops) / 7];
292 memcpy(tl,
string,
sizeof(
char) * 8);
294 if ((ts = strstr(P->Hexaloops, tl)))
295 return (
FLT_OR_DBL)(P->exphex[(ts - P->Hexaloops) / 9] * salt_correction);
300 memcpy(tl,
string,
sizeof(
char) * 5);
302 if ((ts = strstr(P->Triloops, tl)))
303 return (
FLT_OR_DBL)(P->exptri[(ts - P->Triloops) / 6] * salt_correction);
312 q *= P->expmismatchH[type][si1][sj1];
367#ifndef VRNA_DISABLE_BACKWARD_COMPATIBILITY
#define MAXLOOP
Definition constants.h:29
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
Base pair stack element.
Definition basic.h:143
double temperature
Temperature used for loop contribution scaling.
Definition basic.h:153
vrna_md_t model_details
Model details to be used in the recursions.
Definition basic.h:96
vrna_md_t model_details
Model details to be used in the recursions.
Definition basic.h:161
double temperature
Temperature used for loop contribution scaling.
Definition basic.h:94
int vrna_salt_loop_int(int L, double salt, double T, double backbonelen)
Get salt correction for a loop at a given salt concentration and temperature.
The data structure that contains temperature scaled Boltzmann weights of the energy parameters.
Definition basic.h:110
The datastructure that contains temperature scaled energy parameters.
Definition basic.h:57
PRIVATE FLT_OR_DBL exp_E_Hairpin(int u, int type, short si1, short sj1, const char *string, vrna_exp_param_t *P)
Compute Boltzmann weight of a hairpin loop.
Definition hairpin.h:246
int vrna_E_hp_loop(vrna_fold_compound_t *fc, int i, int j)
Evaluate the free energy of a hairpin loop and consider hard constraints if they apply.
int vrna_E_ext_hp_loop(vrna_fold_compound_t *fc, int i, int j)
Evaluate the free energy of an exterior hairpin loop and consider possible hard constraints.
int vrna_eval_hp_loop(vrna_fold_compound_t *fc, int i, int j)
Evaluate free energy of a hairpin loop.
FLT_OR_DBL vrna_exp_E_hp_loop(vrna_fold_compound_t *fc, int i, int j)
High-Level function for hairpin loop energy evaluation (partition function variant)
PRIVATE int E_Hairpin(int size, int type, int si1, int sj1, const char *string, vrna_param_t *P)
Compute the Energy of a hairpin-loop.
Definition hairpin.h:152
int vrna_eval_ext_hp_loop(vrna_fold_compound_t *fc, int i, int j)
Evaluate free energy of an exterior hairpin loop.
The most basic data structure required by many functions throughout the RNAlib.
Definition fold_compound.h:168
int vrna_BT_hp_loop(vrna_fold_compound_t *fc, int i, int j, int en, vrna_bp_stack_t *bp_stack, int *stack_count)
Backtrack a hairpin loop closed by .
float backbone_length
Definition model.h:312
double salt
Salt (monovalent) concentration (M) in buffer.
Definition model.h:303
int special_hp
Include special hairpin contributions for tri, tetra and hexaloops.
Definition model.h:273
#define VRNA_MODEL_DEFAULT_SALT
Default model salt concentration (M)
Definition model.h:182
Functions to deal with sets of energy parameters.
Functions to compute salt correction.
General utility- and helper-functions used throughout the ViennaRNA Package.