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
130 #define VRNA_CONSTRAINT_MULTILINE 32U
137 #define VRNA_CONSTRAINT_NO_HEADER 64U
144 #define VRNA_CONSTRAINT_ALL 128U
154 #define VRNA_CONSTRAINT_DB 256U
164 #define VRNA_CONSTRAINT_FILE 512U
172 #define VRNA_CONSTRAINT_SOFT_MFE 8192U
180 #define VRNA_CONSTRAINT_SOFT_PF 16384U
189 #define VRNA_CONSTRAINT_CONTEXT_EXT_LOOP (char)0x01
197 #define VRNA_CONSTRAINT_CONTEXT_HP_LOOP (char)0x02
205 #define VRNA_CONSTRAINT_CONTEXT_INT_LOOP (char)0x04
213 #define VRNA_CONSTRAINT_CONTEXT_INT_LOOP_ENC (char)0x08
221 #define VRNA_CONSTRAINT_CONTEXT_MB_LOOP (char)0x10
229 #define VRNA_CONSTRAINT_CONTEXT_MB_LOOP_ENC (char)0x20
231 #define VRNA_CONSTRAINT_CONTEXT_ENFORCE (char)0x40
233 #define VRNA_CONSTRAINT_CONTEXT_NO_REMOVE (char)0x80
241 #define VRNA_CONSTRAINT_CONTEXT_ALL_LOOPS (char)( VRNA_CONSTRAINT_CONTEXT_EXT_LOOP \
242 | VRNA_CONSTRAINT_CONTEXT_HP_LOOP \
243 | VRNA_CONSTRAINT_CONTEXT_INT_LOOP \
244 | VRNA_CONSTRAINT_CONTEXT_INT_LOOP_ENC \
245 | VRNA_CONSTRAINT_CONTEXT_MB_LOOP \
246 | VRNA_CONSTRAINT_CONTEXT_MB_LOOP_ENC)
254 #define VRNA_DECOMP_PAIR_HP 1
262 #define VRNA_DECOMP_PAIR_IL 2
268 #define VRNA_DECOMP_PAIR_ML 3
274 #define VRNA_DECOMP_ML_ML_ML 5
280 #define VRNA_DECOMP_ML_UP_3 4
286 #define VRNA_DECOMP_ML_UP_5 6
292 #define VRNA_DECOMP_ML_UP 11
298 #define VRNA_DECOMP_EXT_EXT 9
304 #define VRNA_DECOMP_EXT_UP_3 7
310 #define VRNA_DECOMP_EXT_UP_5 10
316 #define VRNA_DECOMP_EXT_UP 8
322 #define VRNA_DECOMP_EXT_STEM_UP 12
338 #define VRNA_SC_GEN_MFE (char)1
353 #define VRNA_SC_GEN_PF (char)2
522 const char *constraint,
523 unsigned int options);
643 const double **constraints,
644 unsigned int options);
656 const double *constraints,
657 unsigned int options);
691 int vrna_sc_SHAPE_parse_method(
const char *method_string,
722 const double *reactivities,
725 unsigned int options);
740 const char **shape_files,
741 const int *shape_file_association,
744 unsigned int options);
767 const double *reactivities,
769 double default_value,
770 const char *shape_conversion,
771 unsigned int options);
790 double default_value);
807 int (*f)(
int,
int,
int,
int,
char,
void *),
826 FLT_OR_DBL (*exp_f)(
int,
int,
int,
int,
char,
void *),
863 #ifdef VRNA_BACKWARD_COMPAT
872 DEPRECATED(
void print_tty_constraint(
unsigned int option));
880 DEPRECATED(
void print_tty_constraint_full(
void));
894 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:404
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:432
int * up_hp
A linear array that holds the number of allowed unpaired nucleotides in a hairpin loop...
Definition: constraints.h:385
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:378
char * matrix
Upper triangular matrix encoding where a base pair or unpaired nucleotide is allowed.
Definition: constraints.h:379
int * up_int
A linear array that holds the number of allowed unpaired nucleotides in an interior loop...
Definition: constraints.h:388
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:391
void(* post)(vrna_fold_compound *, char)
A function pointer to some generalized soft constraints postprocessing function.
Definition: constraints.h:439
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:382
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:402
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:405
The most basic data structure required by many functions throughout the RNAlib.
Definition: data_structures.h:689
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:408
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:401
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:447
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)
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:403
int * en_stack
Pseudo Energy contribution per base pair involved in a stack.
Definition: constraints.h:407
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:421
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:411