Hard constraints

Overview

This module covers all functionality for hard constraints in secondary structure prediction. More…

// typedefs

typedef struct vrna_hc_s vrna_hc_t
typedef struct vrna_hc_up_s vrna_hc_up_t

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

// structs

struct vrna_hc_s
struct vrna_hc_up_s

// global functions

void vrna_hc_init (vrna_fold_compound_t* vc)

void vrna_hc_add_up (
    vrna_fold_compound_t* vc,
    int i,
    unsigned 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,
    unsigned char option
    )

void vrna_hc_add_bp_nonspecific (
    vrna_fold_compound_t* vc,
    int i,
    int d,
    unsigned char option
    )

void vrna_hc_free (vrna_hc_t* hc)

int vrna_hc_add_from_db (
    vrna_fold_compound_t* vc,
    const char* constraint,
    unsigned int options
    )

// macros

#define VRNA_CONSTRAINT_CONTEXT_ALL_LOOPS
#define VRNA_CONSTRAINT_CONTEXT_EXT_LOOP
#define VRNA_CONSTRAINT_CONTEXT_HP_LOOP
#define VRNA_CONSTRAINT_CONTEXT_INT_LOOP
#define VRNA_CONSTRAINT_CONTEXT_INT_LOOP_ENC
#define VRNA_CONSTRAINT_CONTEXT_MB_LOOP
#define VRNA_CONSTRAINT_CONTEXT_MB_LOOP_ENC
#define VRNA_CONSTRAINT_DB
#define VRNA_CONSTRAINT_DB_DEFAULT
#define VRNA_CONSTRAINT_DB_DOT
#define VRNA_CONSTRAINT_DB_ENFORCE_BP
#define VRNA_CONSTRAINT_DB_GQUAD
#define VRNA_CONSTRAINT_DB_INTERMOL
#define VRNA_CONSTRAINT_DB_INTRAMOL
#define VRNA_CONSTRAINT_DB_PIPE
#define VRNA_CONSTRAINT_DB_RND_BRACK
#define VRNA_CONSTRAINT_DB_WUSS
#define VRNA_CONSTRAINT_DB_X

Detailed Documentation

This module covers all functionality for hard constraints in secondary structure prediction.

Typedefs

typedef struct vrna_hc_s vrna_hc_t
Typename for the hard constraints data structure vrna_hc_s .
typedef struct vrna_hc_up_s vrna_hc_up_t
Typename for the single nucleotide hard constraint data structure vrna_hc_up_s .
typedef unsigned char () vrna_callback_hc_evaluate (
    int i,
    int j,
    int k,
    int l,
    unsigned char d,
    void *data
    )
Callback to evaluate whether or not a particular decomposition step is contributing to the solution space.

This is the prototype for callback functions used by the folding recursions to evaluate generic hard constraints. The first four parameters passed indicate the delimiting nucleotide positions of the decomposition, and the parameter denotes the decomposition step. The last parameter data is the auxiliary data structure associated to the hard constraints via vrna_hc_add_data() , or NULL if no auxiliary data was added.

Notes on Callback Functions This callback enables one to over-rule default hard constraints in secondary structure decompositions.

Parameters:

i Left (5’) delimiter position of substructure
j Right (3’) delimiter position of substructure
k Left delimiter of decomposition
l Right delimiter of decomposition
d Decomposition step indicator
data Auxiliary data

Returns:

A non-zero value if the decomposition is valid, 0 otherwise

Global Functions

void vrna_hc_init (vrna_fold_compound_t* vc)
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.

SWIG Wrapper Notes This function is attached as method hc_init() to objects of type fold_compound

Parameters:

vc The fold compound
void vrna_hc_add_up (
    vrna_fold_compound_t* vc,
    int i,
    unsigned char option
    )
Make a certain nucleotide unpaired.

Parameters:

vc The vrna_fold_compound_t the hard constraints are associated with
i The position that needs to stay unpaired (1-based)
option The options flag indicating how/where to store the hard constraints
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.

Parameters:

vc The vrna_fold_compound_t the hard constraints are associated with
constraints The list off constraints to apply, last entry must have position attribute set to 0
void vrna_hc_add_bp (
    vrna_fold_compound_t* vc,
    int i,
    int j,
    unsigned char option
    )
Favorize/Enforce a certain base pair (i,j)

Parameters:

