RNAlib-2.4.3
constraints_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 
5 
16 typedef struct vrna_sc_s vrna_sc_t;
17 
50 typedef int (vrna_callback_sc_energy)(int i,
51  int j,
52  int k,
53  int l,
54  unsigned char d,
55  void *data);
56 
90  int j,
91  int k,
92  int l,
93  unsigned char d,
94  void *data);
95 
123  int j,
124  int k,
125  int l,
126  unsigned char d,
127  void *data);
128 
129 
130 typedef enum {
137 
138 
142 typedef struct {
143  unsigned int interval_start;
144  unsigned int interval_end;
145  int e;
147 
148 
154 struct vrna_sc_s {
155  vrna_sc_type_e type;
156  unsigned int n;
157 
158  unsigned char state;
159 
160  int **energy_up;
163  int *up_storage;
166 #ifndef VRNA_DISABLE_C11_FEATURES
167  /* C11 support for unnamed unions/structs */
168  union {
169  struct {
170 #endif
171  int *energy_bp;
173 #ifndef VRNA_DISABLE_C11_FEATURES
174  /* C11 support for unnamed unions/structs */
175  };
176  struct {
177 #endif
180 #ifndef VRNA_DISABLE_C11_FEATURES
181  /* C11 support for unnamed unions/structs */
182  };
183  };
184 #endif
185 
189  /* generic soft contraints below */
207  void *data;
211  vrna_callback_free_auxdata *free_data;
212 };
213 
231 
232 
233 void
234 vrna_sc_prepare(vrna_fold_compound_t *vc,
235  unsigned int options);
236 
237 
238 void
239 vrna_sc_update(vrna_fold_compound_t *vc,
240  unsigned int i,
241  unsigned int options);
242 
243 
259  const FLT_OR_DBL **constraints,
260  unsigned int options);
261 
262 
277  int i,
278  int j,
279  FLT_OR_DBL energy,
280  unsigned int options);
281 
282 
298  const FLT_OR_DBL *constraints,
299  unsigned int options);
300 
301 
315  int i,
316  FLT_OR_DBL energy,
317  unsigned int options);
318 
319 
320 void vrna_sc_set_stack(vrna_fold_compound_t *vc,
321  const FLT_OR_DBL *constraints,
322  unsigned int options);
323 
324 
325 void vrna_sc_add_stack(vrna_fold_compound_t *vc,
326  int i,
327  FLT_OR_DBL energy,
328  unsigned int options);
329 
330 
341 
342 
350 void vrna_sc_free(vrna_sc_t *sc);
351 
352 
365  void *data,
366  vrna_callback_free_auxdata *free_data);
367 
368 
386 
387 
407 
408 
427 
428 
429 #endif
A base pair constraint.
Definition: constraints_soft.h:142
void vrna_sc_free(vrna_sc_t *sc)
Free memory occupied by a vrna_sc_t data structure.
Default Soft Constraints.
Definition: constraints_soft.h:131
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: constraints_soft.h:50
FLT_OR_DBL ** exp_energy_bp_local
Boltzmann Factors of the energy contribution for base pairs (sliding window approach) ...
Definition: constraints_soft.h:179
double FLT_OR_DBL
Typename for floating point number in partition function computations.
Definition: data_structures.h:43
The most basic data structure required by many functions throughout the RNAlib.
Definition: fold_compound.h:130
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: constraints_soft.h:122
int * energy_stack
Pseudo Energy contribution per base pair involved in a stack.
Definition: constraints_soft.h:186
vrna_callback_sc_backtrack * bt
A function pointer used to obtain backtraced base pairs in loop regions that were altered by soft con...
Definition: constraints_soft.h:195
vrna_sc_type_e
Definition: constraints_soft.h:130
vrna_sc_bp_storage_t ** bp_storage
Storage container for energy contributions per base pair.
Definition: constraints_soft.h:164
vrna_callback_sc_energy * f
A function pointer used for pseudo energy contribution in MFE calculations.
Definition: constraints_soft.h:190
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)
Various data structures and pre-processor macros.
FLT_OR_DBL * exp_energy_bp
Boltzmann Factors of the energy contribution for base pairs.
Definition: constraints_soft.h:172
Base pair data structure used in subopt.c.
Definition: data_structures.h:106
FLT_OR_DBL ** exp_energy_up
Boltzmann Factors of the energy contributions for unpaired sequence stretches.
Definition: constraints_soft.h:161
Soft Constraints suitable for local structure prediction using window approach.
Definition: constraints_soft.h:132
The soft constraints data structure.
Definition: constraints_soft.h:154
vrna_callback_sc_exp_energy * exp_f
A function pointer used for pseudo energy contribution boltzmann factors in PF calculations.
Definition: constraints_soft.h:201
int ** energy_up
Energy contribution for stretches of unpaired nucleotides.
Definition: constraints_soft.h:160
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: constraints_soft.h:89
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: constraints_soft.h:163
FLT_OR_DBL * exp_energy_stack
Boltzmann weighted pseudo energy contribution per nucleotide involved in a stack. ...
Definition: constraints_soft.h:187
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: constraints_soft.h:178
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: constraints_soft.h:171
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: constraints_soft.h:207