1 #ifndef VIENNA_RNA_PACKAGE_CONSTRAINTS_H
2 #define VIENNA_RNA_PACKAGE_CONSTRAINTS_H
4 #ifdef DEPRECATION_WARNINGS
6 # define DEPRECATED(func) func __attribute__ ((deprecated))
8 # define DEPRECATED(func) func
11 # define DEPRECATED(func) func
16 #define VRNA_BACKWARD_COMPAT
126 #define VRNA_CONSTRAINT_DB_PIPE 1U
136 #define VRNA_CONSTRAINT_DB_DOT 2U
145 #define VRNA_CONSTRAINT_DB_X 4U
154 #define VRNA_CONSTRAINT_DB_ANG_BRACK 8U
163 #define VRNA_CONSTRAINT_DB_RND_BRACK 16U
176 #define VRNA_CONSTRAINT_DB_INTRAMOL 2048U
189 #define VRNA_CONSTRAINT_DB_INTERMOL 4096U
199 #define VRNA_CONSTRAINT_DB_GQUAD 8192U
211 #define VRNA_CONSTRAINT_DB_ENFORCE_BP 16384U
219 #define VRNA_CONSTRAINT_MULTILINE 32U
226 #define VRNA_CONSTRAINT_NO_HEADER 64U
233 #define VRNA_CONSTRAINT_ALL 128U
243 #define VRNA_CONSTRAINT_DB 256U
253 #define VRNA_CONSTRAINT_FILE 512U
261 #define VRNA_CONSTRAINT_SOFT_MFE 8192U
269 #define VRNA_CONSTRAINT_SOFT_PF 16384U
278 #define VRNA_CONSTRAINT_CONTEXT_EXT_LOOP (char)0x01
286 #define VRNA_CONSTRAINT_CONTEXT_HP_LOOP (char)0x02
294 #define VRNA_CONSTRAINT_CONTEXT_INT_LOOP (char)0x04
302 #define VRNA_CONSTRAINT_CONTEXT_INT_LOOP_ENC (char)0x08
310 #define VRNA_CONSTRAINT_CONTEXT_MB_LOOP (char)0x10
318 #define VRNA_CONSTRAINT_CONTEXT_MB_LOOP_ENC (char)0x20
320 #define VRNA_CONSTRAINT_CONTEXT_ENFORCE (char)0x40
322 #define VRNA_CONSTRAINT_CONTEXT_NO_REMOVE (char)0x80
330 #define VRNA_CONSTRAINT_CONTEXT_ALL_LOOPS (char)( VRNA_CONSTRAINT_CONTEXT_EXT_LOOP \
331 | VRNA_CONSTRAINT_CONTEXT_HP_LOOP \
332 | VRNA_CONSTRAINT_CONTEXT_INT_LOOP \
333 | VRNA_CONSTRAINT_CONTEXT_INT_LOOP_ENC \
334 | VRNA_CONSTRAINT_CONTEXT_MB_LOOP \
335 | VRNA_CONSTRAINT_CONTEXT_MB_LOOP_ENC)
343 #define VRNA_DECOMP_PAIR_HP 1
351 #define VRNA_DECOMP_PAIR_IL 2
357 #define VRNA_DECOMP_PAIR_ML 3
363 #define VRNA_DECOMP_ML_ML_ML 5
369 #define VRNA_DECOMP_ML_STEM 4
375 #define VRNA_DECOMP_ML_ML 6
381 #define VRNA_DECOMP_ML_UP 11
387 #define VRNA_DECOMP_ML_COAXIAL 13
393 #define VRNA_DECOMP_EXT_EXT 9
399 #define VRNA_DECOMP_EXT_UP 8
405 #define VRNA_DECOMP_EXT_STEM 14
411 #define VRNA_DECOMP_EXT_EXT_EXT 15
417 #define VRNA_DECOMP_EXT_STEM_EXT 16
423 #define VRNA_DECOMP_EXT_STEM_OUTSIDE 17
429 #define VRNA_DECOMP_EXT_EXT_STEM 18
435 #define VRNA_DECOMP_EXT_EXT_STEM1 19
441 #define VRNA_DECOMP_ML_ML_STEM 20
614 const char *constraint,
615 unsigned int options);
751 unsigned int options);
764 unsigned int options);
812 const double *reactivities,
815 unsigned int options);
830 const char **shape_files,
831 const int *shape_file_association,
834 unsigned int options);
857 const double *reactivities,
859 double default_value,
860 const char *shape_conversion,
861 unsigned int options);
897 double default_value);
956 #ifdef VRNA_BACKWARD_COMPAT
987 DEPRECATED(
void constrain_ptypes(
const char *constraint,
unsigned int length,
char *ptype,
int *BP,
int min_loop_size,
unsigned int idx_type));
void vrna_hc_add_up(vrna_fold_compound_t *vc, int i, char option)
Make a certain nucleotide unpaired.
int( vrna_callback_sc_energy)(int i, int j, int k, int l, char d, void *data)
Callback to retrieve pseudo energy contribution for soft constraint feature.
Definition: constraints.h:81
int vrna_sc_add_SHAPE_zarringhalam(vrna_fold_compound_t *vc, const double *reactivities, double b, double default_value, const char *shape_conversion, unsigned int options)
Add SHAPE reactivity data as soft constraints (Zarringhalam et al. method)
int vrna_sc_SHAPE_to_pr(const char *shape_conversion, double *values, int length, double default_value)
Convert SHAPE reactivity values to probabilities for being unpaired.
int * up_hp
A linear array that holds the number of allowed unpaired nucleotides in a hairpin loop...
Definition: constraints.h:475
void constrain_ptypes(const char *constraint, unsigned int length, char *ptype, int *BP, int min_loop_size, unsigned int idx_type)
Insert constraining pair types according to constraint structure string.
void vrna_sc_free(vrna_sc_t *sc)
Free memory occupied by a vrna_sc_t data structure.
void vrna_constraints_add(vrna_fold_compound_t *vc, const char *constraint, unsigned int options)
Add constraints to a vrna_fold_compound_t data structure.
void vrna_sc_add_up(vrna_fold_compound_t *vc, const FLT_OR_DBL *constraints, unsigned int options)
Add soft constraints for unpaired nucleotides.
void vrna_sc_add_bp(vrna_fold_compound_t *vc, const FLT_OR_DBL **constraints, unsigned int options)
Add soft constraints for paired nucleotides.
void print_tty_constraint_full(void)
Print structure constraint characters to stdout (full constraint support)
double FLT_OR_DBL
Typename for floating point number in partition function computations.
Definition: data_structures.h:39
The most basic data structure required by many functions throughout the RNAlib.
Definition: data_structures.h:389
char * matrix
Upper triangular matrix that encodes where a base pair or unpaired nucleotide is allowed.
Definition: constraints.h:469
int * energy_stack
Pseudo Energy contribution per base pair involved in a stack.
Definition: constraints.h:517
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.h:526
void vrna_sc_add_f(vrna_fold_compound_t *vc, vrna_callback_sc_energy *f)
Bind a function pointer for generalized soft constraint feature (MFE version)
int * up_ml
A linear array that holds the number of allowed unpaired nucleotides in a multi branched loop...
Definition: constraints.h:481
vrna_callback_sc_energy * f
A function pointer used for pseudo energy contribution in MFE calculations.
Definition: constraints.h:521
void vrna_hc_add_bp(vrna_fold_compound_t *vc, int i, int j, char option)
Favorize/Enforce a certain base pair (i,j)
char( vrna_callback_hc_evaluate)(int i, int j, int k, int l, char d, void *data)
Callback to evaluate whether or not a particular decomposition step is contributing to the solution s...
Definition: constraints.h:66
void vrna_message_constraint_options_all(void)
Print structure constraint characters to stdout (full constraint support)
FLT_OR_DBL * exp_energy_bp
Boltzmann Factors of the energy contribution for base pairs.
Definition: constraints.h:515
Base pair data structure used in subopt.c.
Definition: data_structures.h:155
FLT_OR_DBL ** exp_energy_up
Boltzmann Factors of the energy contributions for unpaired sequence stretches.
Definition: constraints.h:514
The soft constraints data structure.
Definition: constraints.h:511
vrna_callback_hc_evaluate * f
A function pointer that returns whether or not a certain decomposition may be evaluated.
Definition: constraints.h:485
void * data
A pointer to some structure where the user may store necessary data to evaluate its generalized hard ...
Definition: constraints.h:489
void( vrna_callback_free_auxdata)(void *data)
Callback to free memory allocated for auxiliary user-provided data.
Definition: data_structures.h:51
vrna_callback_sc_exp_energy * exp_f
A function pointer used for pseudo energy contribution boltzmann factors in PF calculations.
Definition: constraints.h:532
The hard constraints data structure.
Definition: constraints.h:468
FLT_OR_DBL( vrna_callback_sc_exp_energy)(int i, int j, int k, int l, char d, void *data)
Callback to retrieve pseudo energy contribution as Boltzmann Factors for soft constraint feature...
Definition: constraints.h:96
int ** energy_up
Energy contribution for stretches of unpaired nucleotides.
Definition: constraints.h:512
vrna_basepair_t *( vrna_callback_sc_backtrack)(int i, int j, int k, int l, char d, void *data)
Callback to retrieve auxiliary base pairs for soft constraint feature.
Definition: constraints.h:111
int vrna_sc_add_SHAPE_deigan_ali(vrna_fold_compound_t *vc, const char **shape_files, const int *shape_file_association, double m, double b, unsigned int options)
Add SHAPE reactivity data from files as soft constraints for consensus structure prediction (Deigan e...
int * up_ext
A linear array that holds the number of allowed unpaired nucleotides in an exterior loop...
Definition: constraints.h:472
FLT_OR_DBL * exp_energy_stack
Boltzmann weighted pseudo energy contribution per nucleotide involved in a stack. ...
Definition: constraints.h:518
int * up_int
A linear array that holds the number of allowed unpaired nucleotides in an interior loop...
Definition: constraints.h:478
void vrna_sc_add_exp_f(vrna_fold_compound_t *vc, vrna_callback_sc_exp_energy *exp_f)
Bind a function pointer for generalized soft constraint feature (PF version)
void vrna_hc_add_bp_nonspecific(vrna_fold_compound_t *vc, int i, int d, char option)
Enforce a nucleotide to be paired (upstream/downstream)
void vrna_sc_init(vrna_fold_compound_t *vc)
Initialize an empty soft constraints data structure within a vrna_fold_compound_t.
void vrna_message_constraint_options(unsigned int option)
Print a help message for pseudo dot-bracket structure constraint characters to stdout. (constraint support is specified by option parameter)
vrna_callback_free_auxdata * free_data
A pointer to a function to free memory occupied by auxiliary data.
Definition: constraints.h:494
int * energy_bp
Energy contribution for base pairs.
Definition: constraints.h:513
void vrna_sc_remove(vrna_fold_compound_t *vc)
Remove soft constraints from vrna_fold_compound_t.
int vrna_sc_SHAPE_parse_method(const char *method_string, char *method, float *param_1, float *param_2)
Parse a character string and extract the encoded SHAPE reactivity conversion method and possibly the ...
void vrna_hc_init(vrna_fold_compound_t *vc)
Initialize/Reset hard constraints to default values.
void vrna_sc_add_bt(vrna_fold_compound_t *vc, vrna_callback_sc_backtrack *f)
Bind a backtracking function pointer for generalized soft constraint feature.
void vrna_hc_free(vrna_hc_t *hc)
Free the memory allocated by a vrna_hc_t data structure.
void print_tty_constraint(unsigned int option)
Print structure constraint characters to stdout. (constraint support is specified by option parameter...
void * data
A pointer to the data object provided for for pseudo energy contribution functions of the generalized...
Definition: constraints.h:538
int vrna_sc_add_SHAPE_deigan(vrna_fold_compound_t *vc, const double *reactivities, double m, double b, unsigned int options)
Add SHAPE reactivity data as soft constraints (Deigan et al. method)