Partition Function and Equilibrium Probabilities#
Basic Partition Function API#
Functions
-
int vrna_pf_float_precision(void)#
Find out whether partition function computations are using single precision floating points.
#include <ViennaRNA/partfunc/global.h>
See also
- Returns:
1 if single precision is used, 0 otherwise
-
int vrna_pf_float_precision(void)#
Global Partition Function#
Basic global partition function interface
-
FLT_OR_DBL vrna_pf(vrna_fold_compound_t *fc, char *structure)#
Compute the partition function \(Q\) for a given RNA sequence, or sequence alignment.
#include <ViennaRNA/partfunc/global.h>
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 the model’s compute_bpp 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.
- SWIG Wrapper Notes:
This function is attached as method
pf()to objects of typefold_compound. See, e.g.RNA.fold_compound.pf()in the The RNA Python module.
See also
vrna_fold_compound_t, vrna_fold_compound(), vrna_pf_fold(), vrna_pf_circfold(), vrna_fold_compound_comparative(), vrna_pf_alifold(), vrna_pf_circalifold(), vrna_db_from_probs(), vrna_exp_params(), vrna_aln_pinfo()
Note
This function is polymorphic. It accepts vrna_fold_compound_t of type VRNA_FC_TYPE_SINGLE, and VRNA_FC_TYPE_COMPARATIVE. Also, this function may return INF / 100. in case of contradicting constraints or numerical over-/underflow. In the latter case, a corresponding warning will be issued to
stdout.- Parameters:
fc – [inout] The fold compound data structure
structure – [inout] A pointer to the character array where position-wise pairing propensity will be stored. (Maybe NULL)
- Returns:
The ensemble free energy \(G = -RT \cdot \log(Q) \) in kcal/mol
-
vrna_dimer_pf_t vrna_pf_dimer(vrna_fold_compound_t *fc, char *structure)#
Calculate partition function and base pair probabilities of nucleic acid/nucleic acid dimers.
#include <ViennaRNA/partfunc/global.h>
This is the cofold partition function folding.
- SWIG Wrapper Notes:
This function is attached as method
pf_dimer()to objects of typefold_compound. See, e.g.RNA.fold_compound.pf_dimer()in the The RNA Python module.
See also
vrna_fold_compound() for how to retrieve the necessary data structure
Note
This function may return INF / 100. for the
FA,FB,FAB,F0ABmembers of the output data structure in case of contradicting constraints or numerical over-/underflow. In the latter case, a corresponding warning will be issued tostdout.- Parameters:
fc – the fold compound data structure
structure – Will hold the structure or constraints
- Returns:
vrna_dimer_pf_t structure containing a set of energies needed for concentration computations.
-
FLT_OR_DBL *vrna_pf_substrands(vrna_fold_compound_t *fc, size_t complex_size)#
#include <ViennaRNA/partfunc/global.h>
-
FLT_OR_DBL vrna_pf_add(FLT_OR_DBL dG1, FLT_OR_DBL dG2, double kT)#
#include <ViennaRNA/partfunc/global.h>
Simplified global partition function computation using sequence(s) or multiple sequence alignment(s)
-
float vrna_pf_fold(const char *sequence, char *structure, vrna_ep_t **pl)#
Compute Partition function \(Q\) (and base pair probabilities) for an RNA sequence using a comparative method.
#include <ViennaRNA/partfunc/global.h>
This simplified interface to vrna_pf() computes the partition function and, if required, base pair probabilities for an RNA sequence using default options. Memory required for dynamic programming (DP) matrices will be allocated and free’d on-the-fly. Hence, after return of this function, the recursively filled matrices are not available any more for any post-processing.
Note
In case you want to use the filled DP matrices for any subsequent post-processing step, or you require other conditions than specified by the default model details, use vrna_pf(), and the data structure vrna_fold_compound_t instead.
- Parameters:
sequence – RNA sequence
structure – A pointer to the character array where position-wise pairing propensity will be stored. (Maybe NULL)
pl – A pointer to a list of vrna_ep_t to store pairing probabilities (Maybe NULL)
- Returns:
The ensemble free energy \(G = -RT \cdot \log(Q) \) in kcal/mol
-
float vrna_pf_circfold(const char *sequence, char *structure, vrna_ep_t **pl)#
Compute Partition function \(Q\) (and base pair probabilities) for a circular RNA sequences using a comparative method.
#include <ViennaRNA/partfunc/global.h>
This simplified interface to vrna_pf() computes the partition function and, if required, base pair probabilities for a circular RNA sequence using default options. Memory required for dynamic programming (DP) matrices will be allocated and free’d on-the-fly. Hence, after return of this function, the recursively filled matrices are not available any more for any post-processing.
Folding of circular RNA sequences is handled as a post-processing step of the forward recursions. See Hofacker and Stadler [2006] for further details.
Note
In case you want to use the filled DP matrices for any subsequent post-processing step, or you require other conditions than specified by the default model details, use vrna_pf(), and the data structure vrna_fold_compound_t instead.
- Parameters:
sequence – A circular RNA sequence
structure – A pointer to the character array where position-wise pairing propensity will be stored. (Maybe NULL)
pl – A pointer to a list of vrna_ep_t to store pairing probabilities (Maybe NULL)
- Returns:
The ensemble free energy \(G = -RT \cdot \log(Q) \) in kcal/mol
-
float vrna_pf_alifold(const char **sequences, char *structure, vrna_ep_t **pl)#
Compute Partition function \(Q\) (and base pair probabilities) for an RNA sequence alignment using a comparative method.
#include <ViennaRNA/partfunc/global.h>
This simplified interface to vrna_pf() computes the partition function and, if required, base pair probabilities for an RNA sequence alignment using default options. Memory required for dynamic programming (DP) matrices will be allocated and free’d on-the-fly. Hence, after return of this function, the recursively filled matrices are not available any more for any post-processing.
Note
In case you want to use the filled DP matrices for any subsequent post-processing step, or you require other conditions than specified by the default model details, use vrna_pf(), and the data structure vrna_fold_compound_t instead.
- Parameters:
sequences – RNA sequence alignment
structure – A pointer to the character array where position-wise pairing propensity will be stored. (Maybe NULL)
pl – A pointer to a list of vrna_ep_t to store pairing probabilities (Maybe NULL)
- Returns:
The ensemble free energy \(G = -RT \cdot \log(Q) \) in kcal/mol
-
float vrna_pf_circalifold(const char **sequences, char *structure, vrna_ep_t **pl)#
Compute Partition function \(Q\) (and base pair probabilities) for an alignment of circular RNA sequences using a comparative method.
#include <ViennaRNA/partfunc/global.h>
This simplified interface to vrna_pf() computes the partition function and, if required, base pair probabilities for an RNA sequence alignment using default options. Memory required for dynamic programming (DP) matrices will be allocated and free’d on-the-fly. Hence, after return of this function, the recursively filled matrices are not available any more for any post-processing.
Folding of circular RNA sequences is handled as a post-processing step of the forward recursions. See Hofacker and Stadler [2006] for further details.
Note
In case you want to use the filled DP matrices for any subsequent post-processing step, or you require other conditions than specified by the default model details, use vrna_pf(), and the data structure vrna_fold_compound_t instead.
- Parameters:
sequences – Sequence alignment of circular RNAs
structure – A pointer to the character array where position-wise pairing propensity will be stored. (Maybe NULL)
pl – A pointer to a list of vrna_ep_t to store pairing probabilities (Maybe NULL)
- Returns:
The ensemble free energy \(G = -RT \cdot \log(Q) \) in kcal/mol
-
vrna_dimer_pf_t vrna_pf_co_fold(const char *seq, char *structure, vrna_ep_t **pl)#
Calculate partition function and base pair probabilities of nucleic acid/nucleic acid dimers.
#include <ViennaRNA/partfunc/global.h>
This simplified interface to vrna_pf_dimer() computes the partition function and, if required, base pair probabilities for an RNA-RNA interaction using default options. Memory required for dynamic programming (DP) matrices will be allocated and free’d on-the-fly. Hence, after return of this function, the recursively filled matrices are not available any more for any post-processing.
See also
Note
In case you want to use the filled DP matrices for any subsequent post-processing step, or you require other conditions than specified by the default model details, use vrna_pf_dimer(), and the data structure vrna_fold_compound_t instead.
- Parameters:
seq – Two concatenated RNA sequences with a delimiting ‘&’ in between
structure – A pointer to the character array where position-wise pairing propensity will be stored. (Maybe NULL)
pl – A pointer to a list of vrna_ep_t to store pairing probabilities (Maybe NULL)
- Returns:
vrna_dimer_pf_t structure containing a set of energies needed for concentration computations.
Functions
-
vrna_ep_t *vrna_plist_from_probs(vrna_fold_compound_t *fc, double cut_off)#
Create a vrna_ep_t from base pair probability matrix.
#include <ViennaRNA/structures/problist.h>
The probability matrix provided via the vrna_fold_compound_t 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
- Parameters:
fc – [in] The fold compound
cut_off – [in] The cutoff value
- Returns:
A pointer to the plist that is to be created
-
struct vrna_dimer_pf_s#
- #include <ViennaRNA/partfunc/global.h>
Data structure returned by vrna_pf_dimer().
Public Members
-
double F0AB#
Null model without DuplexInit.
#include <ViennaRNA/partfunc/global.h>
-
double FAB#
all states with DuplexInit correction
#include <ViennaRNA/partfunc/global.h>
-
double FcAB#
true hybrid states only
#include <ViennaRNA/partfunc/global.h>
-
double FA#
monomer A
#include <ViennaRNA/partfunc/global.h>
-
double FB#
monomer B
#include <ViennaRNA/partfunc/global.h>
-
double F0AB#
-
struct vrna_multimer_pf_s#
Public Members
-
double F_connected#
Fully connected ensemble (incl. DuplexInititiation and rotational symmetry correction.
#include <ViennaRNA/partfunc/global.h>
-
double *F_monomers#
monomers
#include <ViennaRNA/partfunc/global.h>
-
size_t num_monomers#
Number of monomers.
#include <ViennaRNA/partfunc/global.h>
-
double F_connected#
-
FLT_OR_DBL vrna_pf(vrna_fold_compound_t *fc, char *structure)#
Local Partition Function#
Basic local partition function interface
-
int vrna_probs_window(vrna_fold_compound_t *fc, int ulength, unsigned int options, vrna_probs_window_f cb, void *data)#
Compute various equilibrium probabilities under a sliding window approach.
#include <ViennaRNA/partfunc/local.h>
This function applies a sliding window scan for the sequence provided with the argument
fcand reports back equilibrium probabilities through the callback functioncb. The data reported to the callback depends on theoptionsflag.Options:
VRNA_PROBS_WINDOW_BPP - Trigger base pairing probabilities.
VRNA_PROBS_WINDOW_UP - Trigger unpaired probabilities.
VRNA_PROBS_WINDOW_UP_SPLIT - Trigger detailed unpaired probabilities split up into different loop type contexts.
Options may be OR-ed together
See also
Note
The parameter
ulengthonly affects computation and resulting data if unpaired probability computations are requested through theoptionsflag.- Parameters:
fc – The fold compound with sequence data, model settings and precomputed energy parameters
ulength – The maximal length of an unpaired segment (only for unpaired probability computations)
cb – The callback function which collects the pair probability data for further processing
data – Some arbitrary data structure that is passed to the callback
cboptions – Option flags to control the behavior of this function
- Returns:
0 on failure, non-zero on success
Simplified global partition function computation using sequence(s) or multiple sequence alignment(s)
-
vrna_ep_t *vrna_pfl_fold(const char *sequence, int window_size, int max_bp_span, float cutoff)#
Compute base pair probabilities using a sliding-window approach.
#include <ViennaRNA/partfunc/local.h>
This is a simplified wrapper to vrna_probs_window() that given a nucleid acid sequence, a window size, a maximum base pair span, and a cutoff value computes the pair probabilities for any base pair in any window. The pair probabilities are returned as a list and the user has to take care to free() the memory occupied by the list.
Note
This function uses default model settings! For custom model settings, we refer to the function vrna_probs_window()
.
In case of any computation errors, this function returns
NULL- Parameters:
sequence – The nucleic acid input sequence
window_size – The size of the sliding window
max_bp_span – The maximum distance along the backbone between two nucleotides that form a base pairs
cutoff – A cutoff value that omits all pairs with lower probability
- Returns:
A list of base pair probabilities, terminated by an entry with vrna_ep_t.i and vrna_ep_t.j set to 0
-
int vrna_pfl_fold_cb(const char *sequence, int window_size, int max_bp_span, vrna_probs_window_f cb, void *data)#
Compute base pair probabilities using a sliding-window approach (callback version).
#include <ViennaRNA/partfunc/local.h>
This is a simplified wrapper to vrna_probs_window() that given a nucleid acid sequence, a window size, a maximum base pair span, and a cutoff value computes the pair probabilities for any base pair in any window. It is similar to vrna_pfl_fold() but uses a callback mechanism to return the pair probabilities.
Read the details for vrna_probs_window() for details on the callback implementation!
Note
This function uses default model settings! For custom model settings, we refer to the function vrna_probs_window().
- Parameters:
sequence – The nucleic acid input sequence
window_size – The size of the sliding window
max_bp_span – The maximum distance along the backbone between two nucleotides that form a base pairs
cb – The callback function which collects the pair probability data for further processing
data – Some arbitrary data structure that is passed to the callback
cb
- Returns:
0 on failure, non-zero on success
-
double **vrna_pfl_fold_up(const char *sequence, int ulength, int window_size, int max_bp_span)#
Compute probability of contiguous unpaired segments.
#include <ViennaRNA/partfunc/local.h>
This is a simplified wrapper to vrna_probs_window() that given a nucleic acid sequence, a maximum length of unpaired segments (
ulength), a window size, and a maximum base pair span computes the equilibrium probability of any segment not exceedingulength. The probabilities to be unpaired are returned as a 1-based, 2-dimensional matrix with dimensions \( N \times M \), where \(N\) is the length of the sequence and \(M\) is the maximum segment length. As an example, the probability of a segment of size 5 starting at position 100 is stored in the matrix entry \(X[100][5]\).It is the users responsibility to free the memory occupied by this matrix.
Note
This function uses default model settings! For custom model settings, we refer to the function vrna_probs_window().
- Parameters:
sequence – The nucleic acid input sequence
ulength – The maximal length of an unpaired segment
window_size – The size of the sliding window
max_bp_span – The maximum distance along the backbone between two nucleotides that form a base pairs
- Returns:
The probabilities to be unpaired for any segment not exceeding
ulength
-
int vrna_pfl_fold_up_cb(const char *sequence, int ulength, int window_size, int max_bp_span, vrna_probs_window_f cb, void *data)#
Compute probability of contiguous unpaired segments.
#include <ViennaRNA/partfunc/local.h>
This is a simplified wrapper to vrna_probs_window() that given a nucleic acid sequence, a maximum length of unpaired segments (
ulength), a window size, and a maximum base pair span computes the equilibrium probability of any segment not exceedingulength. It is similar to vrna_pfl_fold_up() but uses a callback mechanism to return the unpaired probabilities.Read the details for vrna_probs_window() for details on the callback implementation!
Note
This function uses default model settings! For custom model settings, we refer to the function vrna_probs_window().
- Parameters:
sequence – The nucleic acid input sequence
ulength – The maximal length of an unpaired segment
window_size – The size of the sliding window
max_bp_span – The maximum distance along the backbone between two nucleotides that form a base pairs
cb – The callback function which collects the pair probability data for further processing
data – Some arbitrary data structure that is passed to the callback
cb
- Returns:
0 on failure, non-zero on success
Defines
-
VRNA_EXT_LOOP#
Exterior loop.
#include <ViennaRNA/partfunc/local.h>
-
VRNA_HP_LOOP#
Hairpin loop.
#include <ViennaRNA/partfunc/local.h>
-
VRNA_INT_LOOP#
Internal loop.
#include <ViennaRNA/partfunc/local.h>
-
VRNA_MB_LOOP#
Multibranch loop.
#include <ViennaRNA/partfunc/local.h>
-
VRNA_ANY_LOOP#
Any loop.
#include <ViennaRNA/partfunc/local.h>
-
VRNA_PROBS_WINDOW_BPP#
Trigger base pairing probabilities.
#include <ViennaRNA/partfunc/local.h>
Passing this flag to vrna_probs_window() activates callback execution for base pairing probabilities. In turn, the corresponding callback receives this flag through the
typeargument whenever base pairing probabilities are provided.Detailed information for the algorithm to compute unpaired probabilities can be taken from Bernhart et al. [2005] .
See also
-
VRNA_PROBS_WINDOW_UP#
Trigger unpaired probabilities.
#include <ViennaRNA/partfunc/local.h>
Passing this flag to vrna_probs_window() activates callback execution for unpaired probabilities. In turn, the corresponding callback receives this flag through the
typeargument whenever unpaired probabilities are provided.Detailed information for the algorithm to compute unpaired probabilities can be taken from Bernhart et al. [2011] .
See also
-
VRNA_PROBS_WINDOW_STACKP#
Trigger base pair stack probabilities.
#include <ViennaRNA/partfunc/local.h>
Passing this flag to vrna_probs_window() activates callback execution for stacking probabilities. In turn, the corresponding callback receives this flag through the
typeargument whenever stack probabilities are provided.- Bug:
Currently, this flag is a placeholder doing nothing as the corresponding implementation for stack probability computation is missing.
See also
-
VRNA_PROBS_WINDOW_UP_SPLIT#
Trigger detailed unpaired probabilities split up into different loop type contexts.
#include <ViennaRNA/partfunc/local.h>
Passing this flag to vrna_probs_window() activates callback execution for unpaired probabilities. In contrast to VRNA_PROBS_WINDOW_UP this flag requests unpaired probabilities to be split up into different loop type contexts. In turn, the corresponding callback receives the VRNA_PROBS_WINDOW_UP flag OR-ed together with the corresponding loop type, i.e.:
VRNA_EXT_LOOP - Exterior loop.
VRNA_HP_LOOP - Hairpin loop.
VRNA_INT_LOOP - Internal loop.
VRNA_MB_LOOP - Multibranch loop.
VRNA_ANY_LOOP - Any loop.
See also
-
VRNA_PROBS_WINDOW_PF#
Trigger partition function.
#include <ViennaRNA/partfunc/local.h>
Passing this flag to vrna_probs_window() activates callback execution for partition function. In turn, the corresponding callback receives this flag through it’s
typeargument whenever partition function data is provided.See also
Note
Instead of actually providing the partition function \(Z\), the callback is always provided with the corresponding enemble free energy \(\Delta G = - RT \ln Z\).
Typedefs
-
typedef void (*vrna_probs_window_f)(FLT_OR_DBL *pr, int pr_size, int i, int max, unsigned int type, void *data)#
Sliding window probability computation callback.
#include <ViennaRNA/partfunc/local.h>
- Notes on Callback Functions:
This function will be called for each probability data set in the sliding window probability computation implementation of vrna_probs_window(). The argument type specifies the type of probability that is passed to this function.
Types:
VRNA_PROBS_WINDOW_BPP - Trigger base pairing probabilities.
VRNA_PROBS_WINDOW_UP - Trigger unpaired probabilities.
VRNA_PROBS_WINDOW_PF - Trigger partition function.
The above types usually come exclusively. However, for unpaired probabilities, the VRNA_PROBS_WINDOW_UP flag is OR-ed together with one of the loop type contexts
VRNA_EXT_LOOP - Exterior loop.
VRNA_HP_LOOP - Hairpin loop.
VRNA_INT_LOOP - Internal loop.
VRNA_MB_LOOP - Multibranch loop.
VRNA_ANY_LOOP - Any loop.
to indicate the particular type of data available through the
prpointer.See also
- Param pr:
An array of probabilities
- Param pr_size:
The length of the probability array
- Param i:
The i-position (5’) of the probabilities
- Param max:
The (theoretical) maximum length of the probability array
- Param type:
The type of data that is provided
- Param data:
Auxiliary data
-
typedef void vrna_probs_window_callback(FLT_OR_DBL *pr, int pr_size, int i, int max, unsigned int type, void *data)#
#include <ViennaRNA/partfunc/local.h>
-
int vrna_probs_window(vrna_fold_compound_t *fc, int ulength, unsigned int options, vrna_probs_window_f cb, void *data)#
Thermodynamic Properties API#
Compute various thermodynamic properties using the partition function.
Basic heat capacity function interface
-
vrna_heat_capacity_t *vrna_heat_capacity(vrna_fold_compound_t *fc, float T_min, float T_max, float T_increment, unsigned int mpoints)#
Compute the specific heat for an RNA.
#include <ViennaRNA/heat_capacity.h>
This function computes an RNAs specific heat in a given temperature range from the partition function by numeric differentiation. The result is returned as a list of pairs of temperature in °C and specific heat in Kcal/(Mol*K).
Users can specify the temperature range for the computation from
T_mintoT_max, as well as the increment step sizeT_increment. The latter also determines how many times the partition function is computed. Finally, the parametermpointsdetermines how smooth the curve should be. The algorithm itself fits a parabola to \( 2 \cdot mpoints + 1 \) data points to calculate 2nd derivatives. Increasing this parameter produces a smoother curve.- SWIG Wrapper Notes:
This function is attached as overloaded method
heat_capacity()to objects of typefold_compound. If the optional function argumentsT_min,T_max,T_increment, andmpointsare omitted, they default to 0.0, 100.0, 1.0 and 2, respectively. See, e.g.RNA.fold_compound.heat_capacity()in the The RNA Python module.
- Parameters:
fc – The vrna_fold_compound_t with the RNA sequence to analyze
T_min – Lowest temperature in °C
T_max – Highest temperature in °C
T_increment – Stepsize for temperature incrementation in °C (a reasonable choice might be 1°C)
mpoints – The number of interpolation points to calculate 2nd derivative (a reasonable choice might be 2, min: 1, max: 100)
- Returns:
A list of pairs of temperatures and corresponding heat capacity or NULL upon any failure. The last entry of the list is indicated by a temperature field set to a value smaller than
T_min
-
int vrna_heat_capacity_cb(vrna_fold_compound_t *fc, float T_min, float T_max, float T_increment, unsigned int mpoints, vrna_heat_capacity_f cb, void *data)#
Compute the specific heat for an RNA (callback variant).
#include <ViennaRNA/heat_capacity.h>
Similar to vrna_heat_capacity(), this function computes an RNAs specific heat in a given temperature range from the partition function by numeric differentiation. Instead of returning a list of temperature/specific heat pairs, however, this function returns the individual results through a callback mechanism. The provided function will be called for each result and passed the corresponding temperature and specific heat values along with the arbitrary data as provided through the
datapointer argument.Users can specify the temperature range for the computation from
T_mintoT_max, as well as the increment step sizeT_increment. The latter also determines how many times the partition function is computed. Finally, the parametermpointsdetermines how smooth the curve should be. The algorithm itself fits a parabola to \( 2 \cdot mpoints + 1 \) data points to calculate 2nd derivatives. Increasing this parameter produces a smoother curve.- SWIG Wrapper Notes:
This function is attached as method
heat_capacity_cb()to objects of typefold_compound. See, e.g.RNA.fold_compound.heat_capacity_cb()in the The RNA Python module.
See also
- Parameters:
fc – The vrna_fold_compound_t with the RNA sequence to analyze
T_min – Lowest temperature in °C
T_max – Highest temperature in °C
T_increment – Stepsize for temperature incrementation in °C (a reasonable choice might be 1°C)
mpoints – The number of interpolation points to calculate 2nd derivative (a reasonable choice might be 2, min: 1, max: 100)
cb – The user-defined callback function that receives the individual results
data – An arbitrary data structure that will be passed to the callback in conjunction with the results
- Returns:
Returns 0 upon failure, and non-zero otherwise
Simplified heat capacity computation
-
vrna_heat_capacity_t *vrna_heat_capacity_simple(const char *sequence, float T_min, float T_max, float T_increment, unsigned int mpoints)#
Compute the specific heat for an RNA (simplified variant).
#include <ViennaRNA/heat_capacity.h>
Similar to vrna_heat_capacity(), this function computes an RNAs specific heat in a given temperature range from the partition function by numeric differentiation. This simplified version, however, only requires the RNA sequence as input instead of a vrna_fold_compound_t data structure. The result is returned as a list of pairs of temperature in °C and specific heat in Kcal/(Mol*K).
Users can specify the temperature range for the computation from
T_mintoT_max, as well as the increment step sizeT_increment. The latter also determines how many times the partition function is computed. Finally, the parametermpointsdetermines how smooth the curve should be. The algorithm itself fits a parabola to \( 2 \cdot mpoints + 1 \) data points to calculate 2nd derivatives. Increasing this parameter produces a smoother curve.- SWIG Wrapper Notes:
This function is available as overloaded function
heat_capacity(). If the optional function argumentsT_min,T_max,T_increment, andmpointsare omitted, they default to 0.0, 100.0, 1.0 and 2, respectively. See, e.g.RNA.head_capacity()in the The RNA Python module.
- Parameters:
sequence – The RNA sequence input (must be uppercase)
T_min – Lowest temperature in °C
T_max – Highest temperature in °C
T_increment – Stepsize for temperature incrementation in °C (a reasonable choice might be 1°C)
mpoints – The number of interpolation points to calculate 2nd derivative (a reasonable choice might be 2, min: 1, max: 100)
- Returns:
A list of pairs of temperatures and corresponding heat capacity or NULL upon any failure. The last entry of the list is indicated by a temperature field set to a value smaller than
T_min
Accessibility and derived computations
-
vrna_ep_array_t vrna_eqm_probs_up(vrna_fold_compound_t *fc, unsigned int min_u, unsigned int max_u, double cutoff)#
Compute Accessibility.
#include <ViennaRNA/probabilities/accessibility.h>
- Parameters:
fc – The fold compound to operate on
min_u – The minimum sequence length for unpaired stretches
max_u – The maximum sequence length for unpaired stretches
cutoff – A probability threshold to filter the output
- Returns:
A list of accessibility values in vrna_array() format
Base pair probabilities and derived computations
-
int vrna_pairing_probs(vrna_fold_compound_t *fc, char *structure)#
#include <ViennaRNA/probabilities/basepairs.h>
-
vrna_ep_array_t vrna_eqm_probs_bp(vrna_fold_compound_t *fc, double cutoff)#
Get a list of base pair probabiltities.
#include <ViennaRNA/probabilities/basepairs.h>
- Parameters:
fc – The fold compound to operate on
cutoff – A probability threshold to filter the output
- Returns:
A list of base pair probabiltities
Multimer probabilities computations
-
void vrna_pf_dimer_probs(double FAB, double FA, double FB, vrna_ep_t *prAB, const vrna_ep_t *prA, const vrna_ep_t *prB, int Alength, const vrna_exp_param_t *exp_params)#
Compute Boltzmann probabilities of dimerization without homodimers.
#include <ViennaRNA/probabilities/basic.h>
Given the pair probabilities and free energies (in the null model) for a dimer AB and the two constituent monomers A and B, compute the conditional pair probabilities given that a dimer AB actually forms. Null model pair probabilities are given as a list as produced by vrna_plist_from_probs(), the dimer probabilities ‘prAB’ are modified in place.
- Parameters:
FAB – free energy of dimer AB
FA – free energy of monomer A
FB – free energy of monomer B
prAB – pair probabilities for dimer
prA – pair probabilities monomer
prB – pair probabilities monomer
Alength – Length of molecule A
exp_params – The precomputed Boltzmann factors
Helix probabilities and derived computations
-
vrna_ep_array_t vrna_eqm_probs_hx(vrna_fold_compound_t *fc, unsigned int min_size, unsigned int max_size, double cutoff)#
Get a list of helix probabiltities.
#include <ViennaRNA/probabilities/helices.h>
- Parameters:
fc – The fold compound to operate on
min_size – The minimum helix size
max_size – The maximum helix size
cutoff – A probability threshold to filter the output
- Returns:
A list of base pair probabiltities
-
vrna_ep_t *vrna_stack_prob(vrna_fold_compound_t *fc, double cutoff)#
Compute stacking probabilities.
#include <ViennaRNA/probabilities/helices.h>
For each possible base pair \((i,j)\), compute the probability of a stack \((i,j)\), \((i+1, j-1)\).
- SWIG Wrapper Notes:
This function is attached as overloaded method
stack_prob()to objects of typefold_compound. The optional argumentcutoffdefaults to 1e-5. See, e.g.RNA.fold_compound.stack_prob()in the The RNA Python module.
- Parameters:
fc – The fold compound data structure with precomputed base pair probabilities
cutoff – A cutoff value that limits the output to stacks with \( p > \textrm{cutoff} \).
- Returns:
A list of stacks with enclosing base pair \((i,j)\) and probabiltiy \( p \)
Structure probability computations
-
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.
#include <ViennaRNA/probabilities/structures.h>
\[<d> = \sum_{a,b} p_a p_b d(S_a,S_b) \]this can be computed from the pair probs \( p_{ij} \) as
\[<d> = \sum_{ij} p_{ij}(1-p_{ij}) \]- Parameters:
length – The length of the sequence
pr – The matrix containing the base pair probabilities
- Returns:
The mean pair distance of the structure ensemble
-
double vrna_mean_bp_distance(vrna_fold_compound_t *fc)#
Get the mean base pair distance in the thermodynamic ensemble.
#include <ViennaRNA/probabilities/structures.h>
\[<d> = \sum_{a,b} p_a p_b d(S_a,S_b) \]this can be computed from the pair probs \(p_{ij}\) as
\[<d> = \sum_{ij} p_{ij}(1-p_{ij}) \]- SWIG Wrapper Notes:
This function is attached as method
mean_bp_distance()to objects of typefold_compound. See, e.g.RNA.fold_compound.mean_bp_distance()in the The RNA Python module.
- Parameters:
fc – The fold compound data structure
- Returns:
The mean pair distance of the structure ensemble
-
double vrna_ensemble_defect_pt(vrna_fold_compound_t *fc, const short *pt)#
Compute the Ensemble Defect for a given target structure provided as a vrna_ptable.
#include <ViennaRNA/probabilities/structures.h>
Given a target structure \(s\), compute the average dissimilarity of a randomly drawn structure from the ensemble, i.e.:
\[ ED(s) = 1 - \frac{1}{n} \sum_{ij, (i,j) \in s} p_{ij} - \frac{1}{n} \sum_{i}(1 - s_i)q_i \]with sequence length \(n\), the probability \(p_{ij}\) of a base pair \((i,j)\), the probability \(q_i = 1 - \sum_j p_{ij}\) of nucleotide \(i\) being unpaired, and the indicator variable \(s_i = 1\) if \(\exists (i,j) \in s\), and \(s_i = 0\) otherwise.
- SWIG Wrapper Notes:
This function is attached as overloaded method
ensemble_defect()to objects of typefold_compound. See, e.g.RNA.fold_compound.ensemble_defect()in the The RNA Python module.
See also
vrna_pf(), vrna_pairing_probs(), vrna_ensemble_defect()
- Parameters:
fc – A fold_compound with pre-computed base pair probabilities
pt – A pair table representing a target structure
- Pre:
The vrna_fold_compound_t input parameter
fcmust contain a valid base pair probability matrix. This means that partition function and base pair probabilities must have been computed usingfcbefore execution of this function!- Returns:
The ensemble defect with respect to the target structure, or -1. upon failure, e.g. pre-conditions are not met
-
double vrna_ensemble_defect(vrna_fold_compound_t *fc, const char *structure)#
Compute the Ensemble Defect for a given target structure.
#include <ViennaRNA/probabilities/structures.h>
This is a wrapper around vrna_ensemble_defect_pt(). Given a target structure \(s\), compute the average dissimilarity of a randomly drawn structure from the ensemble, i.e.:
\[ ED(s) = 1 - \frac{1}{n} \sum_{ij, (i,j) \in s} p_{ij} - \frac{1}{n} \sum_{i}(1 - s_i)q_i \]with sequence length \(n\), the probability \(p_{ij}\) of a base pair \((i,j)\), the probability \(q_i = 1 - \sum_j p_{ij}\) of nucleotide \(i\) being unpaired, and the indicator variable \(s_i = 1\) if \(\exists (i,j) \in s\), and \(s_i = 0\) otherwise.
- SWIG Wrapper Notes:
This function is attached as method
ensemble_defect()to objects of typefold_compound. Note that the SWIG wrapper takes a structure in dot-bracket notation and converts it into a pair table using vrna_ptable_from_string(). The resulting pair table is then internally passed to vrna_ensemble_defect_pt(). To control which kind of matching brackets will be used during conversion, the optional argumentoptionscan be used. See also the description of vrna_ptable_from_string() for available options. (default:VRNA_BRACKETS_RND). See, e.g.RNA.fold_compound.ensemble_defect()in the The RNA Python module.
See also
vrna_pf(), vrna_pairing_probs(), vrna_ensemble_defect_pt()
- Parameters:
fc – A fold_compound with pre-computed base pair probabilities
structure – A target structure in dot-bracket notation
- Pre:
The vrna_fold_compound_t input parameter
fcmust contain a valid base pair probability matrix. This means that partition function and base pair probabilities must have been computed usingfcbefore execution of this function!- Returns:
The ensemble defect with respect to the target structure, or -1. upon failure, e.g. pre-conditions are not met
-
double *vrna_positional_entropy(vrna_fold_compound_t *fc)#
Compute a vector of positional entropies.
#include <ViennaRNA/probabilities/structures.h>
This function computes the positional entropies from base pair probabilities as
\[S(i) = - \sum_j p_{ij} \log(p_{ij}) - q_i \log(q_i) \]with unpaired probabilities \( q_i = 1 - \sum_j p_{ij} \).
Low entropy regions have little structural flexibility and the reliability of the predicted structure is high. High entropy implies many structural alternatives. While these alternatives may be functionally important, they make structure prediction more difficult and thus less reliable.
- SWIG Wrapper Notes:
This function is attached as method
positional_entropy()to objects of typefold_compound. See, e.g.RNA.fold_compound.positional_entropy()in the The RNA Python module.
- Parameters:
fc – A fold_compound with pre-computed base pair probabilities
- Pre:
This function requires pre-computed base pair probabilities! Thus, vrna_pf() must be called beforehand.
- Returns:
A 1-based vector of positional entropies \( S(i) \). (position 0 contains the sequence length)
-
double vrna_pr_structure(vrna_fold_compound_t *fc, const char *structure)#
Compute the equilibrium probability of a particular secondary structure.
#include <ViennaRNA/probabilities/structures.h>
The probability \(p(s)\) of a particular secondary structure \(s\) can be computed as
\[ p(s) = \frac{exp(-\beta E(s)}{Z} \]from the structures free energy \(E(s)\) and the partition function
\[ Z = \sum_s exp(-\beta E(s)),\quad\mathrm{with}\quad\beta = \frac{1}{RT} \]where \(R\) is the gas constant and \(T\) the thermodynamic temperature.
- SWIG Wrapper Notes:
This function is attached as method
pr_structure()to objects of typefold_compound. See, e.g.RNA.fold_compound.pr_structure()in the The RNA Python module.
- Parameters:
fc – The fold compound data structure with precomputed partition function
structure – The secondary structure to compute the probability for in dot-bracket notation
- Pre:
The fold compound
fcmust have went through a call to vrna_pf() to fill the dynamic programming matrices with the corresponding partition function.- Returns:
The probability of the input structure (range \([0:1]\))
-
double vrna_pr_energy(vrna_fold_compound_t *fc, double e)#
#include <ViennaRNA/probabilities/structures.h>
- SWIG Wrapper Notes:
This function is attached as method
pr_energy()to objects of typefold_compound. See, e.g.RNA.fold_compound.pr_energy()in the The RNA Python module.
Defines
-
VRNA_LOOP_TYPE_EXT#
Exterior loop.
#include <ViennaRNA/probabilities/basic.h>
-
VRNA_LOOP_TYPE_HP#
Hairpin loop.
#include <ViennaRNA/probabilities/basic.h>
-
VRNA_LOOP_TYPE_INT#
Internal loop.
#include <ViennaRNA/probabilities/basic.h>
-
VRNA_LOOP_TYPE_MB#
Multibranch loop.
#include <ViennaRNA/probabilities/basic.h>
-
VRNA_LOOP_TYPE_ANY#
Any loop.
#include <ViennaRNA/probabilities/basic.h>
-
VRNA_EQM_PROBS_BP#
Base pair probability flag.
#include <ViennaRNA/probabilities/basic.h>
Passing this flag to vrna_eqm_probabilities() or vrna_probs_window() activates callback execution for base pairing probabilities. In turn, the corresponding callback receives this flag through the
typeargument whenever base pairing probabilities are provided.See also
vrna_eqm_probabilities(), vrna_probs_window()
-
VRNA_EQM_PROBS_UP#
Unpaired probability (accessibility) flag.
#include <ViennaRNA/probabilities/basic.h>
Passing this flag to vrna_eqm_probabilities() or vrna_probs_window() activates callback execution for unpaired probabilities, a.k.a. accessibilities. In turn, the corresponding callback receives this flag through the
typeargument whenever unpaired probabilities are provided.See also
vrna_eqm_probabilities(), vrna_probs_window()
-
VRNA_EQM_PROBS_HX#
Helix probability flag.
#include <ViennaRNA/probabilities/basic.h>
Passing this flag to vrna_eqm_probabilities() or vrna_probs_window() activates callback execution for helix probabilities. In turn, the corresponding callback receives this flag through the
typeargument whenever stack probabilities are provided.- Bug:
Currently, this flag is a placeholder doing nothing as the corresponding implementation for helix/stack probability computation is missing.
See also
vrna_eqm_probabilities(), vrna_probs_window()
-
VRNA_EQM_PROBS_SPLIT#
Split probabilities into loop types.
#include <ViennaRNA/probabilities/basic.h>
Passing this flag to vrna_eqm_probabilities() or vrna_probs_window() indicates that probabilities should be reported on a loop-type base. In turn, the corresponding callback receives the VRNA_PROBS_WINDOW_UP flag OR-ed together with the corresponding loop type, i.e.:
VRNA_EXT_LOOP - Exterior loop.
VRNA_HP_LOOP - Hairpin loop.
VRNA_INT_LOOP - Internal loop.
VRNA_MB_LOOP - Multibranch loop.
VRNA_ANY_LOOP - Any loop.
See also
vrna_eqm_probabilities(), vrna_probs_window(), VRNA_EQM_PROBS_UP, #VRNA_EQM_PROBS_BPP
-
VRNA_EQM_PROBS_STORE_OUTSIDE#
#include <ViennaRNA/probabilities/basic.h>
-
VRNA_EQM_PROBS_OUTSIDE_PF#
#include <ViennaRNA/probabilities/basic.h>
-
VRNA_EQM_PROBS_MASK#
#include <ViennaRNA/probabilities/basic.h>
Typedefs
-
typedef void (*vrna_heat_capacity_f)(float temp, float heat_capacity, void *data)#
The callback for heat capacity predictions.
#include <ViennaRNA/heat_capacity.h>
- Notes on Callback Functions:
This function will be called for each evaluated temperature in the heat capacity prediction.
See also
- Param temp:
The current temperature this results corresponds to in °C
- Param heat_capacity:
The heat capacity in Kcal/(Mol * K)
- Param data:
Some arbitrary data pointer passed through by the function executing the callback
-
typedef void vrna_heat_capacity_callback(float temp, float heat_capacity, void *data)#
#include <ViennaRNA/heat_capacity.h>
-
typedef struct vrna_heat_capacity_s vrna_heat_capacity_t#
A single result from heat capacity computations.
#include <ViennaRNA/heat_capacity.h>
This is a convenience typedef for vrna_heat_capacity_s, i.e. results as obtained from vrna_heat_capacity()
-
typedef void *vrna_eqm_probs_data_t#
#include <ViennaRNA/probabilities/basic.h>
-
typedef void (*vrna_eqm_probs_f)(vrna_fold_compound_t *fc, FLT_OR_DBL *pr, unsigned int j, unsigned int a, unsigned int b, unsigned int type, vrna_eqm_probs_data_t data)#
#include <ViennaRNA/probabilities/basic.h>
Functions
-
int vrna_eqm_probabilities(vrna_fold_compound_t *fc, vrna_eqm_probs_f cb, vrna_eqm_probs_data_t cb_data, vrna_eqm_probs_opt_t options)#
#include <ViennaRNA/probabilities/basic.h>
-
struct vrna_heat_capacity_s#
- #include <ViennaRNA/heat_capacity.h>
A single result from heat capacity computations.
See also
-
struct vrna_eqm_probs_opt_t#
-
vrna_heat_capacity_t *vrna_heat_capacity(vrna_fold_compound_t *fc, float T_min, float T_max, float T_increment, unsigned int mpoints)#
Deprecated Partition Function API#
Unnamed Group
-
float alipf_fold_par(const char **sequences, char *structure, vrna_ep_t **pl, vrna_exp_param_t *parameters, int calculate_bppm, int is_constrained, int is_circular)#
#include <ViennaRNA/alifold.h>
- Deprecated:
Use vrna_pf() instead
- Parameters:
sequences
structure
pl
parameters
calculate_bppm
is_constrained
is_circular
- Returns:
-
float alipf_fold(const char **sequences, char *structure, vrna_ep_t **pl)#
The partition function version of alifold() works in analogy to pf_fold(). Pair probabilities and information about sequence covariations are returned via the ‘pi’ variable as a list of vrna_pinfo_t structs. The list is terminated by the first entry with pi.i = 0.
#include <ViennaRNA/alifold.h>
- Deprecated:
Use vrna_pf() instead
- Parameters:
sequences
structure
pl
- Returns:
-
float alipf_circ_fold(const char **sequences, char *structure, vrna_ep_t **pl)#
#include <ViennaRNA/alifold.h>
- Deprecated:
Use vrna_pf() instead
- Parameters:
sequences
structure
pl
- Returns:
-
FLT_OR_DBL *export_ali_bppm(void)#
Get a pointer to the base pair probability array.
#include <ViennaRNA/alifold.h>
Accessing the base pair probabilities for a pair (i,j) is achieved by
FLT_OR_DBL *pr = export_bppm(); pr_ij = pr[iindx[i]-j];
- Deprecated:
Usage of this function is discouraged! The new vrna_fold_compound_t allows direct access to the folding matrices, including the pair probabilities! The pair probability array returned here reflects the one of the latest call to vrna_pf(), or any of the old API calls for consensus structure partition function folding.
See also
vrna_fold_compound_t, vrna_fold_compound_comparative(), and vrna_pf()
- Returns:
A pointer to the base pair probability array
-
void free_alipf_arrays(void)#
Free the memory occupied by folding matrices allocated by alipf_fold, alipf_circ_fold, etc.
#include <ViennaRNA/alifold.h>
- Deprecated:
Usage of this function is discouraged! This function only free’s memory allocated by old API function calls. Memory allocated by any of the new API calls (starting with vrna_) will be not affected!
See also
vrna_fold_compound_t, vrna_vrna_fold_compound_free()
-
char *alipbacktrack(double *prob)#
Sample a consensus secondary structure from the Boltzmann ensemble according its probability.
#include <ViennaRNA/alifold.h>
- Deprecated:
Use vrna_pbacktrack() instead!
- Parameters:
prob – to be described (berni)
- Returns:
A sampled consensus secondary structure in dot-bracket notation
-
int get_alipf_arrays(short ***S_p, short ***S5_p, short ***S3_p, unsigned short ***a2s_p, char ***Ss_p, FLT_OR_DBL **qb_p, FLT_OR_DBL **qm_p, FLT_OR_DBL **q1k_p, FLT_OR_DBL **qln_p, short **pscore)#
Get pointers to (almost) all relavant arrays used in alifold’s partition function computation.
#include <ViennaRNA/alifold.h>
- Deprecated:
It is discouraged to use this function! The new vrna_fold_compound_t allows direct access to all necessary consensus structure prediction related variables!
See also
vrna_fold_compound_t, vrna_fold_compound_comparative(), vrna_pf(), pf_alifold(), alipf_circ_fold()
Note
To obtain meaningful pointers, call alipf_fold first!
- Parameters:
S_p – A pointer to the ‘S’ array (integer representation of nucleotides)
S5_p – A pointer to the ‘S5’ array
S3_p – A pointer to the ‘S3’ array
a2s_p – A pointer to the alignment-column to sequence position mapping array
Ss_p – A pointer to the ‘Ss’ array
qb_p – A pointer to the QB matrix
qm_p – A pointer to the QM matrix
q1k_p – A pointer to the 5’ slice of the Q matrix ( \(q1k(k) = Q(1, k)\))
qln_p – A pointer to the 3’ slice of the Q matrix ( \(qln(l) = Q(l, n)\))
pscore – A pointer to the start of a pscore list
- Returns:
Non Zero if everything went fine, 0 otherwise
Functions
-
vrna_dimer_pf_t co_pf_fold(char *sequence, char *structure)#
Calculate partition function and base pair probabilities.
#include <ViennaRNA/part_func_co.h>
This is the cofold partition function folding. The second molecule starts at the cut_point nucleotide.
Note
OpenMP: Since this function relies on the global parameters do_backtrack, dangles, temperature and pf_scale it is not threadsafe according to concurrent changes in these variables! Use co_pf_fold_par() instead to circumvent this issue.
- Parameters:
sequence – Concatenated RNA sequences
structure – Will hold the structure or constraints
- Returns:
vrna_dimer_pf_t structure containing a set of energies needed for concentration computations.
-
vrna_dimer_pf_t co_pf_fold_par(char *sequence, char *structure, vrna_exp_param_t *parameters, int calculate_bppm, int is_constrained)#
Calculate partition function and base pair probabilities.
#include <ViennaRNA/part_func_co.h>
This is the cofold partition function folding. The second molecule starts at the cut_point nucleotide.
- Deprecated:
Use vrna_pf_dimer() instead!
See also
- Parameters:
sequence – Concatenated RNA sequences
structure – Pointer to the structure constraint
parameters – Data structure containing the precalculated Boltzmann factors
calculate_bppm – Switch to turn Base pair probability calculations on/off (0==off)
is_constrained – Switch to indicate that a structure contraint is passed via the structure argument (0==off)
- Returns:
vrna_dimer_pf_t structure containing a set of energies needed for concentration computations.
-
void compute_probabilities(double FAB, double FEA, double FEB, vrna_ep_t *prAB, vrna_ep_t *prA, vrna_ep_t *prB, int Alength)#
Compute Boltzmann probabilities of dimerization without homodimers.
#include <ViennaRNA/part_func_co.h>
Given the pair probabilities and free energies (in the null model) for a dimer AB and the two constituent monomers A and B, compute the conditional pair probabilities given that a dimer AB actually forms. Null model pair probabilities are given as a list as produced by assign_plist_from_pr(), the dimer probabilities ‘prAB’ are modified in place.
- Parameters:
FAB – free energy of dimer AB
FEA – free energy of monomer A
FEB – free energy of monomer B
prAB – pair probabilities for dimer
prA – pair probabilities monomer
prB – pair probabilities monomer
Alength – Length of molecule A
-
void init_co_pf_fold(int length)#
#include <ViennaRNA/part_func_co.h>
DO NOT USE THIS FUNCTION ANYMORE
-
FLT_OR_DBL *export_co_bppm(void)#
Get a pointer to the base pair probability array.
#include <ViennaRNA/part_func_co.h>
Accessing the base pair probabilities for a pair (i,j) is achieved by
FLT_OR_DBL *pr = export_bppm(); pr_ij = pr[iindx[i]-j];
- Deprecated:
This function is deprecated and will be removed soon! The base pair probability array is available through the vrna_fold_compound_t data structure, and its associated vrna_mx_pf_t member.
See also
- Returns:
A pointer to the base pair probability array
-
void free_co_pf_arrays(void)#
Free the memory occupied by co_pf_fold().
#include <ViennaRNA/part_func_co.h>
- Deprecated:
This function will be removed for the new API soon! See vrna_pf_dimer(), vrna_fold_compound(), and vrna_fold_compound_free() for an alternative
-
void update_co_pf_params(int length)#
Recalculate energy parameters.
#include <ViennaRNA/part_func_co.h>
This function recalculates all energy parameters given the current model settings.
- Deprecated:
Use vrna_exp_params_subst() instead!
- Parameters:
length – Length of the current RNA sequence
-
void update_co_pf_params_par(int length, vrna_exp_param_t *parameters)#
Recalculate energy parameters.
#include <ViennaRNA/part_func_co.h>
This function recalculates all energy parameters given the current model settings. It’s second argument can either be NULL or a data structure containing the precomputed Boltzmann factors. In the first scenario, the necessary data structure will be created automatically according to the current global model settings, i.e. this mode might not be threadsafe. However, if the provided data structure is not NULL, threadsafety for the model parameters dangles, pf_scale and temperature is regained, since their values are taken from this data structure during subsequent calculations.
- Deprecated:
Use vrna_exp_params_subst() instead!
- Parameters:
length – Length of the current RNA sequence
parameters – data structure containing the precomputed Boltzmann factors
-
float pf_fold_par(const char *sequence, char *structure, vrna_exp_param_t *parameters, int calculate_bppm, int is_constrained, int is_circular)#
Compute the partition function \(Q\) for a given RNA sequence.
#include <ViennaRNA/partfunc/global.h>
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.
- Deprecated:
Use vrna_pf() instead
See also
vrna_pf(), bppm_to_structure(), export_bppm(), vrna_exp_params(), free_pf_arrays()
Note
The global array pr is deprecated and the user who wants the calculated base pair probabilities for further computations is advised to use the function export_bppm()
- Parameters:
sequence – [in] The RNA sequence input
structure – [inout] 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)
parameters – [in] Data structure containing the precalculated Boltzmann factors
calculate_bppm – [in] Switch to Base pair probability calculations on/off (0==off)
is_constrained – [in] Switch to indicate that a structure contraint is passed via the structure argument (0==off)
is_circular – [in] Switch to (de-)activate postprocessing steps in case RNA sequence is circular (0==off)
- Post:
After successful run the hidden folding matrices are filled with the appropriate Boltzmann factors. Depending on whether the global variable do_backtrack was set the base pair probabilities are already computed and may be accessed for further usage via the export_bppm() function. A call of free_pf_arrays() will free all memory allocated by this function. Successive calls will first free previously allocated memory before starting the computation.
- Returns:
The ensemble free energy \(G = -RT \cdot \log(Q) \) in kcal/mol
-
float pf_fold(const char *sequence, char *structure)#
Compute the partition function \(Q\) of an RNA sequence.
#include <ViennaRNA/partfunc/global.h>
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.
See also
pf_fold_par(), pf_circ_fold(), bppm_to_structure(), export_bppm()
Note
The global array pr is deprecated and the user who wants the calculated base pair probabilities for further computations is advised to use the function export_bppm(). OpenMP: This function is not entirely threadsafe. While the recursions are working on their own copies of data the model details for the recursions are determined from the global settings just before entering the recursions. Consider using pf_fold_par() for a really threadsafe implementation.
- Parameters:
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)
- Pre:
This function takes its model details from the global variables provided in RNAlib
- Post:
After successful run the hidden folding matrices are filled with the appropriate Boltzmann factors. Depending on whether the global variable do_backtrack was set the base pair probabilities are already computed and may be accessed for further usage via the export_bppm() function. A call of free_pf_arrays() will free all memory allocated by this function. Successive calls will first free previously allocated memory before starting the computation.
- Returns:
The ensemble free energy \(G = -RT \cdot \log(Q) \) in kcal/mol
-
float pf_circ_fold(const char *sequence, char *structure)#
Compute the partition function of a circular RNA sequence.
#include <ViennaRNA/partfunc/global.h>
- Deprecated:
Use vrna_pf() instead!
See also
Note
The global array pr is deprecated and the user who wants the calculated base pair probabilities for further computations is advised to use the function export_bppm(). OpenMP: This function is not entirely threadsafe. While the recursions are working on their own copies of data the model details for the recursions are determined from the global settings just before entering the recursions. Consider using pf_fold_par() for a really threadsafe implementation.
- Pre:
This function takes its model details from the global variables provided in RNAlib
- Post:
After successful run the hidden folding matrices are filled with the appropriate Boltzmann factors. Depending on whether the global variable do_backtrack was set the base pair probabilities are already computed and may be accessed for further usage via the export_bppm() function. A call of free_pf_arrays() will free all memory allocated by this function. Successive calls will first free previously allocated memory before starting the computation.
- Parameters:
sequence – [in] The RNA sequence input
structure – [inout] 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)
- Returns:
The ensemble free energy \(G = -RT \cdot \log(Q) \) in kcal/mol
-
void free_pf_arrays(void)#
Free arrays for the partition function recursions.
#include <ViennaRNA/partfunc/global.h>
Call this function if you want to free all allocated memory associated with the partition function forward recursion.
- Deprecated:
See vrna_fold_compound_t and its related functions for how to free memory occupied by the dynamic programming matrices
See also
Note
Successive calls of pf_fold(), pf_circ_fold() already check if they should free any memory from a previous run. OpenMP notice: This function should be called before leaving a thread in order to avoid leaking memory
- Post:
All memory allocated by pf_fold_par(), pf_fold() or pf_circ_fold() will be free’d
-
void update_pf_params(int length)#
Recalculate energy parameters.
#include <ViennaRNA/partfunc/global.h>
Call this function to recalculate the pair matrix and energy parameters after a change in folding parameters like temperature
- Deprecated:
Use vrna_exp_params_subst() instead
-
void update_pf_params_par(int length, vrna_exp_param_t *parameters)#
Recalculate energy parameters.
#include <ViennaRNA/partfunc/global.h>
- Deprecated:
Use vrna_exp_params_subst() instead
-
FLT_OR_DBL *export_bppm(void)#
Get a pointer to the base pair probability array.
#include <ViennaRNA/partfunc/global.h>
Accessing the base pair probabilities for a pair (i,j) is achieved by
FLT_OR_DBL *pr = export_bppm(); pr_ij = pr[iindx[i]-j];
See also
- Pre:
Call pf_fold_par(), pf_fold() or pf_circ_fold() first to fill the base pair probability array
- Returns:
A pointer to the base pair probability array
-
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.
#include <ViennaRNA/partfunc/global.h>
See also
- Parameters:
S_p – [out] A pointer to the ‘S’ array (integer representation of nucleotides)
S1_p – [out] A pointer to the ‘S1’ array (2nd integer representation of nucleotides)
ptype_p – [out] A pointer to the pair type matrix
qb_p – [out] A pointer to the QB matrix
qm_p – [out] A pointer to the QM matrix
q1k_p – [out] A pointer to the 5’ slice of the Q matrix ( \(q1k(k) = Q(1, k)\))
qln_p – [out] A pointer to the 3’ slice of the Q matrix ( \(qln(l) = Q(l, n)\))
- Pre:
In order to assign meaningful pointers, you have to call pf_fold_par() or pf_fold() first!
- Returns:
Non Zero if everything went fine, 0 otherwise
-
double get_subseq_F(int i, int j)#
Get the free energy of a subsequence from the q[] array.
#include <ViennaRNA/partfunc/global.h>
-
double mean_bp_distance(int length)#
Get the mean base pair distance of the last partition function computation.
#include <ViennaRNA/partfunc/global.h>
- Deprecated:
Use vrna_mean_bp_distance() or vrna_mean_bp_distance_pr() instead!
- Parameters:
length
- Returns:
mean base pair distance in thermodynamic ensemble
-
double mean_bp_distance_pr(int length, FLT_OR_DBL *pr)#
Get the mean base pair distance in the thermodynamic ensemble.
#include <ViennaRNA/partfunc/global.h>
This is a threadsafe implementation of mean_bp_dist() !
\(<d> = \sum_{a,b} p_a p_b d(S_a,S_b)\) this can be computed from the pair probs \(p_ij\) as \(<d> = \sum_{ij} p_{ij}(1-p_{ij})\)
- Deprecated:
Use vrna_mean_bp_distance() or vrna_mean_bp_distance_pr() instead!
- Parameters:
length – The length of the sequence
pr – The matrix containing the base pair probabilities
- Returns:
The mean pair distance of the structure ensemble
-
vrna_ep_t *stackProb(double cutoff)#
Get the probability of stacks.
#include <ViennaRNA/partfunc/global.h>
- Deprecated:
Use vrna_stack_prob() instead!
-
void init_pf_fold(int length)#
Allocate space for pf_fold().
#include <ViennaRNA/partfunc/global.h>
- Deprecated:
This function is obsolete and will be removed soon!
-
void assign_plist_from_db(vrna_ep_t **pl, const char *struc, float pr)#
Create a vrna_ep_t from a dot-bracket string.
#include <ViennaRNA/structures/problist.h>
The dot-bracket string is parsed and for each base pair an entry in the plist is created. The probability of each pair in the list is set by a function parameter.
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
- Deprecated:
Use vrna_plist() instead
- Parameters:
pl – A pointer to the vrna_ep_t that is to be created
struc – The secondary structure in dot-bracket notation
pr – The probability for each base pair
-
void assign_plist_from_pr(vrna_ep_t **pl, FLT_OR_DBL *probs, int length, double cutoff)#
Create a vrna_ep_t from a probability matrix.
#include <ViennaRNA/structures/problist.h>
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
- Deprecated:
Use vrna_plist_from_probs() instead!
Note
This function is threadsafe
- Parameters:
pl – [out] A pointer to the vrna_ep_t that is to be created
probs – [in] The probability matrix used for creating the plist
length – [in] The length of the RNA sequence
cutoff – [in] The cutoff value
-
float alipf_fold_par(const char **sequences, char *structure, vrna_ep_t **pl, vrna_exp_param_t *parameters, int calculate_bppm, int is_constrained, int is_circular)#
Functions
-
void update_pf_paramsLP(int length)#
#include <ViennaRNA/LPfold.h>
- Parameters:
length
-
void update_pf_paramsLP_par(int length, vrna_exp_param_t *parameters)#
#include <ViennaRNA/LPfold.h>
-
vrna_ep_t *pfl_fold(char *sequence, int winSize, int pairSize, float cutoffb, double **pU, vrna_ep_t **dpp2, FILE *pUfp, FILE *spup)#
Compute partition functions for locally stable secondary structures.
#include <ViennaRNA/LPfold.h>
pfl_fold computes partition functions for every window of size ‘winSize’ possible in a RNA molecule, allowing only pairs with a span smaller than ‘pairSize’. It returns the mean pair probabilities averaged over all windows containing the pair in ‘pl’. ‘winSize’ should always be >= ‘pairSize’. Note that in contrast to Lfold(), bases outside of the window do not influence the structure at all. Only probabilities higher than ‘cutoffb’ are kept.
If ‘pU’ is supplied (i.e is not the NULL pointer), pfl_fold() will also compute the mean probability that regions of length ‘u’ and smaller are unpaired. The parameter ‘u’ is supplied in ‘pup[0][0]’. On return the ‘pup’ array will contain these probabilities, with the entry on ‘pup[x][y]’ containing the mean probability that x and the y-1 preceding bases are unpaired. The ‘pU’ array needs to be large enough to hold n+1 float* entries, where n is the sequence length.
If an array dpp2 is supplied, the probability of base pair (i,j) given that there already exists a base pair (i+1,j-1) is also computed and saved in this array. If pUfp is given (i.e. not NULL), pU is not saved but put out imediately. If spup is given (i.e. is not NULL), the pair probabilities in pl are not saved but put out imediately.
- Parameters:
sequence – RNA sequence
winSize – size of the window
pairSize – maximum size of base pair
cutoffb – cutoffb for base pairs
pU – array holding all unpaired probabilities
dpp2 – array of dependent pair probabilities
pUfp – file pointer for pU
spup – file pointer for pair probabilities
- Returns:
list of pair probabilities
-
vrna_ep_t *pfl_fold_par(char *sequence, int winSize, int pairSize, float cutoffb, double **pU, vrna_ep_t **dpp2, FILE *pUfp, FILE *spup, vrna_exp_param_t *parameters)#
Compute partition functions for locally stable secondary structures.
#include <ViennaRNA/LPfold.h>
-
void putoutpU_prob(double **pU, int length, int ulength, FILE *fp, int energies)#
Writes the unpaired probabilities (pU) or opening energies into a file.
#include <ViennaRNA/LPfold.h>
Can write either the unpaired probabilities (accessibilities) pU or the opening energies -log(pU)kT into a file
- Parameters:
pU – pair probabilities
length – length of RNA sequence
ulength – maximum length of unpaired stretch
fp – file pointer of destination file
energies – switch to put out as opening energies
-
void putoutpU_prob_bin(double **pU, int length, int ulength, FILE *fp, int energies)#
Writes the unpaired probabilities (pU) or opening energies into a binary file.
#include <ViennaRNA/LPfold.h>
Can write either the unpaired probabilities (accessibilities) pU or the opening energies -log(pU)kT into a file
- Parameters:
pU – pair probabilities
length – length of RNA sequence
ulength – maximum length of unpaired stretch
fp – file pointer of destination file
energies – switch to put out as opening energies
-
void update_pf_paramsLP(int length)#