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
157 int energy, salt_correction;
163 salt_correction = P->SaltLoop[size+1];
169 energy = P->hairpin[size];
171 energy = P->hairpin[30] + (int)(P->lxc * log((size) / 30.));
173 energy += salt_correction;
184 memcpy(tl,
string,
sizeof(
char) * 6);
186 if ((ts = strstr(P->Tetraloops, tl)))
187 return P->Tetraloop_E[(ts - P->Tetraloops) / 7] + salt_correction;
188 }
else if (size == 6) {
192 memcpy(tl,
string,
sizeof(
char) * 8);
194 if ((ts = strstr(P->Hexaloops, tl)))
195 return P->Hexaloop_E[(ts - P->Hexaloops) / 9] + salt_correction;
196 }
else if (size == 3) {
200 memcpy(tl,
string,
sizeof(
char) * 5);
202 if ((ts = strstr(P->Triloops, tl)))
203 return P->Triloop_E[(ts - P->Triloops) / 6] + salt_correction;
205 return energy + (type > 2 ? P->TerminalAU : 0);
209 energy += P->mismatchH[type][si1][sj1];
251 double q, kT, salt_correction;
254 salt_correction = 1.;
258 salt_correction = P->expSaltLoop[u+1];
264 q = P->exphairpin[u];
266 q = P->exphairpin[30] * exp(-(P->lxc * log(u / 30.)) * 10. / kT);
268 q *= salt_correction;
278 memcpy(tl,
string,
sizeof(
char) * 6);
280 if ((ts = strstr(P->Tetraloops, tl))) {
282 return (
FLT_OR_DBL)(P->exptetra[(ts - P->Tetraloops) / 7] * salt_correction);
284 q *= P->exptetra[(ts - P->Tetraloops) / 7];
290 memcpy(tl,
string,
sizeof(
char) * 8);
292 if ((ts = strstr(P->Hexaloops, tl)))
293 return (
FLT_OR_DBL)(P->exphex[(ts - P->Hexaloops) / 9] * salt_correction);
298 memcpy(tl,
string,
sizeof(
char) * 5);
300 if ((ts = strstr(P->Triloops, tl)))
301 return (
FLT_OR_DBL)(P->exptri[(ts - P->Triloops) / 6] * salt_correction);
310 q *= P->expmismatchH[type][si1][sj1];
365#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)
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:244
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:150
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:156
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 .
double salt
Salt (monovalent) concentration (M) in buffer.
Definition: model.h:260
int special_hp
Include special hairpin contributions for tri, tetra and hexaloops.
Definition: model.h:231
#define VRNA_MODEL_DEFAULT_SALT
Default model salt concentration (M)
Definition: model.h:162
Functions to deal with sets of energy parameters.
Functions to compute salt correction.
General utility- and helper-functions used throughout the ViennaRNA Package.