1 #ifndef VIENNA_RNA_PACKAGE_CONSTRAINTS_H
2 #define VIENNA_RNA_PACKAGE_CONSTRAINTS_H
5 #define DEPRECATED(func) func __attribute__ ((deprecated))
7 #define DEPRECATED(func) func
12 #define VRNA_BACKWARD_COMPAT
49 #define VRNA_CONSTRAINT_DB_PIPE 1U
59 #define VRNA_CONSTRAINT_DB_DOT 2U
68 #define VRNA_CONSTRAINT_DB_X 4U
77 #define VRNA_CONSTRAINT_DB_ANG_BRACK 8U
86 #define VRNA_CONSTRAINT_DB_RND_BRACK 16U
99 #define VRNA_CONSTRAINT_DB_INTRAMOL 2048U
112 #define VRNA_CONSTRAINT_DB_INTERMOL 4096U
122 #define VRNA_CONSTRAINT_DB_GQUAD 8192U
134 #define VRNA_CONSTRAINT_DB_ENFORCE_BP 16384U
142 #define VRNA_CONSTRAINT_MULTILINE 32U
149 #define VRNA_CONSTRAINT_NO_HEADER 64U
156 #define VRNA_CONSTRAINT_ALL 128U
166 #define VRNA_CONSTRAINT_DB 256U
176 #define VRNA_CONSTRAINT_FILE 512U
184 #define VRNA_CONSTRAINT_SOFT_MFE 8192U
192 #define VRNA_CONSTRAINT_SOFT_PF 16384U
201 #define VRNA_CONSTRAINT_CONTEXT_EXT_LOOP (char)0x01
209 #define VRNA_CONSTRAINT_CONTEXT_HP_LOOP (char)0x02
217 #define VRNA_CONSTRAINT_CONTEXT_INT_LOOP (char)0x04
225 #define VRNA_CONSTRAINT_CONTEXT_INT_LOOP_ENC (char)0x08
233 #define VRNA_CONSTRAINT_CONTEXT_MB_LOOP (char)0x10
241 #define VRNA_CONSTRAINT_CONTEXT_MB_LOOP_ENC (char)0x20
243 #define VRNA_CONSTRAINT_CONTEXT_ENFORCE (char)0x40
245 #define VRNA_CONSTRAINT_CONTEXT_NO_REMOVE (char)0x80
253 #define VRNA_CONSTRAINT_CONTEXT_ALL_LOOPS (char)( VRNA_CONSTRAINT_CONTEXT_EXT_LOOP \
254 | VRNA_CONSTRAINT_CONTEXT_HP_LOOP \
255 | VRNA_CONSTRAINT_CONTEXT_INT_LOOP \
256 | VRNA_CONSTRAINT_CONTEXT_INT_LOOP_ENC \
257 | VRNA_CONSTRAINT_CONTEXT_MB_LOOP \
258 | VRNA_CONSTRAINT_CONTEXT_MB_LOOP_ENC)
266 #define VRNA_DECOMP_PAIR_HP 1
274 #define VRNA_DECOMP_PAIR_IL 2
280 #define VRNA_DECOMP_PAIR_ML 3
286 #define VRNA_DECOMP_ML_ML_ML 5
292 #define VRNA_DECOMP_ML_UP_3 4
298 #define VRNA_DECOMP_ML_UP_5 6
304 #define VRNA_DECOMP_ML_UP 11
310 #define VRNA_DECOMP_EXT_EXT 9
316 #define VRNA_DECOMP_EXT_UP_3 7
322 #define VRNA_DECOMP_EXT_UP_5 10
328 #define VRNA_DECOMP_EXT_UP 8
334 #define VRNA_DECOMP_EXT_STEM_UP 12
350 #define VRNA_SC_GEN_MFE (char)1
365 #define VRNA_SC_GEN_PF (char)2
545 const char *constraint,
546 unsigned int options);
666 const double **constraints,
667 unsigned int options);
679 const double *constraints,
680 unsigned int options);
714 int vrna_sc_SHAPE_parse_method(
const char *method_string,
745 const double *reactivities,
748 unsigned int options);
763 const char **shape_files,
764 const int *shape_file_association,
767 unsigned int options);
790 const double *reactivities,
792 double default_value,
793 const char *shape_conversion,
794 unsigned int options);
813 double default_value);
830 int (*f)(
int,
int,
int,
int,
char,
void *),
849 PAIR *(*f)(
int,
int,
int,
int,
char,
void *));
867 FLT_OR_DBL (*exp_f)(
int,
int,
int,
int,
char,
void *),
904 #ifdef VRNA_BACKWARD_COMPAT
913 DEPRECATED(
void print_tty_constraint(
unsigned int option));
921 DEPRECATED(
void print_tty_constraint_full(
void));
935 DEPRECATED(
void constrain_ptypes(
const char *constraint,
unsigned int length,
char *ptype,
int *BP,
int min_loop_size,
unsigned int idx_type));
void vrna_sc_add_pre(vrna_fold_compound *vc, void(*pre)(vrna_fold_compound *, char))
Add a pre-processing function for the generalized soft constraints feature.
int vrna_sc_SHAPE_add_deigan(vrna_fold_compound *vc, const double *reactivities, double m, double b, unsigned int options)
Add SHAPE reactivity data as soft constraints (Deigan et al. method)
FLT_OR_DBL ** boltzmann_factors
Boltzmann Factors of the energy contributions for unpaired sequence stretches.
Definition: constraints.h:416
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.
void(* pre)(vrna_fold_compound *, char)
A function pointer to some generalized soft constraints preprocessing function.
Definition: constraints.h:455
int * up_hp
A linear array that holds the number of allowed unpaired nucleotides in a hairpin loop...
Definition: constraints.h:397
void vrna_hc_init(vrna_fold_compound *vc)
Initialize/Reset hard constraints to default values.
void vrna_sc_free(vrna_sc_t *sc)
Free memory occupied by a vrna_sc_t data structure.
The hard constraints data structure.
Definition: constraints.h:390
char * matrix
Upper triangular matrix encoding where a base pair or unpaired nucleotide is allowed.
Definition: constraints.h:391
int * up_int
A linear array that holds the number of allowed unpaired nucleotides in an interior loop...
Definition: constraints.h:400
void vrna_hc_add_bp(vrna_fold_compound *vc, int i, int j, char option)
Favorize/Enforce a certain base pair (i,j)
int * up_ml
A linear array that holds the number of allowed unpaired nucleotides in a multi branched loop...
Definition: constraints.h:403
void(* post)(vrna_fold_compound *, char)
A function pointer to some generalized soft constraints postprocessing function.
Definition: constraints.h:462
void vrna_hc_add_bp_nonspecific(vrna_fold_compound *vc, int i, int d, char option)
Enforce a nucleotide to be paired (upstream/downstream)
void vrna_hc_add_up(vrna_fold_compound *vc, int i, char option)
Make a certain nucleotide unpaired.
int * up_ext
A linear array that holds the number of allowed unpaired nucleotides in an exterior loop...
Definition: constraints.h:394
void vrna_sc_remove(vrna_fold_compound *vc)
Remove soft constraints from vrna_fold_compound.
int ** free_energies
Energy contribution for unpaired sequence stretches.
Definition: constraints.h:414
void vrna_sc_init(vrna_fold_compound *vc)
Initialize an empty soft constraints data structure within a vrna_fold_compound.
FLT_OR_DBL * exp_en_basepair
Boltzmann Factors of the energy contribution for base pairs.
Definition: constraints.h:417
The most basic data structure required by many functions throughout the RNAlib.
Definition: data_structures.h:698
void vrna_add_constraints(vrna_fold_compound *vc, const char *constraint, unsigned int options)
Add constraints to a vrna_fold_compound data structure.
void vrna_sc_add_post(vrna_fold_compound *vc, void(*post)(vrna_fold_compound *, char))
Add a post-processing function for the generalized soft constraints feature.
FLT_OR_DBL * exp_en_stack
Boltzmann weighted pseudo energy contribution per nucleotide involved in a stack. ...
Definition: constraints.h:420
void vrna_sc_add_bt(vrna_fold_compound *vc, PAIR *(*f)(int, int, int, int, char, void *))
Bind a backtracking function pointer for generalized soft constraint feature.
void vrna_sc_add_f(vrna_fold_compound *vc, int(*f)(int, int, int, int, char, void *), void *data)
Bind a function pointer for generalized soft constraint feature (MFE version)
The soft constraints data structure.
Definition: constraints.h:413
int vrna_sc_SHAPE_add_deigan_ali(vrna_fold_compound *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...
void * data
A pointer to the data object provided for for pseudo energy contribution functions of the generalized...
Definition: constraints.h:470
void vrna_sc_add_bp(vrna_fold_compound *vc, const double **constraints, unsigned int options)
Add soft constraints for paired nucleotides.
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)
Base pair data structure used in subopt.c.
Definition: data_structures.h:97
void vrna_sc_add_exp_f(vrna_fold_compound *vc, FLT_OR_DBL(*exp_f)(int, int, int, int, char, void *), void *data)
Bind a function pointer for generalized soft constraint feature (PF version)
void vrna_message_constraints_all(void)
Print structure constraint characters to stdout (full constraint support)
void vrna_sc_add_up(vrna_fold_compound *vc, const double *constraints, unsigned int options)
Add soft constraints for unpaired nucleotides.
int * en_basepair
Energy contribution for base pairs.
Definition: constraints.h:415
int * en_stack
Pseudo Energy contribution per base pair involved in a stack.
Definition: constraints.h:419
int vrna_sc_SHAPE_add_zarringhalam(vrna_fold_compound *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)
FLT_OR_DBL(* exp_f)(int, int, int, int, char, void *)
A function pointer used for pseudo energy contribution boltzmann factors in PF calculations.
Definition: constraints.h:444
void vrna_hc_free(vrna_hc_t *hc)
Free the memory allocated by a vrna_hc_t data structure.
int(* f)(int, int, int, int, char, void *)
A function pointer used for pseudo energy contribution in MFE calculations.
Definition: constraints.h:423