RNAlib-2.6.3
 
Loading...
Searching...
No Matches
soft.h
Go to the documentation of this file.
1#ifndef VIENNA_RNA_PACKAGE_CONSTRAINTS_SOFT_H
2#define VIENNA_RNA_PACKAGE_CONSTRAINTS_SOFT_H
3
26typedef struct vrna_sc_s vrna_sc_t;
27
28#include <stdlib.h>
29
33
66typedef int (*vrna_sc_f)(int i,
67 int j,
68 int k,
69 int l,
70 unsigned char d,
71 void *data);
72
73DEPRECATED(typedef int (vrna_callback_sc_energy)(int i,
74 int j,
75 int k,
76 int l,
77 unsigned char d,
78 void *data),
79 "Use vrna_sc_f instead!");
80
81
82typedef int (*vrna_sc_direct_f)(vrna_fold_compound_t *fc,
83 int i,
84 int j,
85 int k,
86 int l,
87 void *data);
88
121typedef FLT_OR_DBL (*vrna_sc_exp_f)(int i,
122 int j,
123 int k,
124 int l,
125 unsigned char d,
126 void *data);
127
128DEPRECATED(typedef FLT_OR_DBL (vrna_callback_sc_exp_energy)(int i,
129 int j,
130 int k,
131 int l,
132 unsigned char d,
133 void *data),
134 "Use vrna_sc_exp_f instead!");
135
136
137typedef FLT_OR_DBL (*vrna_sc_exp_direct_f)(vrna_fold_compound_t *fc,
138 int i,
139 int j,
140 int k,
141 int l,
142 void *data);
143
144
171typedef vrna_basepair_t *(*vrna_sc_bt_f)(int i,
172 int j,
173 int k,
174 int l,
175 unsigned char d,
176 void *data);
177
178DEPRECATED(typedef vrna_basepair_t *(vrna_callback_sc_backtrack)(int i,
179 int j,
180 int k,
181 int l,
182 unsigned char d,
183 void *data),
184 "Use vrna_sc_bt_f instead");
185
186
190typedef enum {
197
198
202typedef struct {
203 unsigned int interval_start;
204 unsigned int interval_end;
205 int e;
207
208
214struct vrna_sc_s {
215 const vrna_sc_type_e type;
216 unsigned int n;
217
218 unsigned char state;
219
220 int **energy_up;
226#ifndef VRNA_DISABLE_C11_FEATURES
227 /* C11 support for unnamed unions/structs */
228 union {
229 struct {
230#endif
233#ifndef VRNA_DISABLE_C11_FEATURES
234 /* C11 support for unnamed unions/structs */
235};
236struct {
237#endif
240#ifndef VRNA_DISABLE_C11_FEATURES
241 /* C11 support for unnamed unions/structs */
242};
243};
244#endif
245
249 /* generic soft contraints below */
267 void *data;
272 vrna_auxdata_prepare_f prepare_data;
273 vrna_auxdata_free_f free_data;
274};
275
293void
295
296
297int
298vrna_sc_prepare(vrna_fold_compound_t *fc,
299 unsigned int options);
300
301
302int
303vrna_sc_update(vrna_fold_compound_t *fc,
304 unsigned int i,
305 unsigned int options);
306
307
323int
325 const FLT_OR_DBL **constraints,
326 unsigned int options);
327
328
343int
345 int i,
346 int j,
347 FLT_OR_DBL energy,
348 unsigned int options);
349
350
366int
368 const FLT_OR_DBL *constraints,
369 unsigned int options);
370
371
385int
387 int i,
388 FLT_OR_DBL energy,
389 unsigned int options);
390
391
392int
393vrna_sc_set_stack(vrna_fold_compound_t *fc,
394 const FLT_OR_DBL *constraints,
395 unsigned int options);
396
397
398int
399vrna_sc_set_stack_comparative(vrna_fold_compound_t *fc,
400 const FLT_OR_DBL **constraints,
401 unsigned int options);
402
403
404int
405vrna_sc_add_stack(vrna_fold_compound_t *fc,
406 int i,
407 FLT_OR_DBL energy,
408 unsigned int options);
409
410
411int
412vrna_sc_add_stack_comparative(vrna_fold_compound_t *fc,
413 int i,
414 const FLT_OR_DBL *energies,
415 unsigned int options);
416
417
427void
429
430
438void
440
441
454int
456 void *data,
457 vrna_auxdata_free_f free_data);
458
459
460int
461vrna_sc_add_auxdata(vrna_fold_compound_t *fc,
462 void *data,
463 vrna_auxdata_prepare_f prepare_cb,
464 vrna_auxdata_free_f free_cb);
465
466
467int
468vrna_sc_add_data_comparative(vrna_fold_compound_t *fc,
469 void **data,
470 vrna_auxdata_free_f *free_data);
471
472
489int
491 vrna_sc_f f);
492
493
494size_t
495vrna_sc_multi_cb_add(vrna_fold_compound_t *fc,
496 vrna_sc_direct_f cb,
497 vrna_sc_exp_direct_f cb_exp,
498 void *data,
499 vrna_auxdata_prepare_f prepare_cb,
500 vrna_auxdata_free_f free_cb,
501 unsigned int decomp_type);
502
503
504int
505vrna_sc_add_f_comparative(vrna_fold_compound_t *fc,
506 vrna_sc_f *f);
507
508
527int
529 vrna_sc_bt_f f);
530
531
549int
551 vrna_sc_exp_f exp_f);
552
553
554int
555vrna_sc_add_exp_f_comparative(vrna_fold_compound_t *fc,
556 vrna_sc_exp_f *exp_f);
557
558
559#endif
Functions and data structures for constraining secondary structure predictions and evaluation.
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 data structure used in subopt.c.
Definition basic.h:104
void(* vrna_auxdata_free_f)(void *data)
Callback to free memory allocated for auxiliary user-provided data.
Definition fold_compound.h:58
The most basic data structure required by many functions throughout the RNAlib.
Definition fold_compound.h:168
vrna_sc_f f
A function pointer used for pseudo energy contribution in MFE calculations.
Definition soft.h:250
int * up_storage
Storage container for energy contributions per unpaired nucleotide.
Definition soft.h:223
vrna_sc_exp_f exp_f
A function pointer used for pseudo energy contribution boltzmann factors in PF calculations.
Definition soft.h:261
FLT_OR_DBL * exp_energy_stack
Boltzmann weighted pseudo energy contribution per nucleotide involved in a stack.
Definition soft.h:247
int ** energy_up
Energy contribution for stretches of unpaired nucleotides.
Definition soft.h:220
FLT_OR_DBL * exp_energy_bp
Boltzmann Factors of the energy contribution for base pairs.
Definition soft.h:232
FLT_OR_DBL ** exp_energy_bp_local
Boltzmann Factors of the energy contribution for base pairs (sliding window approach)
Definition soft.h:239
void * data
A pointer to the data object provided for for pseudo energy contribution functions of the generic sof...
Definition soft.h:267
vrna_sc_bp_storage_t ** bp_storage
Storage container for energy contributions per base pair.
Definition soft.h:224
int * energy_stack
Pseudo Energy contribution per base pair involved in a stack.
Definition soft.h:246
int * energy_bp
Energy contribution for base pairs.
Definition soft.h:231
FLT_OR_DBL ** exp_energy_up
Boltzmann Factors of the energy contributions for unpaired sequence stretches.
Definition soft.h:221
int ** energy_bp_local
Energy contribution for base pairs (sliding window approach)
Definition soft.h:238
vrna_sc_bt_f bt
A function pointer used to obtain backtraced base pairs in loop regions that were altered by soft con...
Definition soft.h:255
int vrna_sc_add_data(vrna_fold_compound_t *fc, void *data, vrna_auxdata_free_f free_data)
Add an auxiliary data structure for the generic soft constraints callback function.
int vrna_sc_add_exp_f(vrna_fold_compound_t *fc, vrna_sc_exp_f exp_f)
Bind a function pointer for generic soft constraint feature (PF version)
int vrna_sc_add_f(vrna_fold_compound_t *fc, vrna_sc_f f)
Bind a function pointer for generic soft constraint feature (MFE version)
FLT_OR_DBL(* vrna_sc_exp_f)(int i, int j, int k, int l, unsigned char d, void *data)
Callback to retrieve pseudo energy contribution as Boltzmann Factors for soft constraint feature.
Definition soft.h:121
int vrna_sc_set_bp(vrna_fold_compound_t *fc, const FLT_OR_DBL **constraints, unsigned int options)
Set soft constraints for paired nucleotides.
void vrna_sc_free(vrna_sc_t *sc)
Free memory occupied by a vrna_sc_t data structure.
vrna_basepair_t *(* vrna_sc_bt_f)(int i, int j, int k, int l, unsigned char d, void *data)
Callback to retrieve auxiliary base pairs for soft constraint feature.
Definition soft.h:171
int vrna_sc_add_bt(vrna_fold_compound_t *fc, vrna_sc_bt_f f)
Bind a backtracking function pointer for generic soft constraint feature.
void vrna_sc_init(vrna_fold_compound_t *fc)
Initialize an empty soft constraints data structure within a vrna_fold_compound_t.
void vrna_sc_remove(vrna_fold_compound_t *fc)
Remove soft constraints from vrna_fold_compound_t.
int vrna_sc_add_bp(vrna_fold_compound_t *fc, int i, int j, FLT_OR_DBL energy, unsigned int options)
Add soft constraints for paired nucleotides.
int(* vrna_sc_f)(int i, int j, int k, int l, unsigned char d, void *data)
Callback to retrieve pseudo energy contribution for soft constraint feature.
Definition soft.h:66
int vrna_sc_set_up(vrna_fold_compound_t *fc, const FLT_OR_DBL *constraints, unsigned int options)
Set soft constraints for unpaired nucleotides.
int vrna_sc_add_up(vrna_fold_compound_t *fc, int i, FLT_OR_DBL energy, unsigned int options)
Add soft constraints for unpaired nucleotides.
The soft constraints data structure.
Definition soft.h:214
vrna_sc_type_e
The type of a soft constraint.
Definition soft.h:190
@ VRNA_SC_DEFAULT
Default Soft Constraints.
Definition soft.h:191
@ VRNA_SC_WINDOW
Soft Constraints suitable for local structure prediction using window approach.
Definition soft.h:192
A base pair constraint.
Definition soft.h:202