RNAlib-2.6.1
 
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
168typedef vrna_basepair_t *(*vrna_sc_bt_f)(int i,
169 int j,
170 int k,
171 int l,
172 unsigned char d,
173 void *data);
174
175DEPRECATED(typedef vrna_basepair_t *(vrna_callback_sc_backtrack)(int i,
176 int j,
177 int k,
178 int l,
179 unsigned char d,
180 void *data),
181 "Use vrna_sc_bt_f instead");
182
183
187typedef enum {
194
195
199typedef struct {
200 unsigned int interval_start;
201 unsigned int interval_end;
202 int e;
204
205
211struct vrna_sc_s {
212 const vrna_sc_type_e type;
213 unsigned int n;
214
215 unsigned char state;
216
217 int **energy_up;
223#ifndef VRNA_DISABLE_C11_FEATURES
224 /* C11 support for unnamed unions/structs */
225 union {
226 struct {
227#endif
230#ifndef VRNA_DISABLE_C11_FEATURES
231 /* C11 support for unnamed unions/structs */
232};
233struct {
234#endif
237#ifndef VRNA_DISABLE_C11_FEATURES
238 /* C11 support for unnamed unions/structs */
239};
240};
241#endif
242
246 /* generic soft contraints below */
264 void *data;
268 vrna_auxdata_free_f free_data;
269};
270
288void
290
291
292void
293vrna_sc_prepare(vrna_fold_compound_t *fc,
294 unsigned int options);
295
296
297int
298vrna_sc_update(vrna_fold_compound_t *fc,
299 unsigned int i,
300 unsigned int options);
301
302
318int
320 const FLT_OR_DBL **constraints,
321 unsigned int options);
322
323
338int
340 int i,
341 int j,
342 FLT_OR_DBL energy,
343 unsigned int options);
344
345
361int
363 const FLT_OR_DBL *constraints,
364 unsigned int options);
365
366
380int
382 int i,
383 FLT_OR_DBL energy,
384 unsigned int options);
385
386
387int
388vrna_sc_set_stack(vrna_fold_compound_t *fc,
389 const FLT_OR_DBL *constraints,
390 unsigned int options);
391
392
393int
394vrna_sc_set_stack_comparative(vrna_fold_compound_t *fc,
395 const FLT_OR_DBL **constraints,
396 unsigned int options);
397
398
399int
400vrna_sc_add_stack(vrna_fold_compound_t *fc,
401 int i,
402 FLT_OR_DBL energy,
403 unsigned int options);
404
405
406int
407vrna_sc_add_stack_comparative(vrna_fold_compound_t *fc,
408 int i,
409 const FLT_OR_DBL *energies,
410 unsigned int options);
411
412
422void
424
425
433void
435
436
449int
451 void *data,
452 vrna_auxdata_free_f free_data);
453
454
455int
456vrna_sc_add_data_comparative(vrna_fold_compound_t *fc,
457 void **data,
458 vrna_auxdata_free_f *free_data);
459
460
477int
479 vrna_sc_f f);
480
481
482size_t
483vrna_sc_multi_cb_add(vrna_fold_compound_t *fc,
484 vrna_sc_direct_f cb,
485 vrna_sc_exp_direct_f cb_exp,
486 void *data,
487 vrna_auxdata_free_f free_data,
488 unsigned int decomp_type);
489
490
491int
492vrna_sc_add_f_comparative(vrna_fold_compound_t *fc,
493 vrna_sc_f *f);
494
495
514int
516 vrna_sc_bt_f f);
517
518
536int
538 vrna_sc_exp_f exp_f);
539
540
541int
542vrna_sc_add_exp_f_comparative(vrna_fold_compound_t *fc,
543 vrna_sc_exp_f *exp_f);
544
545
546#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:161
vrna_sc_f f
A function pointer used for pseudo energy contribution in MFE calculations.
Definition soft.h:247
int * up_storage
Storage container for energy contributions per unpaired nucleotide.
Definition soft.h:220
vrna_sc_exp_f exp_f
A function pointer used for pseudo energy contribution boltzmann factors in PF calculations.
Definition soft.h:258
FLT_OR_DBL * exp_energy_stack
Boltzmann weighted pseudo energy contribution per nucleotide involved in a stack.
Definition soft.h:244
int ** energy_up
Energy contribution for stretches of unpaired nucleotides.
Definition soft.h:217
FLT_OR_DBL * exp_energy_bp
Boltzmann Factors of the energy contribution for base pairs.
Definition soft.h:229
FLT_OR_DBL ** exp_energy_bp_local
Boltzmann Factors of the energy contribution for base pairs (sliding window approach)
Definition soft.h:236
void * data
A pointer to the data object provided for for pseudo energy contribution functions of the generic sof...
Definition soft.h:264
vrna_sc_bp_storage_t ** bp_storage
Storage container for energy contributions per base pair.
Definition soft.h:221
int * energy_stack
Pseudo Energy contribution per base pair involved in a stack.
Definition soft.h:243
int * energy_bp
Energy contribution for base pairs.
Definition soft.h:228
FLT_OR_DBL ** exp_energy_up
Boltzmann Factors of the energy contributions for unpaired sequence stretches.
Definition soft.h:218
int ** energy_bp_local
Energy contribution for base pairs (sliding window approach)
Definition soft.h:235
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:252
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:168
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:211
vrna_sc_type_e
The type of a soft constraint.
Definition soft.h:187
@ VRNA_SC_DEFAULT
Default Soft Constraints.
Definition soft.h:188
@ VRNA_SC_WINDOW
Soft Constraints suitable for local structure prediction using window approach.
Definition soft.h:189
A base pair constraint.
Definition soft.h:199