1 #ifndef VIENNA_RNA_PACKAGE_CONSTRAINTS_HARD_H
2 #define VIENNA_RNA_PACKAGE_CONSTRAINTS_HARD_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
76 #define VRNA_CONSTRAINT_NO_HEADER 0
86 #define VRNA_CONSTRAINT_DB 16384U
99 #define VRNA_CONSTRAINT_DB_ENFORCE_BP 32768U
112 #define VRNA_CONSTRAINT_DB_PIPE 65536U
122 #define VRNA_CONSTRAINT_DB_DOT 131072U
131 #define VRNA_CONSTRAINT_DB_X 262144U
138 #define VRNA_CONSTRAINT_DB_ANG_BRACK 524288U
147 #define VRNA_CONSTRAINT_DB_RND_BRACK 1048576U
160 #define VRNA_CONSTRAINT_DB_INTRAMOL 2097152U
173 #define VRNA_CONSTRAINT_DB_INTERMOL 4194304U
185 #define VRNA_CONSTRAINT_DB_GQUAD 8388608U
198 #define VRNA_CONSTRAINT_DB_DEFAULT \
199 ( VRNA_CONSTRAINT_DB \
200 | VRNA_CONSTRAINT_DB_PIPE \
201 | VRNA_CONSTRAINT_DB_DOT \
202 | VRNA_CONSTRAINT_DB_X \
203 | VRNA_CONSTRAINT_DB_ANG_BRACK \
204 | VRNA_CONSTRAINT_DB_RND_BRACK \
205 | VRNA_CONSTRAINT_DB_INTRAMOL \
206 | VRNA_CONSTRAINT_DB_INTERMOL \
207 | VRNA_CONSTRAINT_DB_GQUAD \
216 #define VRNA_CONSTRAINT_CONTEXT_EXT_LOOP (char)0x01
224 #define VRNA_CONSTRAINT_CONTEXT_HP_LOOP (char)0x02
232 #define VRNA_CONSTRAINT_CONTEXT_INT_LOOP (char)0x04
240 #define VRNA_CONSTRAINT_CONTEXT_INT_LOOP_ENC (char)0x08
248 #define VRNA_CONSTRAINT_CONTEXT_MB_LOOP (char)0x10
256 #define VRNA_CONSTRAINT_CONTEXT_MB_LOOP_ENC (char)0x20
258 #define VRNA_CONSTRAINT_CONTEXT_ENFORCE (char)0x40
260 #define VRNA_CONSTRAINT_CONTEXT_NO_REMOVE (char)0x80
268 #define VRNA_CONSTRAINT_CONTEXT_ALL_LOOPS (char)( VRNA_CONSTRAINT_CONTEXT_EXT_LOOP \
269 | VRNA_CONSTRAINT_CONTEXT_HP_LOOP \
270 | VRNA_CONSTRAINT_CONTEXT_INT_LOOP \
271 | VRNA_CONSTRAINT_CONTEXT_INT_LOOP_ENC \
272 | VRNA_CONSTRAINT_CONTEXT_MB_LOOP \
273 | VRNA_CONSTRAINT_CONTEXT_MB_LOOP_ENC)
533 const char *constraint,
534 unsigned int options);
537 #ifdef VRNA_BACKWARD_COMPAT
568 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.
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.
int * up_hp
A linear array that holds the number of allowed unpaired nucleotides in a hairpin loop...
Definition: constraints_hard.h:307
char options
The hard constraint option.
Definition: constraints_hard.h:345
int vrna_hc_add_from_db(vrna_fold_compound_t *vc, const char *constraint, unsigned int options)
Add hard constraints from pseudo dot-bracket notation.
The most basic data structure required by many functions throughout the RNAlib.
Definition: data_structures.h:390
char * matrix
Upper triangular matrix that encodes where a base pair or unpaired nucleotide is allowed.
Definition: constraints_hard.h:301
void print_tty_constraint_full(void)
Print structure constraint characters to stdout (full constraint support)
int * up_ml
A linear array that holds the number of allowed unpaired nucleotides in a multi branched loop...
Definition: constraints_hard.h:313
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_hard.h:69
void vrna_message_constraint_options_all(void)
Print structure constraint characters to stdout (full constraint support)
A single hard constraint for a single nucleotide.
Definition: constraints_hard.h:343
vrna_callback_hc_evaluate * f
A function pointer that returns whether or not a certain decomposition may be evaluated.
Definition: constraints_hard.h:317
void * data
A pointer to some structure where the user may store necessary data to evaluate its generic hard cons...
Definition: constraints_hard.h:321
void( vrna_callback_free_auxdata)(void *data)
Callback to free memory allocated for auxiliary user-provided data.
Definition: data_structures.h:51
The hard constraints data structure.
Definition: constraints_hard.h:300
int * up_ext
A linear array that holds the number of allowed unpaired nucleotides in an exterior loop...
Definition: constraints_hard.h:304
int vrna_hc_add_up_batch(vrna_fold_compound_t *vc, vrna_hc_up_t *constraints)
Apply a list of hard constraints for single nucleotides.
int * up_int
A linear array that holds the number of allowed unpaired nucleotides in an interior loop...
Definition: constraints_hard.h:310
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 print_tty_constraint(unsigned int option)
Print structure constraint characters to stdout. (constraint support is specified by option parameter...
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_hard.h:326
int position
The sequence position (1-based)
Definition: constraints_hard.h:344
void vrna_hc_init(vrna_fold_compound_t *vc)
Initialize/Reset hard constraints to default values.
void vrna_hc_free(vrna_hc_t *hc)
Free the memory allocated by a vrna_hc_t data structure.