RNAlib-2.6.2
 
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
31
64typedef int (*vrna_sc_f)(int i,
65 int j,
66 int k,
67 int l,
68 unsigned char d,
69 void *data);
70
71DEPRECATED(typedef int (vrna_callback_sc_energy)(int i,
72 int j,
73 int k,
74 int l,
75 unsigned char d,
76 void *data),
77 "Use vrna_sc_f instead!");
78
79
80typedef int (*vrna_sc_direct_f)(vrna_fold_compound_t *fc,
81 int i,
82 int j,
83 int k,
84 int l,
85 void *data);
86
119typedef FLT_OR_DBL (*vrna_sc_exp_f)(int i,
120 int j,
121 int k,
122 int l,
123 unsigned char d,
124 void *data);
125
126DEPRECATED(typedef FLT_OR_DBL (vrna_callback_sc_exp_energy)(int i,
127 int j,
128 int k,
129 int l,
130 unsigned char d,
131 void *data),
132 "Use vrna_sc_exp_f instead!");
133
134
135typedef FLT_OR_DBL (*vrna_sc_exp_direct_f)(vrna_fold_compound_t *fc,
136 int i,
137 int j,
138 int k,
139 int l,
140 void *data);
141
142
169typedef vrna_basepair_t *(*vrna_sc_bt_f)(int i,
170 int j,
171 int k,
172 int l,
173 unsigned char d,
174 void *data);
175
176DEPRECATED(typedef vrna_basepair_t *(vrna_callback_sc_backtrack)(int i,
177 int j,
178 int k,
179 int l,
180 unsigned char d,
181 void *data),
182 "Use vrna_sc_bt_f instead");
183
184
188typedef enum {
195
196
200typedef struct {
201 unsigned int interval_start;
202 unsigned int interval_end;
203 int e;
205
206
212struct vrna_sc_s {
213 const vrna_sc_type_e type;
214 unsigned int n;
215
216 unsigned char state;
217
218 int **energy_up;
224#ifndef VRNA_DISABLE_C11_FEATURES
225 /* C11 support for unnamed unions/structs */
226 union {
227 struct {
228#endif
231#ifndef VRNA_DISABLE_C11_FEATURES
232 /* C11 support for unnamed unions/structs */
233};
234struct {
235#endif
238#ifndef VRNA_DISABLE_C11_FEATURES
239 /* C11 support for unnamed unions/structs */
240};
241};
242#endif
243
247 /* generic soft contraints below */
265 void *data;
270 vrna_auxdata_prepare_f prepare_data;
271 vrna_auxdata_free_f free_data;
272};
273
291void
293
294
295int
296vrna_sc_prepare(vrna_fold_compound_t *fc,
297 unsigned int options);
298
299
300int
301vrna_sc_update(vrna_fold_compound_t *fc,
302 unsigned int i,
303 unsigned int options);
304
305
321int
323 const FLT_OR_DBL **constraints,
324 unsigned int options);
325
326
341int
343 int i,
344 int j,
345 FLT_OR_DBL energy,
346 unsigned int options);
347
348
364int
366 const FLT_OR_DBL *constraints,
367 unsigned int options);
368
369
383int
385 int i,
386 FLT_OR_DBL energy,
387 unsigned int options);
388
389
390int
391vrna_sc_set_stack(vrna_fold_compound_t *fc,
392 const FLT_OR_DBL *constraints,
393 unsigned int options);
394
395
396int
397vrna_sc_set_stack_comparative(vrna_fold_compound_t *fc,
398 const FLT_OR_DBL **constraints,
399 unsigned int options);
400
401
402int
403vrna_sc_add_stack(vrna_fold_compound_t *fc,
404 int i,
405 FLT_OR_DBL energy,
406 unsigned int options);
407
408
409int
410vrna_sc_add_stack_comparative(vrna_fold_compound_t *fc,
411 int i,
412 const FLT_OR_DBL *energies,
413 unsigned int options);
414
415
425void
427
428
436void
438
439
452int
454 void *data,
455 vrna_auxdata_free_f free_data);
456
457
458int
459vrna_sc_add_auxdata(vrna_fold_compound_t *fc,
460 void *data,
461 vrna_auxdata_prepare_f prepare_cb,
462 vrna_auxdata_free_f free_cb);
463
464
465int
466vrna_sc_add_data_comparative(vrna_fold_compound_t *fc,
467 void **data,
468 vrna_auxdata_free_f *free_data);
469
470
487int
489 vrna_sc_f f);
490
491
492size_t
493vrna_sc_multi_cb_add(vrna_fold_compound_t *fc,
494 vrna_sc_direct_f cb,
495 vrna_sc_exp_direct_f cb_exp,
496 void *data,
497 vrna_auxdata_prepare_f prepare_cb,
498 vrna_auxdata_free_f free_cb,
499 unsigned int decomp_type);
500
501
502int
503vrna_sc_add_f_comparative(vrna_fold_compound_t *fc,
504 vrna_sc_f *f);
505
506
525int
527 vrna_sc_bt_f f);
528
529
547int
549 vrna_sc_exp_f exp_f);
550
551
552int
553vrna_sc_add_exp_f_comparative(vrna_fold_compound_t *fc,
554 vrna_sc_exp_f *exp_f);
555
556
557#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:248
int * up_storage
Storage container for energy contributions per unpaired nucleotide.
Definition soft.h:221
vrna_sc_exp_f exp_f
A function pointer used for pseudo energy contribution boltzmann factors in PF calculations.
Definition soft.h:259
FLT_OR_DBL * exp_energy_stack
Boltzmann weighted pseudo energy contribution per nucleotide involved in a stack.
Definition soft.h:245
int ** energy_up
Energy contribution for stretches of unpaired nucleotides.
Definition soft.h:218
FLT_OR_DBL * exp_energy_bp
Boltzmann Factors of the energy contribution for base pairs.
Definition soft.h:230
FLT_OR_DBL ** exp_energy_bp_local
Boltzmann Factors of the energy contribution for base pairs (sliding window approach)
Definition soft.h:237
void * data
A pointer to the data object provided for for pseudo energy contribution functions of the generic sof...
Definition soft.h:265
vrna_sc_bp_storage_t ** bp_storage
Storage container for energy contributions per base pair.
Definition soft.h:222
int * energy_stack
Pseudo Energy contribution per base pair involved in a stack.
Definition soft.h:244
int * energy_bp
Energy contribution for base pairs.
Definition soft.h:229
FLT_OR_DBL ** exp_energy_up
Boltzmann Factors of the energy contributions for unpaired sequence stretches.
Definition soft.h:219
int ** energy_bp_local
Energy contribution for base pairs (sliding window approach)
Definition soft.h:236
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:253
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:119
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:169
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:64
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:212
vrna_sc_type_e
The type of a soft constraint.
Definition soft.h:188
@ VRNA_SC_DEFAULT
Default Soft Constraints.
Definition soft.h:189
@ VRNA_SC_WINDOW
Soft Constraints suitable for local structure prediction using window approach.
Definition soft.h:190
A base pair constraint.
Definition soft.h:200