Next: , Previous: Folding Routines, Up: Folding Routines


2.1 Minimum free Energy Folding

The library provides a fast dynamic programming minimum free energy folding algorithm as described by Zuker & Stiegler (1981). Associated functions are:

— Function: float fold (char* sequence, char* structure)

folds the sequence and returns the minimum free energy in kcal/mol; the mfe structure in bracket notation (see notations) is returned in structure. Sufficient space for string of the same length as sequence must be allocated for structure before calling fold(). If fold_constrained (see Variables) is 1, the structure string is interpreted on input as a list of constraints for the folding. The characters “ | x < > “ mark bases that are paired, unpaired, paired upstream, or downstream, respectively; matching brackets “ ( ) “ denote base pairs, dots “.” are used for unconstrained bases. Constrained folding works by assigning bonus energies to all structures that comply with the constraint.

— Function: float energy_of_struct (char* sequence, char* structure)

calculates the energy of sequence on the structure

— Function: void initialize_fold (int length)

Obsolete function kept for backward compatibility. Allocates memory for mfe folding sequences not longer than length, and sets up pairing matrix and energy parameters.

— Function: void free_arrays ()

frees the memory allocated by fold().

— Function: void update_fold_params ()

call this to recalculate the pair matrix and energy parameters after a change in folding parameters like temperature (see Variables).

Prototypes for these functions are declared in fold.h.