RNAlib-2.2.2
constraints.h File Reference
+ Include dependency graph for constraints.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  vrna_hc_s
 The hard constraints data structure. More...
 
struct  vrna_sc_s
 The soft constraints data structure. More...
 

Macros

#define VRNA_CONSTRAINT_DB_PIPE   1U
 Flag that is used to indicate the pipe '|' sign in pseudo dot-bracket notation of hard constraints. More...
 
#define VRNA_CONSTRAINT_DB_DOT   2U
 dot '.' switch for structure constraints (no constraint at all) More...
 
#define VRNA_CONSTRAINT_DB_X   4U
 'x' switch for structure constraint (base must not pair) More...
 
#define VRNA_CONSTRAINT_DB_ANG_BRACK   8U
 angle brackets '<', '>' switch for structure constraint (paired downstream/upstream) More...
 
#define VRNA_CONSTRAINT_DB_RND_BRACK   16U
 round brackets '(',')' switch for structure constraint (base i pairs base j) More...
 
#define VRNA_CONSTRAINT_DB_INTRAMOL   2048U
 Flag that is used to indicate the character 'l' in pseudo dot-bracket notation of hard constraints. More...
 
#define VRNA_CONSTRAINT_DB_INTERMOL   4096U
 Flag that is used to indicate the character 'e' in pseudo dot-bracket notation of hard constraints. More...
 
#define VRNA_CONSTRAINT_DB_GQUAD   8192U
 '+' switch for structure constraint (base is involved in a gquad) More...
 
#define VRNA_CONSTRAINT_DB_ENFORCE_BP   16384U
 Switch for dot-bracket structure constraint to enforce base pairs. More...
 
#define VRNA_CONSTRAINT_MULTILINE   32U
 constraint may span over several lines
 
#define VRNA_CONSTRAINT_NO_HEADER   64U
 do not print the header information line
 
#define VRNA_CONSTRAINT_ALL   128U
 placeholder for all constraining characters
 
#define VRNA_CONSTRAINT_DB   256U
 Flag for vrna_constraints_add() to indicate that constraint is passed in pseudo dot-bracket notation. More...
 
#define VRNA_CONSTRAINT_FILE   512U
 Flag for vrna_constraints_add() to indicate that constraints are present in a text file. More...
 
#define VRNA_CONSTRAINT_SOFT_MFE   8192U
 Soft constraints flag, apply constraints for MFE calculations.
 
#define VRNA_CONSTRAINT_SOFT_PF   16384U
 Soft constraints flag, apply constraints for partition function calculations.
 
#define VRNA_CONSTRAINT_CONTEXT_EXT_LOOP   (char)0x01
 Hard constraints flag, base pair in the exterior loop.
 
#define VRNA_CONSTRAINT_CONTEXT_HP_LOOP   (char)0x02
 Hard constraints flag, base pair encloses hairpin loop.
 
#define VRNA_CONSTRAINT_CONTEXT_INT_LOOP   (char)0x04
 Hard constraints flag, base pair encloses an interior loop.
 
#define VRNA_CONSTRAINT_CONTEXT_INT_LOOP_ENC   (char)0x08
 Hard constraints flag, base pair encloses a multi branch loop.
 
#define VRNA_CONSTRAINT_CONTEXT_MB_LOOP   (char)0x10
 Hard constraints flag, base pair is enclosed in an interior loop.
 
#define VRNA_CONSTRAINT_CONTEXT_MB_LOOP_ENC   (char)0x20
 Hard constraints flag, base pair is enclosed in a multi branch loop.
 
#define VRNA_CONSTRAINT_CONTEXT_ALL_LOOPS
 Hard constraints flag, shortcut for all base pairs.
 
#define VRNA_DECOMP_PAIR_HP   1
 Generalized constraint folding flag indicating hairpin loop decomposition step.
 
#define VRNA_DECOMP_PAIR_IL   2
 Generalized constraint folding flag indicating interior loop decomposition step.
 

Typedefs

typedef struct vrna_hc_s vrna_hc_t
 Typename for the hard constraints data structure vrna_hc_s.
 
typedef struct vrna_sc_s vrna_sc_t
 Typename for the soft constraints data structure vrna_sc_s.
 
typedef 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 space. More...
 
typedef 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. More...
 
typedef FLT_OR_DBLvrna_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. More...
 
typedef 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. More...
 

Functions

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) More...
 
void vrna_message_constraint_options_all (void)
 Print structure constraint characters to stdout (full constraint support) More...
 
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. More...
 
void vrna_hc_init (vrna_fold_compound_t *vc)
 Initialize/Reset hard constraints to default values. More...
 
void vrna_hc_add_up (vrna_fold_compound_t *vc, int i, char option)
 Make a certain nucleotide unpaired. More...
 
void vrna_hc_add_bp (vrna_fold_compound_t *vc, int i, int j, char option)
 Favorize/Enforce a certain base pair (i,j) More...
 
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) More...
 
void vrna_hc_free (vrna_hc_t *hc)
 Free the memory allocated by a vrna_hc_t data structure. More...
 
void vrna_sc_init (vrna_fold_compound_t *vc)
 Initialize an empty soft constraints data structure within a vrna_fold_compound_t. More...
 
void vrna_sc_add_bp (vrna_fold_compound_t *vc, const FLT_OR_DBL **constraints, unsigned int options)
 Add soft constraints for paired nucleotides. More...
 
void vrna_sc_add_up (vrna_fold_compound_t *vc, const FLT_OR_DBL *constraints, unsigned int options)
 Add soft constraints for unpaired nucleotides. More...
 
void vrna_sc_remove (vrna_fold_compound_t *vc)
 Remove soft constraints from vrna_fold_compound_t. More...
 
void vrna_sc_free (vrna_sc_t *sc)
 Free memory occupied by a vrna_sc_t data structure. More...
 
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) More...
 
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 et al. method) More...
 
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) More...
 
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 parameters for conversion into pseudo free energies. More...
 
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. More...
 
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) More...
 
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. More...
 
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) More...
 
void print_tty_constraint (unsigned int option)
 Print structure constraint characters to stdout. (constraint support is specified by option parameter) More...
 
void print_tty_constraint_full (void)
 Print structure constraint characters to stdout (full constraint support) More...
 
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. More...
 

Function Documentation

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 parameters for conversion into pseudo free energies.

Parameters
method_stringThe string that contains the encoded SHAPE reactivity conversion method
methodA pointer to the memory location where the method character will be stored
param_1A pointer to the memory location where the first parameter of the corresponding method will be stored
param_2A pointer to the memory location where the second parameter of the corresponding method will be stored
Returns
1 on successful extraction of the method, 0 on errors
void print_tty_constraint ( unsigned int  option)

Print structure constraint characters to stdout. (constraint support is specified by option parameter)

Deprecated:
Use vrna_message_constraints() instead!
Parameters
optionOption switch that tells which constraint help will be printed
void print_tty_constraint_full ( void  )

Print structure constraint characters to stdout (full constraint support)

Deprecated:
Use vrna_message_constraint_options_all() instead!
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.

Deprecated:
Do not use this function anymore! Structure constraints are now handled through vrna_hc_t and related functions.
Parameters
constraintThe structure constraint string
lengthThe actual length of the sequence (constraint may be shorter)
ptypeA pointer to the basepair type array
BP(not used anymore)
min_loop_sizeThe minimal loop size (usually TURN )
idx_typeDefine the access type for base pair type array (0 = indx, 1 = iindx)