vc The vrna_fold_compound_t the hard constraints are associated with
i The 5’ located nucleotide position of the base pair (1-based)
j The 3’ located nucleotide position of the base pair (1-based)
option The 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,
    unsigned char option
    )
Enforce a nucleotide to be paired (upstream/downstream)

Parameters:

vc The vrna_fold_compound_t the hard constraints are associated with
i The position that needs to stay unpaired (1-based)
d The direction of base pairing ( :math:` d < 0 ` : pairs upstream, :math:` d > 0 ` : pairs downstream, :math:` d == 0 ` : no direction)
option The options flag indicating in which loop type context the pairs may appear
void vrna_hc_free (vrna_hc_t* hc)
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

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.

This function allows one to apply hard constraints from a pseudo dot-bracket notation. The options parameter controls, which characters are recognized by the parser. Use the VRNA_CONSTRAINT_DB_DEFAULT convenience macro, if you want to allow all known characters

SWIG Wrapper Notes This function is attached as method hc_add_from_db() to objects of type fold_compound

Parameters:

vc The fold compound
constraint A pseudo dot-bracket notation of the hard constraint.
options The option flags

Macros

#define VRNA_CONSTRAINT_CONTEXT_ALL_LOOPS
Constraint context flag indicating any loop context.
#define VRNA_CONSTRAINT_CONTEXT_EXT_LOOP
Hard constraints flag, base pair in the exterior loop.
#define VRNA_CONSTRAINT_CONTEXT_HP_LOOP
Hard constraints flag, base pair encloses hairpin loop.
#define VRNA_CONSTRAINT_CONTEXT_INT_LOOP
Hard constraints flag, base pair encloses an interior loop.
#define VRNA_CONSTRAINT_CONTEXT_INT_LOOP_ENC
Hard constraints flag, base pair encloses a multi branch loop.
#define VRNA_CONSTRAINT_CONTEXT_MB_LOOP
Hard constraints flag, base pair is enclosed in an interior loop.
#define VRNA_CONSTRAINT_CONTEXT_MB_LOOP_ENC
Hard constraints flag, base pair is enclosed in a multi branch loop.
#define VRNA_CONSTRAINT_DB
Flag for vrna_constraints_add() to indicate that constraint is passed in pseudo dot-bracket notation.
#define VRNA_CONSTRAINT_DB_DEFAULT
Switch for dot-bracket structure constraint with default symbols.

This flag conveniently combines all possible symbols in dot-bracket notation for hard constraints and VRNA_CONSTRAINT_DB

#define VRNA_CONSTRAINT_DB_DOT
dot ‘.’ switch for structure constraints (no constraint at all)
#define VRNA_CONSTRAINT_DB_ENFORCE_BP
Switch for dot-bracket structure constraint to enforce base pairs.

This flag should be used to really enforce base pairs given in dot-bracket constraint rather than just weakly-enforcing them.

#define VRNA_CONSTRAINT_DB_GQUAD
‘+’ switch for structure constraint (base is involved in a gquad)

Warning

This flag is for future purposes only! No implementation recognizes it yet.

#define VRNA_CONSTRAINT_DB_INTERMOL
Flag that is used to indicate the character ‘e’ in pseudo dot-bracket notation of hard constraints.

Use this definition to indicate the usage of ‘e’ character (intermolecular pairs only)

#define VRNA_CONSTRAINT_DB_INTRAMOL
Flag that is used to indicate the character ‘l’ in pseudo dot-bracket notation of hard constraints.

Use this definition to indicate the usage of ‘l’ character (intramolecular pairs only)

#define VRNA_CONSTRAINT_DB_PIPE
Flag that is used to indicate the pipe ‘|’ sign in pseudo dot-bracket notation of hard constraints.

Use this definition to indicate the pipe sign ‘|’ (paired with another base)

#define VRNA_CONSTRAINT_DB_RND_BRACK
round brackets ‘(‘,’)’ switch for structure constraint (base i pairs base j)
#define VRNA_CONSTRAINT_DB_WUSS
Flag to indicate Washington University Secondary Structure (WUSS) notation of the hard constraint string.

This secondary structure notation for RNAs is usually used as consensus secondary structure (SS_cons) entry in Stockholm formatted files

Note

See

#define VRNA_CONSTRAINT_DB_X
‘x’ switch for structure constraint (base must not pair)