RNAlib-2.2.0RC0
|
This section provides information about all functions and variables related to the calculation of the partition function and base pair probabilities. More...
Modules | |
Compute the structure with maximum expected accuracy (MEA) | |
Compute the centroid structure | |
Partition Function for two hybridized Sequences | |
Partition Function Cofolding. | |
Partition Function for two hybridized Sequences as a stepwise Process | |
Partition Function Cofolding as a stepwise process. | |
Partition Function and Base Pair Probabilities for Sequence Alignment(s) | |
Partition functions for locally stable secondary structures | |
Calculate Partition Functions of a Distance Based Partitioning | |
Compute the partition function and stochastically sample secondary structures for a partitioning of the secondary structure space according to the base pair distance to two fixed reference structures. | |
Files | |
file | part_func.h |
Partition function of single RNA sequences. | |
Functions | |
float | vrna_pf_fold (vrna_fold_compound *vc, char *structure) |
Compute the partition function ![]() | |
float | pf_fold_par (const char *sequence, char *structure, pf_paramT *parameters, int calculate_bppm, int is_constrained, int is_circular) |
Compute the partition function ![]() | |
float | pf_fold (const char *sequence, char *structure) |
Compute the partition function ![]() | |
float | pf_circ_fold (const char *sequence, char *structure) |
Compute the partition function of a circular RNA sequence. More... | |
void | free_pf_arrays (void) |
Free arrays for the partition function recursions. More... | |
void | update_pf_params (int length) |
Recalculate energy parameters. More... | |
void | update_pf_params_par (int length, pf_paramT *parameters) |
Recalculate energy parameters. More... | |
void | vrna_update_pf_params (vrna_fold_compound *vc, pf_paramT *params) |
Update the energy parameters for subsequent partition function computations. More... | |
void | vrna_rescale_pf_params (vrna_fold_compound *vc, double *mfe) |
Rescale Boltzmann factors for partition function computations. More... | |
FLT_OR_DBL * | export_bppm (void) |
Get a pointer to the base pair probability arrayAccessing the base pair probabilities for a pair (i,j) is achieved by. More... | |
int | get_pf_arrays (short **S_p, short **S1_p, char **ptype_p, FLT_OR_DBL **qb_p, FLT_OR_DBL **qm_p, FLT_OR_DBL **q1k_p, FLT_OR_DBL **qln_p) |
Get the pointers to (almost) all relavant computation arrays used in partition function computation. More... | |
double | mean_bp_distance (int length) |
Get the mean base pair distance of the last partition function computation. More... | |
double | mean_bp_distance_pr (int length, FLT_OR_DBL *pr) |
Get the mean base pair distance in the thermodynamic ensemble. More... | |
double | vrna_mean_bp_distance_pr (int length, FLT_OR_DBL *pr) |
Get the mean base pair distance in the thermodynamic ensemble from a probability matrix. More... | |
double | vrna_mean_bp_distance (vrna_fold_compound *vc) |
Get the mean base pair distance in the thermodynamic ensemble. More... | |
plist * | vrna_get_plist_from_pr (vrna_fold_compound *vc, double cut_off) |
Create a plist from base pair probability matrix. More... | |
void | assign_plist_from_pr (plist **pl, FLT_OR_DBL *probs, int length, double cutoff) |
Create a plist from a probability matrix. More... | |
This section provides information about all functions and variables related to the calculation of the partition function and base pair probabilities.
Instead of the minimum free energy structure the partition function of all possible structures and from that the pairing probability for every possible pair can be calculated, using a dynamic programming algorithm as described in [10].
float vrna_pf_fold | ( | vrna_fold_compound * | vc, |
char * | structure | ||
) |
Compute the partition function for a given RNA sequence.
If structure is not a NULL pointer on input, it contains on return a string consisting of the letters " . , | { } ( ) " denoting bases that are essentially unpaired, weakly paired, strongly paired without preference, weakly upstream (downstream) paired, or strongly up- (down-)stream paired bases, respectively. If fold_constrained is not 0, the structure string is interpreted on input as a list of constraints for the folding. The character "x" marks bases that must be unpaired, matching brackets " ( ) " denote base pairs, all other characters are ignored. Any pairs conflicting with the constraint will be forbidden. This is usually sufficient to ensure the constraints are honored. If the parameter calculate_bppm is set to 0 base pairing probabilities will not be computed (saving CPU time), otherwise after calculations took place pr will contain the probability that bases i and j pair.
[in,out] | vc | The fold compound data structure |
[in,out] | structure | A pointer to a char array where a base pair probability information can be stored in a pseudo-dot-bracket notation (may be NULL, too) |
float pf_fold_par | ( | const char * | sequence, |
char * | structure, | ||
pf_paramT * | parameters, | ||
int | calculate_bppm, | ||
int | is_constrained, | ||
int | is_circular | ||
) |
Compute the partition function for a given RNA sequence.
If structure is not a NULL pointer on input, it contains on return a string consisting of the letters " . , | { } ( ) " denoting bases that are essentially unpaired, weakly paired, strongly paired without preference, weakly upstream (downstream) paired, or strongly up- (down-)stream paired bases, respectively. If fold_constrained is not 0, the structure string is interpreted on input as a list of constraints for the folding. The character "x" marks bases that must be unpaired, matching brackets " ( ) " denote base pairs, all other characters are ignored. Any pairs conflicting with the constraint will be forbidden. This is usually sufficient to ensure the constraints are honored. If the parameter calculate_bppm is set to 0 base pairing probabilities will not be computed (saving CPU time), otherwise after calculations took place pr will contain the probability that bases i and j pair.
[in] | sequence | The RNA sequence input |
[in,out] | structure | A pointer to a char array where a base pair probability information can be stored in a pseudo-dot-bracket notation (may be NULL, too) |
[in] | parameters | Data structure containing the precalculated Boltzmann factors |
[in] | calculate_bppm | Switch to Base pair probability calculations on/off (0==off) |
[in] | is_constrained | Switch to indicate that a structure contraint is passed via the structure argument (0==off) |
[in] | is_circular | Switch to (de-)activate postprocessing steps in case RNA sequence is circular (0==off) |
float pf_fold | ( | const char * | sequence, |
char * | structure | ||
) |
Compute the partition function of an RNA sequence.
If structure is not a NULL pointer on input, it contains on return a string consisting of the letters " . , | { } ( ) " denoting bases that are essentially unpaired, weakly paired, strongly paired without preference, weakly upstream (downstream) paired, or strongly up- (down-)stream paired bases, respectively. If fold_constrained is not 0, the structure string is interpreted on input as a list of constraints for the folding. The character "x" marks bases that must be unpaired, matching brackets " ( ) " denote base pairs, all other characters are ignored. Any pairs conflicting with the constraint will be forbidden. This is usually sufficient to ensure the constraints are honored. If do_backtrack has been set to 0 base pairing probabilities will not be computed (saving CPU time), otherwise pr will contain the probability that bases i and j pair.
sequence | The RNA sequence input |
structure | A pointer to a char array where a base pair probability information can be stored in a pseudo-dot-bracket notation (may be NULL, too) |
float pf_circ_fold | ( | const char * | sequence, |
char * | structure | ||
) |
Compute the partition function of a circular RNA sequence.
[in] | sequence | The RNA sequence input |
[in,out] | structure | A pointer to a char array where a base pair probability information can be stored in a pseudo-dot-bracket notation (may be NULL, too) |
void free_pf_arrays | ( | void | ) |
Free arrays for the partition function recursions.
Call this function if you want to free all allocated memory associated with the partition function forward recursion.
void update_pf_params | ( | int | length | ) |
Recalculate energy parameters.
Call this function to recalculate the pair matrix and energy parameters after a change in folding parameters like temperature
void update_pf_params_par | ( | int | length, |
pf_paramT * | parameters | ||
) |
Recalculate energy parameters.
void vrna_update_pf_params | ( | vrna_fold_compound * | vc, |
pf_paramT * | params | ||
) |
Update the energy parameters for subsequent partition function computations.
This function can be used to properly assign new energy parameters to a vrna_fold_compound. For this purpose, the data of the provided pointer params
will be copied into vc
and a recomputation of the partition function scaling factor is issued, if the pf_scale
attribute of params
is below 1.0
.
vc | The fold compound data structure |
params | A pointer to the new energy parameters |
void vrna_rescale_pf_params | ( | vrna_fold_compound * | vc, |
double * | mfe | ||
) |
Rescale Boltzmann factors for partition function computations.
This function may be used to (automatically) rescale the Boltzmann factors used in partition function computations. Since partition functions over subsequences can easily become extremely large, the RNAlib internally rescales them to avoid numerical over- and/or underflow. Therefore, a proper scaling factor needs to be chosen that in turn is then used to normalize the corresponding partition functions
.
This function provides two ways to automatically adjust the scaling factor.
Passing NULL
as second parameter activates the automatic guess mode. Here, the scaling factor is recomputed according to a mean free energy of 184.3*length
cal for random sequences.
pf_scale
attribute of the exp_params
datastructure contained in vc
has a value below 1.0
.On the other hand, if the MFE for a sequence is known, it can be used to recompute a more robust scaling factor, since it represents the lowest free energy of the entire ensemble of structures, i.e. the highest Boltzmann factor. To activate this second mode of automatic adjustment according to MFE, a pointer to the MFE value needs to be passed as second argument. This value is then taken to compute the scaling factor as , where sfact is an additional scaling weight located in the model_detailsT datastructure of
exp_params
in vc
.
The computed scaling factor will be stored as
pf_scale
attribute of the exp_params
datastructure in vc
.
vc | The fold compound data structure |
mfe | A pointer to the MFE (in kcal/mol) or NULL |
FLT_OR_DBL* export_bppm | ( | void | ) |
Get a pointer to the base pair probability arrayAccessing the base pair probabilities for a pair (i,j) is achieved by.
int get_pf_arrays | ( | short ** | S_p, |
short ** | S1_p, | ||
char ** | ptype_p, | ||
FLT_OR_DBL ** | qb_p, | ||
FLT_OR_DBL ** | qm_p, | ||
FLT_OR_DBL ** | q1k_p, | ||
FLT_OR_DBL ** | qln_p | ||
) |
Get the pointers to (almost) all relavant computation arrays used in partition function computation.
[out] | S_p | A pointer to the 'S' array (integer representation of nucleotides) |
[out] | S1_p | A pointer to the 'S1' array (2nd integer representation of nucleotides) |
[out] | ptype_p | A pointer to the pair type matrix |
[out] | qb_p | A pointer to the QB matrix |
[out] | qm_p | A pointer to the QM matrix |
[out] | q1k_p | A pointer to the 5' slice of the Q matrix ( ![]() |
[out] | qln_p | A pointer to the 3' slice of the Q matrix ( ![]() |
double mean_bp_distance | ( | int | length | ) |
Get the mean base pair distance of the last partition function computation.
length |
double mean_bp_distance_pr | ( | int | length, |
FLT_OR_DBL * | pr | ||
) |
Get the mean base pair distance in the thermodynamic ensemble.
This is a threadsafe implementation of mean_bp_dist() !
this can be computed from the pair probs as
length | The length of the sequence |
pr | The matrix containing the base pair probabilities |
double vrna_mean_bp_distance_pr | ( | int | length, |
FLT_OR_DBL * | pr | ||
) |
Get the mean base pair distance in the thermodynamic ensemble from a probability matrix.
this can be computed from the pair probs as
length | The length of the sequence |
pr | The matrix containing the base pair probabilities |
double vrna_mean_bp_distance | ( | vrna_fold_compound * | vc | ) |
Get the mean base pair distance in the thermodynamic ensemble.
this can be computed from the pair probs as
vc | The fold compound data structure |
plist* vrna_get_plist_from_pr | ( | vrna_fold_compound * | vc, |
double | cut_off | ||
) |
Create a plist from base pair probability matrix.
The probability matrix provided via the vrna_fold_compound is parsed and all pair probabilities above the given threshold are used to create an entry in the plist
The end of the plist is marked by sequence positions i as well as j equal to 0. This condition should be used to stop looping over its entries
[in] | vc | The fold compound |
[in] | cutoff | The cutoff value |
void assign_plist_from_pr | ( | plist ** | pl, |
FLT_OR_DBL * | probs, | ||
int | length, | ||
double | cutoff | ||
) |
Create a plist from a probability matrix.
The probability matrix given is parsed and all pair probabilities above the given threshold are used to create an entry in the plist
The end of the plist is marked by sequence positions i as well as j equal to 0. This condition should be used to stop looping over its entries
[out] | pl | A pointer to the plist that is to be created |
[in] | probs | The probability matrix used for creting the plist |
[in] | length | The length of the RNA sequence |
[in] | cutoff | The cutoff value |