RNAlib-2.5.0
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 
26 typedef struct vrna_sc_s vrna_sc_t;
27 
31 
64 typedef int (vrna_callback_sc_energy)(int i,
65  int j,
66  int k,
67  int l,
68  unsigned char d,
69  void *data);
70 
104  int j,
105  int k,
106  int l,
107  unsigned char d,
108  void *data);
109 
137  int j,
138  int k,
139  int l,
140  unsigned char d,
141  void *data);
142 
143 
147 typedef enum {
154 
155 
159 typedef struct {
160  unsigned int interval_start;
161  unsigned int interval_end;
162  int e;
164 
165 
171 struct vrna_sc_s {
172  const vrna_sc_type_e type;
173  unsigned int n;
174 
175  unsigned char state;
176 
177  int **energy_up;
180  int *up_storage;
183 #ifndef VRNA_DISABLE_C11_FEATURES
184  /* C11 support for unnamed unions/structs */
185  union {
186  struct {
187 #endif
188  int *energy_bp;
190 #ifndef VRNA_DISABLE_C11_FEATURES
191  /* C11 support for unnamed unions/structs */
192  };
193  struct {
194 #endif
197 #ifndef VRNA_DISABLE_C11_FEATURES
198  /* C11 support for unnamed unions/structs */
199  };
200  };
201 #endif
202 
206  /* generic soft contraints below */
224  void *data;
228  vrna_callback_free_auxdata *free_data;
229 };
230 
248 
249 
250 void
251 vrna_sc_prepare(vrna_fold_compound_t *vc,
252  unsigned int options);
253 
254 
255 int
256 vrna_sc_update(vrna_fold_compound_t *vc,
257  unsigned int i,
258  unsigned int options);
259 
260 
276 int
278  const FLT_OR_DBL **constraints,
279  unsigned int options);
280 
281 
296 int
298  int i,
299  int j,
300  FLT_OR_DBL energy,
301  unsigned int options);
302 
303 
319 int
321  const FLT_OR_DBL *constraints,
322  unsigned int options);
323 
324 
338 int
340  int i,
341  FLT_OR_DBL energy,
342  unsigned int options);
343 
344 
345 int
346 vrna_sc_set_stack(vrna_fold_compound_t *vc,
347  const FLT_OR_DBL *constraints,
348  unsigned int options);
349 
350 
351 int
352 vrna_sc_set_stack_comparative(vrna_fold_compound_t *fc,
353  const FLT_OR_DBL **constraints,
354  unsigned int options);
355 
356 
357 int
358 vrna_sc_add_stack(vrna_fold_compound_t *vc,
359  int i,
360  FLT_OR_DBL energy,
361  unsigned int options);
362 
363 
364 int
365 vrna_sc_add_stack_comparative(vrna_fold_compound_t *fc,
366  int i,
367  const FLT_OR_DBL *energies,
368  unsigned int options);
369 
370 
380 void
382 
383 
391 void
393 
394 
407 int
409  void *data,
410  vrna_callback_free_auxdata *free_data);
411 
412 
413 int
414 vrna_sc_add_data_comparative(vrna_fold_compound_t *vc,
415  void **data,
416  vrna_callback_free_auxdata **free_data);
417 
418 
435 int
438 
439 
440 int
441 vrna_sc_add_f_comparative(vrna_fold_compound_t *vc,
443 
444 
463 int
466 
467 
485 int
488 
489 
490 int
491 vrna_sc_add_exp_f_comparative(vrna_fold_compound_t *vc,
493 
494 
495 #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_callback_free_auxdata(void *data)
Callback to free memory allocated for auxiliary user-provided data.
Definition: fold_compound.h:46
The most basic data structure required by many functions throughout the RNAlib.
Definition: fold_compound.h:137
vrna_callback_sc_exp_energy * exp_f
A function pointer used for pseudo energy contribution boltzmann factors in PF calculations.
Definition: soft.h:218
int * up_storage
Storage container for energy contributions per unpaired nucleotide.
Definition: soft.h:180
vrna_callback_sc_backtrack * bt
A function pointer used to obtain backtraced base pairs in loop regions that were altered by soft con...
Definition: soft.h:212
vrna_callback_sc_energy * f
A function pointer used for pseudo energy contribution in MFE calculations.
Definition: soft.h:207
FLT_OR_DBL * exp_energy_stack
Boltzmann weighted pseudo energy contribution per nucleotide involved in a stack.
Definition: soft.h:204
int ** energy_up
Energy contribution for stretches of unpaired nucleotides.
Definition: soft.h:177
FLT_OR_DBL * exp_energy_bp
Boltzmann Factors of the energy contribution for base pairs.
Definition: soft.h:189
FLT_OR_DBL ** exp_energy_bp_local
Boltzmann Factors of the energy contribution for base pairs (sliding window approach)
Definition: soft.h:196
void * data
A pointer to the data object provided for for pseudo energy contribution functions of the generic sof...
Definition: soft.h:224
vrna_sc_bp_storage_t ** bp_storage
Storage container for energy contributions per base pair.
Definition: soft.h:181
int * energy_stack
Pseudo Energy contribution per base pair involved in a stack.
Definition: soft.h:203
int * energy_bp
Energy contribution for base pairs.
Definition: soft.h:188
FLT_OR_DBL ** exp_energy_up
Boltzmann Factors of the energy contributions for unpaired sequence stretches.
Definition: soft.h:178
int ** energy_bp_local
Energy contribution for base pairs (sliding window approach)
Definition: soft.h:195
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_data(vrna_fold_compound_t *vc, void *data, vrna_callback_free_auxdata *free_data)
Add an auxiliary data structure for the generic soft constraints callback function.
int vrna_sc_add_exp_f(vrna_fold_compound_t *vc, vrna_callback_sc_exp_energy *exp_f)
Bind a function pointer for generic soft constraint feature (PF version)
FLT_OR_DBL() vrna_callback_sc_exp_energy(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:103
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.
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.
int() vrna_callback_sc_energy(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
void vrna_sc_init(vrna_fold_compound_t *vc)
Initialize an empty soft constraints data structure within a vrna_fold_compound_t.
int vrna_sc_set_up(vrna_fold_compound_t *vc, const FLT_OR_DBL *constraints, unsigned int options)
Set soft constraints for unpaired nucleotides.
vrna_basepair_t *() vrna_callback_sc_backtrack(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:136
int vrna_sc_add_bt(vrna_fold_compound_t *vc, vrna_callback_sc_backtrack *f)
Bind a backtracking function pointer for generic soft constraint feature.
int vrna_sc_add_f(vrna_fold_compound_t *vc, vrna_callback_sc_energy *f)
Bind a function pointer for generic soft constraint feature (MFE version)
The soft constraints data structure.
Definition: soft.h:171
vrna_sc_type_e
The type of a soft constraint.
Definition: soft.h:147
@ VRNA_SC_DEFAULT
Default Soft Constraints.
Definition: soft.h:148
@ VRNA_SC_WINDOW
Soft Constraints suitable for local structure prediction using window approach.
Definition: soft.h:149
A base pair constraint.
Definition: soft.h:159