RNAlib-2.6.0b
 
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
287void
289
290
291void
292vrna_sc_prepare(vrna_fold_compound_t *vc,
293 unsigned int options);
294
295
296int
297vrna_sc_update(vrna_fold_compound_t *vc,
298 unsigned int i,
299 unsigned int options);
300
301
317int
319 const FLT_OR_DBL **constraints,
320 unsigned int options);
321
322
337int
339 int i,
340 int j,
341 FLT_OR_DBL energy,
342 unsigned int options);
343
344
360int
362 const FLT_OR_DBL *constraints,
363 unsigned int options);
364
365
379int
381 int i,
382 FLT_OR_DBL energy,
383 unsigned int options);
384
385
386int
387vrna_sc_set_stack(vrna_fold_compound_t *vc,
388 const FLT_OR_DBL *constraints,
389 unsigned int options);
390
391
392int
393vrna_sc_set_stack_comparative(vrna_fold_compound_t *fc,
394 const FLT_OR_DBL **constraints,
395 unsigned int options);
396
397
398int
399vrna_sc_add_stack(vrna_fold_compound_t *vc,
400 int i,
401 FLT_OR_DBL energy,
402 unsigned int options);
403
404
405int
406vrna_sc_add_stack_comparative(vrna_fold_compound_t *fc,
407 int i,
408 const FLT_OR_DBL *energies,
409 unsigned int options);
410
411
421void
423
424
432void
434
435
448int
450 void *data,
451 vrna_auxdata_free_f free_data);
452
453
454int
455vrna_sc_add_data_comparative(vrna_fold_compound_t *vc,
456 void **data,
457 vrna_auxdata_free_f *free_data);
458
459
476int
478 vrna_sc_f f);
479
480
481size_t
482vrna_sc_multi_cb_add(vrna_fold_compound_t *fc,
483 vrna_sc_direct_f cb,
484 vrna_sc_exp_direct_f cb_exp,
485 void *data,
486 vrna_auxdata_free_f free_data,
487 unsigned int decomp_type);
488
489
490int
491vrna_sc_add_f_comparative(vrna_fold_compound_t *vc,
492 vrna_sc_f *f);
493
494
513int
515 vrna_sc_bt_f f);
516
517
535int
537 vrna_sc_exp_f exp_f);
538
539
540int
541vrna_sc_add_exp_f_comparative(vrna_fold_compound_t *vc,
542 vrna_sc_exp_f *exp_f);
543
544
545#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:156
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_set_bp(vrna_fold_compound_t *vc, const FLT_OR_DBL **constraints, unsigned int options)
Set soft constraints for paired nucleotides.
int vrna_sc_add_bp(vrna_fold_compound_t *vc, int i, int j, FLT_OR_DBL energy, unsigned int options)
Add soft constraints for paired nucleotides.
int vrna_sc_add_data(vrna_fold_compound_t *vc, void *data, vrna_auxdata_free_f free_data)
Add an auxiliary data structure for the generic soft constraints callback function.
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
void vrna_sc_free(vrna_sc_t *sc)
Free memory occupied by a vrna_sc_t data structure.
void vrna_sc_remove(vrna_fold_compound_t *vc)
Remove soft constraints from vrna_fold_compound_t.
int vrna_sc_add_up(vrna_fold_compound_t *vc, int i, FLT_OR_DBL energy, unsigned int options)
Add soft constraints for unpaired nucleotides.
void vrna_sc_init(vrna_fold_compound_t *vc)
Initialize an empty soft constraints data structure within a vrna_fold_compound_t.
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_f(vrna_fold_compound_t *vc, vrna_sc_f f)
Bind a function pointer for generic soft constraint feature (MFE version)
int vrna_sc_set_up(vrna_fold_compound_t *vc, const FLT_OR_DBL *constraints, unsigned int options)
Set soft constraints for unpaired nucleotides.
int vrna_sc_add_bt(vrna_fold_compound_t *vc, vrna_sc_bt_f f)
Bind a backtracking function pointer for generic soft constraint feature.
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_add_exp_f(vrna_fold_compound_t *vc, vrna_sc_exp_f exp_f)
Bind a function pointer for generic soft constraint feature (PF version)
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