constraints_hard.h
Go to the documentation of this file.
#ifndef VIENNA_RNA_PACKAGE_CONSTRAINTS_HARD_H
#define VIENNA_RNA_PACKAGE_CONSTRAINTS_HARD_H
#ifdef DEPRECATION_WARNINGS
# ifdef __GNUC__
# define DEPRECATED(func) func __attribute__ ((deprecated))
# else
# define DEPRECATED(func) func
# endif
#else
# define DEPRECATED(func) func
#endif
/* make this interface backward compatible with RNAlib < 2.2.0 */
#define VRNA_BACKWARD_COMPAT
#include <ViennaRNA/data_structures.h>
typedef struct vrna_hc_s vrna_hc_t;
typedef struct vrna_hc_up_s vrna_hc_up_t;
typedef char (vrna_callback_hc_evaluate)(int i, int j, int k, int l, char d, void *data);
#define VRNA_CONSTRAINT_NO_HEADER 0
#define VRNA_CONSTRAINT_DB 16384U
#define VRNA_CONSTRAINT_DB_ENFORCE_BP 32768U
#define VRNA_CONSTRAINT_DB_PIPE 65536U
#define VRNA_CONSTRAINT_DB_DOT 131072U
#define VRNA_CONSTRAINT_DB_X 262144U
#define VRNA_CONSTRAINT_DB_ANG_BRACK 524288U
#define VRNA_CONSTRAINT_DB_RND_BRACK 1048576U
#define VRNA_CONSTRAINT_DB_INTRAMOL 2097152U
#define VRNA_CONSTRAINT_DB_INTERMOL 4194304U
#define VRNA_CONSTRAINT_DB_GQUAD 8388608U
#define VRNA_CONSTRAINT_DB_DEFAULT \
( VRNA_CONSTRAINT_DB \
| VRNA_CONSTRAINT_DB_PIPE \
| VRNA_CONSTRAINT_DB_DOT \
| VRNA_CONSTRAINT_DB_X \
| VRNA_CONSTRAINT_DB_ANG_BRACK \
| VRNA_CONSTRAINT_DB_RND_BRACK \
| VRNA_CONSTRAINT_DB_INTRAMOL \
| VRNA_CONSTRAINT_DB_INTERMOL \
| VRNA_CONSTRAINT_DB_GQUAD \
)
#define VRNA_CONSTRAINT_CONTEXT_EXT_LOOP (char)0x01
#define VRNA_CONSTRAINT_CONTEXT_HP_LOOP (char)0x02
#define VRNA_CONSTRAINT_CONTEXT_INT_LOOP (char)0x04
#define VRNA_CONSTRAINT_CONTEXT_INT_LOOP_ENC (char)0x08
#define VRNA_CONSTRAINT_CONTEXT_MB_LOOP (char)0x10
#define VRNA_CONSTRAINT_CONTEXT_MB_LOOP_ENC (char)0x20
#define VRNA_CONSTRAINT_CONTEXT_ENFORCE (char)0x40
#define VRNA_CONSTRAINT_CONTEXT_NO_REMOVE (char)0x80
#define VRNA_CONSTRAINT_CONTEXT_ALL_LOOPS (char)( VRNA_CONSTRAINT_CONTEXT_EXT_LOOP \
| VRNA_CONSTRAINT_CONTEXT_HP_LOOP \
| VRNA_CONSTRAINT_CONTEXT_INT_LOOP \
| VRNA_CONSTRAINT_CONTEXT_INT_LOOP_ENC \
| VRNA_CONSTRAINT_CONTEXT_MB_LOOP \
| VRNA_CONSTRAINT_CONTEXT_MB_LOOP_ENC)
struct vrna_hc_s {
char *matrix;
int *up_ext;
int *up_hp;
int *up_int;
int *up_ml;
vrna_callback_hc_evaluate *f;
void *data;
vrna_callback_free_auxdata *free_data;
};
struct vrna_hc_up_s {
int position;
char options;
};
void vrna_message_constraint_options(unsigned int option);
void vrna_message_constraint_options_all(void);
void vrna_hc_init(vrna_fold_compound_t *vc);
void vrna_hc_add_up(vrna_fold_compound_t *vc,
int i,
char option);
int
vrna_hc_add_up_batch( vrna_fold_compound_t *vc,
vrna_hc_up_t *constraints);
void vrna_hc_add_bp(vrna_fold_compound_t *vc,
int i,
int j,
char option);
void vrna_hc_add_bp_nonspecific(vrna_fold_compound_t *vc,
int i,
int d,
char option);
void vrna_hc_free(vrna_hc_t *hc);
#ifdef WITH_GEN_HC
void vrna_hc_add_f( vrna_fold_compound_t *vc,
vrna_callback_hc_evaluate *f);
void vrna_hc_add_data(vrna_fold_compound_t *vc,
void *data,
vrna_callback_free_auxdata *f);
#endif
int
vrna_hc_add_from_db(vrna_fold_compound_t *vc,
const char *constraint,
unsigned int options);
#ifdef VRNA_BACKWARD_COMPAT
DEPRECATED(void print_tty_constraint(unsigned int option));
DEPRECATED(void print_tty_constraint_full(void));
DEPRECATED(void constrain_ptypes(const char *constraint, unsigned int length, char *ptype, int *BP, int min_loop_size, unsigned int idx_type));
#endif
#endif
vrna_hc_add_up
void vrna_hc_add_up(vrna_fold_compound_t *vc, int i, char option)
Make a certain nucleotide unpaired.
constrain_ptypes
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.
vrna_hc_s::up_hp
int * up_hp
A linear array that holds the number of allowed unpaired nucleotides in a hairpin loop...
Definition: constraints_hard.h:307
vrna_hc_up_s::options
char options
The hard constraint option.
Definition: constraints_hard.h:345
vrna_hc_add_from_db
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.
vrna_fc_s
The most basic data structure required by many functions throughout the RNAlib.
Definition: data_structures.h:390
vrna_hc_s::matrix
char * matrix
Upper triangular matrix that encodes where a base pair or unpaired nucleotide is allowed.
Definition: constraints_hard.h:301
print_tty_constraint_full
void print_tty_constraint_full(void)
Print structure constraint characters to stdout (full constraint support)
vrna_hc_s::up_ml
int * up_ml
A linear array that holds the number of allowed unpaired nucleotides in a multi branched loop...
Definition: constraints_hard.h:313
vrna_hc_add_bp
void vrna_hc_add_bp(vrna_fold_compound_t *vc, int i, int j, char option)
Favorize/Enforce a certain base pair (i,j)
vrna_callback_hc_evaluate
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
vrna_message_constraint_options_all
void vrna_message_constraint_options_all(void)
Print structure constraint characters to stdout (full constraint support)
data_structures.h
vrna_hc_up_s
A single hard constraint for a single nucleotide.
Definition: constraints_hard.h:343
vrna_hc_s::f
vrna_callback_hc_evaluate * f
A function pointer that returns whether or not a certain decomposition may be evaluated.
Definition: constraints_hard.h:317
vrna_hc_s::data
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
vrna_callback_free_auxdata
void( vrna_callback_free_auxdata)(void *data)
Callback to free memory allocated for auxiliary user-provided data.
Definition: data_structures.h:51
vrna_hc_s
The hard constraints data structure.
Definition: constraints_hard.h:300
vrna_hc_s::up_ext
int * up_ext
A linear array that holds the number of allowed unpaired nucleotides in an exterior loop...
Definition: constraints_hard.h:304
vrna_hc_add_up_batch
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.
vrna_hc_s::up_int
int * up_int
A linear array that holds the number of allowed unpaired nucleotides in an interior loop...
Definition: constraints_hard.h:310
vrna_hc_add_bp_nonspecific
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)
print_tty_constraint
void print_tty_constraint(unsigned int option)
Print structure constraint characters to stdout. (constraint support is specified by option parameter...
vrna_message_constraint_options
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_hc_s::free_data
vrna_callback_free_auxdata * free_data
A pointer to a function to free memory occupied by auxiliary data.
Definition: constraints_hard.h:326
vrna_hc_up_s::position
int position
The sequence position (1-based)
Definition: constraints_hard.h:344
vrna_hc_init
void vrna_hc_init(vrna_fold_compound_t *vc)
Initialize/Reset hard constraints to default values.
vrna_hc_free
void vrna_hc_free(vrna_hc_t *hc)
Free the memory allocated by a vrna_hc_t data structure.