RNAlib-2.2.4
+ Collaboration diagram for Hard Constraints:

Data Structures

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

Macros

#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_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.
 

Typedefs

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...
 

Functions

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...
 

Detailed Description


Data Structure Documentation

struct vrna_hc_s

The hard constraints data structure.

The content of this data structure determines the decomposition pattern used in the folding recursions. Attribute 'matrix' is used as source for the branching pattern of the decompositions during all folding recursions. Any entry in matrix[i,j] consists of the 6 LSB that allows to distinguish the following types of base pairs:

The four linear arrays 'up_xxx' provide the number of available unpaired nucleotides (including position i) 3' of each position in the sequence.

See also
vrna_hc_init(), vrna_hc_free(), VRNA_CONSTRAINT_CONTEXT_EXT_LOOP, VRNA_CONSTRAINT_CONTEXT_HP_LOOP, VRNA_CONSTRAINT_CONTEXT_INT_LOOP, #VRNA_CONSTRAINT_CONTEXT_EXT_LOOP_ENC, VRNA_CONSTRAINT_CONTEXT_MB_LOOP, VRNA_CONSTRAINT_CONTEXT_MB_LOOP_ENC

Data Fields

char * matrix
 Upper triangular matrix that encodes where a base pair or unpaired nucleotide is allowed.
 
int * up_ext
 A linear array that holds the number of allowed unpaired nucleotides in an exterior loop.
 
int * up_hp
 A linear array that holds the number of allowed unpaired nucleotides in a hairpin loop.
 
int * up_int
 A linear array that holds the number of allowed unpaired nucleotides in an interior loop.
 
int * up_ml
 A linear array that holds the number of allowed unpaired nucleotides in a multi branched loop.
 
vrna_callback_hc_evaluatef
 A function pointer that returns whether or not a certain decomposition may be evaluated.
 
void * data
 A pointer to some structure where the user may store necessary data to evaluate its generalized hard constraint function.
 
vrna_callback_free_auxdatafree_data
 A pointer to a function to free memory occupied by auxiliary data. More...
 

Field Documentation

vrna_callback_free_auxdata* vrna_hc_s::free_data

A pointer to a function to free memory occupied by auxiliary data.

The function this pointer is pointing to will be called upon destruction of the vrna_hc_s, and provided with the vrna_hc_s.data pointer that may hold auxiliary data. Hence, to avoid leaking memory, the user may use this pointer to free memory occupied by auxiliary data.

Typedef Documentation

typedef char( vrna_callback_hc_evaluate) (int i, int j, int k, int l, char d, void *data)

#include <ViennaRNA/constraints.h>

Callback to evaluate whether or not a particular decomposition step is contributing to the solution space.

Parameters
iLeft (5') delimiter position of substructure
jRight (3') delimiter position of substructure
k
l
dDecomposition step indicator
dataAuxiliary data
Returns
Pseudo energy contribution in deka-kalories per mol

Function Documentation

void vrna_hc_init ( vrna_fold_compound_t vc)

#include <ViennaRNA/constraints.h>

Initialize/Reset hard constraints to default values.

This function resets the hard constraints to their default values, i.e. all positions may be unpaired in all contexts, and base pairs are allowed in all contexts, if they resemble canonical pairs. Previously set hard constraints will be removed vefore initialization.

See also
vrna_hc_add_bp(), vrna_hc_add_bp_nonspecific(), vrna_hc_add_up()
Parameters
vcThe fold compound
void vrna_hc_add_up ( vrna_fold_compound_t vc,
int  i,
char  option 
)

#include <ViennaRNA/constraints.h>

Make a certain nucleotide unpaired.

See also
vrna_hc_add_bp(), vrna_hc_add_bp_nonspecific(), vrna_hc_init(), VRNA_CONSTRAINT_CONTEXT_EXT_LOOP, VRNA_CONSTRAINT_CONTEXT_HP_LOOP, VRNA_CONSTRAINT_CONTEXT_INT_LOOP, VRNA_CONSTRAINT_CONTEXT_MB_LOOP, VRNA_CONSTRAINT_CONTEXT_ALL_LOOPS
Parameters
vcThe vrna_fold_compound_t the hard constraints are associated with
iThe position that needs to stay unpaired (1-based)
optionThe options flag indicating how/where to store the hard constraints
void vrna_hc_add_bp ( vrna_fold_compound_t vc,
int  i,
int  j,
char  option 
)

#include <ViennaRNA/constraints.h>

Favorize/Enforce a certain base pair (i,j)

See also
vrna_hc_add_bp_nonspecific(), vrna_hc_add_up(), vrna_hc_init(), 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, #VRNA_CONSTRAINT_CONTEXT_ENFORCE, VRNA_CONSTRAINT_CONTEXT_ALL_LOOPS
Parameters
vcThe vrna_fold_compound_t the hard constraints are associated with
iThe 5' located nucleotide position of the base pair (1-based)
jThe 3' located nucleotide position of the base pair (1-based)
optionThe options flag indicating how/where to store the hard constraints
void vrna_hc_add_bp_nonspecific ( vrna_fold_compound_t vc,
int  i,
int  d,
char  option 
)

#include <ViennaRNA/constraints.h>

Enforce a nucleotide to be paired (upstream/downstream)

See also
vrna_hc_add_bp(), vrna_hc_add_up(), vrna_hc_init(), 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, VRNA_CONSTRAINT_CONTEXT_ALL_LOOPS
Parameters
vcThe vrna_fold_compound_t the hard constraints are associated with
iThe position that needs to stay unpaired (1-based)
dThe direction of base pairing ( $ d < 0 $: pairs upstream, $ d > 0 $: pairs downstream, $ d == 0 $: no direction)
optionThe options flag indicating in which loop type context the pairs may appear
void vrna_hc_free ( vrna_hc_t hc)

#include <ViennaRNA/constraints.h>

Free the memory allocated by a vrna_hc_t data structure.

Use this function to free all memory that was allocated for a data structure of type vrna_hc_t .

See also
get_hard_constraints(), vrna_hc_t