RNAlib-2.4.11
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 
6 
29 typedef struct vrna_sc_s vrna_sc_t;
30 
63 typedef int (vrna_callback_sc_energy)(int i,
64  int j,
65  int k,
66  int l,
67  unsigned char d,
68  void *data);
69 
103  int j,
104  int k,
105  int l,
106  unsigned char d,
107  void *data);
108 
136  int j,
137  int k,
138  int l,
139  unsigned char d,
140  void *data);
141 
142 
146 typedef enum {
153 
154 
158 typedef struct {
159  unsigned int interval_start;
160  unsigned int interval_end;
161  int e;
163 
164 
170 struct vrna_sc_s {
171  vrna_sc_type_e type;
172  unsigned int n;
173 
174  unsigned char state;
175 
176  int **energy_up;
179  int *up_storage;
182 #ifndef VRNA_DISABLE_C11_FEATURES
183  /* C11 support for unnamed unions/structs */
184  union {
185  struct {
186 #endif
187  int *energy_bp;
189 #ifndef VRNA_DISABLE_C11_FEATURES
190  /* C11 support for unnamed unions/structs */
191  };
192  struct {
193 #endif
196 #ifndef VRNA_DISABLE_C11_FEATURES
197  /* C11 support for unnamed unions/structs */
198  };
199  };
200 #endif
201 
205  /* generic soft contraints below */
223  void *data;
227  vrna_callback_free_auxdata *free_data;
228 };
229 
247 
248 
249 void
250 vrna_sc_prepare(vrna_fold_compound_t *vc,
251  unsigned int options);
252 
253 
254 void
255 vrna_sc_update(vrna_fold_compound_t *vc,
256  unsigned int i,
257  unsigned int options);
258 
259 
275  const FLT_OR_DBL **constraints,
276  unsigned int options);
277 
278 
293  int i,
294  int j,
295  FLT_OR_DBL energy,
296  unsigned int options);
297 
298 
314  const FLT_OR_DBL *constraints,
315  unsigned int options);
316 
317 
331  int i,
332  FLT_OR_DBL energy,
333  unsigned int options);
334 
335 
336 void vrna_sc_set_stack(vrna_fold_compound_t *vc,
337  const FLT_OR_DBL *constraints,
338  unsigned int options);
339 
340 
341 void vrna_sc_add_stack(vrna_fold_compound_t *vc,
342  int i,
343  FLT_OR_DBL energy,
344  unsigned int options);
345 
346 
357 
358 
366 void vrna_sc_free(vrna_sc_t *sc);
367 
368 
381  void *data,
382  vrna_callback_free_auxdata *free_data);
383 
384 
402 
403 
423 
424 
443 
444 
445 #endif
A base pair constraint.
Definition: soft.h:158
void vrna_sc_free(vrna_sc_t *sc)
Free memory occupied by a vrna_sc_t data structure.
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:63
FLT_OR_DBL ** exp_energy_bp_local
Boltzmann Factors of the energy contribution for base pairs (sliding window approach) ...
Definition: soft.h:195
Default Soft Constraints.
Definition: soft.h:147
double FLT_OR_DBL
Typename for floating point number in partition function computations.
Definition: basic.h:43
The most basic data structure required by many functions throughout the RNAlib.
Definition: fold_compound.h:132
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:135
int * energy_stack
Pseudo Energy contribution per base pair involved in a stack.
Definition: soft.h:202
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:211
vrna_sc_bp_storage_t ** bp_storage
Storage container for energy contributions per base pair.
Definition: soft.h:180
vrna_callback_sc_energy * f
A function pointer used for pseudo energy contribution in MFE calculations.
Definition: soft.h:206
Various data structures and pre-processor macros.
void 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 * exp_energy_bp
Boltzmann Factors of the energy contribution for base pairs.
Definition: soft.h:188
Base pair data structure used in subopt.c.
Definition: basic.h:104
FLT_OR_DBL ** exp_energy_up
Boltzmann Factors of the energy contributions for unpaired sequence stretches.
Definition: soft.h:177
Functions and data structures for constraining secondary structure predictions and evaluation...
The soft constraints data structure.
Definition: soft.h:170
Soft Constraints suitable for local structure prediction using window approach.
Definition: soft.h:148
vrna_callback_sc_exp_energy * exp_f
A function pointer used for pseudo energy contribution boltzmann factors in PF calculations.
Definition: soft.h:217
int ** energy_up
Energy contribution for stretches of unpaired nucleotides.
Definition: soft.h:176
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:102
void vrna_sc_set_bp(vrna_fold_compound_t *vc, const FLT_OR_DBL **constraints, unsigned int options)
Set soft constraints for paired nucleotides.
void 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 * up_storage
Storage container for energy contributions per unpaired nucleotide.
Definition: soft.h:179
vrna_sc_type_e
The type of a soft constraint.
Definition: soft.h:146
FLT_OR_DBL * exp_energy_stack
Boltzmann weighted pseudo energy contribution per nucleotide involved in a stack. ...
Definition: soft.h:203
void() vrna_callback_free_auxdata(void *data)
Callback to free memory allocated for auxiliary user-provided data.
Definition: fold_compound.h:46
int ** energy_bp_local
Energy contribution for base pairs (sliding window approach)
Definition: soft.h:194
void 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.
void vrna_sc_init(vrna_fold_compound_t *vc)
Initialize an empty soft constraints data structure within a vrna_fold_compound_t.
int * energy_bp
Energy contribution for base pairs.
Definition: soft.h:187
void vrna_sc_add_bt(vrna_fold_compound_t *vc, vrna_callback_sc_backtrack *f)
Bind a backtracking function pointer for generic soft constraint feature.
void vrna_sc_remove(vrna_fold_compound_t *vc)
Remove soft constraints from vrna_fold_compound_t.
void 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_set_up(vrna_fold_compound_t *vc, const FLT_OR_DBL *constraints, unsigned int options)
Set soft constraints for unpaired nucleotides.
void 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)
void * data
A pointer to the data object provided for for pseudo energy contribution functions of the generic sof...
Definition: soft.h:223