Experimental Structure Probing Data#
In the following, you’ll find the respective API symbols that allow for the integration of experimental probing data.
Generic Probing Data API#
Include Experimental Structure Probing Data to Guide Structure Predictions.
Defines
-
VRNA_REACTIVITY_MISSING#
#include <ViennaRNA/probing/basic.h>
Typedefs
-
typedef struct vrna_probing_data_s *vrna_probing_data_t#
A data structure that contains RNA structure probing data and specifies how this data is to be integrated into structure predictions.
#include <ViennaRNA/probing/basic.h>
Functions
-
int vrna_sc_probing(vrna_fold_compound_t *fc, vrna_probing_data_t data)#
Apply probing data (e.g. SHAPE) to guide the structure prediction.
#include <ViennaRNA/probing/basic.h>
- SWIG Wrapper Notes:
This function is attached as method sc_probing() to objects of type fold_compound. See, e.g.
RNA.fold_compound.sc_probing()in the The RNA Python module .
See also
vrna_probing_data_t, vrna_probing_data_free(), vrna_probing_data_deigan(), vrna_probing_data_deigan_comparative(), vrna_probing_data_zarringhalam(), vrna_probing_data_zarringhalam_comparative(), vrna_probing_data_eddy(), vrna_probing_data_eddy_comparative()
- Parameters:
fc – The vrna_fold_compound_t the probing data should be applied to in subsequent computations
data – The prepared probing data and probing data integration strategy
- Returns:
The number of probing data sets applied, 0 upon any error
-
vrna_probing_data_t vrna_probing_data_linear(const double *data, unsigned int data_length, const double *data_weights, vrna_probing_strategy_f strategy_cb, void *strategy_cb_options, vrna_auxdata_free_f strategy_cb_options_free, unsigned int options)#
#include <ViennaRNA/probing/basic.h>
-
vrna_probing_data_t vrna_probing_data_linear_multi(const double **data, unsigned int data_size, const unsigned int *data_lengths, const double **data_weights, vrna_probing_strategy_f *strategy_cbs, void **strategy_cbs_options, vrna_auxdata_free_f *strategy_cbs_options_free, unsigned int options)#
#include <ViennaRNA/probing/basic.h>
-
void vrna_probing_data_free(vrna_probing_data_t d)#
Free memory occupied by the (prepared) probing data.
#include <ViennaRNA/probing/basic.h>
-
unsigned int vrna_probing_data_linear_num(struct vrna_probing_data_s *data)#
Get the number of structure probing data sets.
#include <ViennaRNA/probing/basic.h>
See also
vrna_probing_data_linear(), vrna_probing_data_linear_multi()
- Parameters:
data – The data structure storing the probing data
- Returns:
The number of probing data sets stored in
data
-
double *vrna_probing_data_linear_raw(struct vrna_probing_data_s *data, unsigned int pos, unsigned int *data_size)#
Get the raw probing data.
#include <ViennaRNA/probing/basic.h>
This function retrieves a copy of the structure probing data set number
posas stored indata. The number of values returned by this function is stored indata_size.See also
vrna_probing_data_linear(), vrna_probing_data_linear_multi(), vrna_probing_data_linear_num(), vrna_probing_data_linear_weight(), vrna_probing_data_linear_energies()
- Parameters:
data – The data structure storing the probing data
pos – The position of the data set
data_size – A pointer to a variable to store the number of returned values to
- Returns:
A copy of the
pos-th probing data set stored indata
-
double *vrna_probing_data_linear_weight(struct vrna_probing_data_s *data, unsigned int pos, unsigned int *data_size)#
Get the weights for a probing data set.
#include <ViennaRNA/probing/basic.h>
See also
vrna_probing_data_linear(), vrna_probing_data_linear_multi(), vrna_probing_data_linear_num(), vrna_probing_data_linear_raw(), vrna_probing_data_linear_energies()
- Parameters:
data – The data structure storing the probing data
pos – The position of the weights vector
data_size – A pointer to a variable to store the number of returned values to
- Returns:
A copy of the
pos-th weighting vector stored indata
-
double *vrna_probing_data_linear_energies(struct vrna_probing_data_s *data, unsigned int pos, vrna_fold_compound_t *fc, unsigned int target, unsigned int *data_size)#
Get pseudo energy contributions from a structure probing data set.
#include <ViennaRNA/probing/basic.h>
This function retrieves a vector of pseudo energies derived from a set of structure probing data stored in
data. For that, the function calls the probing data strategy that is associated withdata.See also
vrna_probing_data_linear(), vrna_probing_data_linear_multi(), vrna_probing_data_linear_num(), vrna_probing_data_linear_raw(), vrna_probing_data_linear_weight(), VRNA_PROBING_DATA_LINEAR_TARGET_STACK, VRNA_PROBING_DATA_LINEAR_TARGET_UP, VRNA_PROBING_DATA_LINEAR_TARGET_BP
- Parameters:
data – The data structure storing the probing data
pos – The position of the weights vector
fc – The fold_compound that will be passed through to the conversion strategy
target – The target, i.e. the structure context the pseudo energies should be applied to
data_size – A pointer to a variable to store the number of returned values to
- Returns:
An array of pseudo energies (1-based) or NULL
-
double **vrna_probing_data_load_n_distribute(unsigned int n_seq, unsigned int *ns, const char **sequences, const char **file_names, const int *file_name_association, unsigned int options)#
#include <ViennaRNA/probing/basic.h>
-
vrna_probing_data_t vrna_probing_data_Deigan2009(const double *reactivities, unsigned int n, double m, double b)#
#include <ViennaRNA/probing/basic.h>
- SWIG Wrapper Notes:
This function exists in two forms, (i) as overloaded function probing_data_Deigan2009() and (ii) as constructor of the probing_data object. For the former the second argument
ncan be omitted since the length of thereactivitieslist is determined from the list itself. When the vrna_probing_data_t constructor is called with the three parametersreactivities,mandb, it will automatically create a prepared data structure for the Deigan et al. 2009 method. See, e.g.RNA.probing_data_Deigan2009()andRNA.probing_data()in the The RNA Python module .
-
vrna_probing_data_t vrna_probing_data_Deigan2009_comparative(const double **reactivities, const unsigned int *n, unsigned int n_seq, double *ms, double *bs, unsigned int multi_params)#
#include <ViennaRNA/probing/basic.h>
-
vrna_probing_data_t vrna_probing_data_Zarringhalam2012(const double *reactivities, unsigned int n, double beta, const char *pr_conversion, double pr_default)#
#include <ViennaRNA/probing/basic.h>
-
vrna_probing_data_t vrna_probing_data_Zarringhalam2012_comparative(const double **reactivities, unsigned int *n, unsigned int n_seq, double *betas, const char **pr_conversions, double *pr_defaults, unsigned int multi_params)#
#include <ViennaRNA/probing/basic.h>
-
vrna_probing_data_t vrna_probing_data_Eddy2014_2(const double *reactivities, unsigned int n, const double *unpaired_data, unsigned int unpaired_len, const double *paired_data, unsigned int paired_len)#
#include <ViennaRNA/probing/basic.h>
-
vrna_probing_data_t vrna_probing_data_Eddy2014_2_comparative(const double **reactivities, unsigned int *n, unsigned int n_seq, const double **unpaired_datas, unsigned int *unpaired_lens, const double **paired_datas, unsigned int *paired_lens, unsigned int multi_params)#
#include <ViennaRNA/probing/basic.h>
-
int vrna_sc_SHAPE_parse_method(const char *method_string, char *method, float *param_1, float *param_2)#
Parse a character string and extract the encoded SHAPE reactivity conversion method and possibly the parameters for conversion into pseudo free energies.
#include <ViennaRNA/probing/SHAPE.h>
- Parameters:
method_string – The string that contains the encoded SHAPE reactivity conversion method
method – A pointer to the memory location where the method character will be stored
param_1 – A pointer to the memory location where the first parameter of the corresponding method will be stored
param_2 – A pointer to the memory location where the second parameter of the corresponding method will be stored
- Returns:
1 on successful extraction of the method, 0 on errors
-
VRNA_REACTIVITY_MISSING#
Strategies for Linear Data#
Generic Probing Data Strategy API#
Defines
-
VRNA_PROBING_DATA_WEIGHT_POSITION_WISE#
#include <ViennaRNA/probing/basic.h>
-
VRNA_PROBING_DATA_SINGLE_STRATEGY#
#include <ViennaRNA/probing/basic.h>
-
VRNA_PROBING_DATA_SINGLE_WEIGHT#
#include <ViennaRNA/probing/basic.h>
-
VRNA_PROBING_DATA_DEFAULT#
#include <ViennaRNA/probing/basic.h>
-
VRNA_PROBING_DATA_LINEAR_TARGET_STACK#
Target flag indicating base pair stack contributions for vrna_probing_strategy_f.
#include <ViennaRNA/probing/basic.h>
-
VRNA_PROBING_DATA_LINEAR_TARGET_UP#
Target flag indicating unpaired nucleotide contributions for vrna_probing_strategy_f.
#include <ViennaRNA/probing/basic.h>
-
VRNA_PROBING_DATA_LINEAR_TARGET_BP#
Target flag indicating base pair contributions for vrna_probing_strategy_f.
#include <ViennaRNA/probing/basic.h>
-
VRNA_PROBING_METHOD_MULTI_PARAMS_0#
probing data conversion flag for comparative structure predictions indicating no parameter to be sequence specific
#include <ViennaRNA/probing/basic.h>
-
VRNA_PROBING_METHOD_MULTI_PARAMS_1#
probing data conversion flag for comparative structure predictions indicating 1st parameter to be sequence specific
#include <ViennaRNA/probing/basic.h>
-
VRNA_PROBING_METHOD_MULTI_PARAMS_2#
probing data conversion flag for comparative structure predictions indicating 2nd parameter to be sequence specific
#include <ViennaRNA/probing/basic.h>
-
VRNA_PROBING_METHOD_MULTI_PARAMS_3#
probing data conversion flag for comparative structure predictions indicating 3rd parameter to be sequence specific
#include <ViennaRNA/probing/basic.h>
-
VRNA_PROBING_METHOD_MULTI_PARAMS_DEFAULT#
probing data conversion flag for comparative structure predictions indicating default parameter settings
#include <ViennaRNA/probing/basic.h>
Essentially, this setting indicates that all probing data is to be converted using the same parameters. Use any combination of VRNA_PROBING_METHOD_MULTI_PARAMS_1, VRNA_PROBING_METHOD_MULTI_PARAMS_2, VRNA_PROBING_METHOD_MULTI_PARAMS_3, and so on to indicate that the first, second, third, or other parameter is sequence specific.
Typedefs
-
typedef void *vrna_probing_strategy_opt_t#
#include <ViennaRNA/probing/basic.h>
-
typedef double *(*vrna_probing_strategy_f)(vrna_fold_compound_t *fc, const double *data, size_t data_size, unsigned int target, void *options)#
Prototype of a strategy to derive pseudo energies from linear structure probing data.
#include <ViennaRNA/probing/basic.h>
- Param fc:
The fold compound the probing data will be applied to
- Param data:
The structure probing data (1-based array of reactivity values)
- Param data_size:
The size of
data, i.e. the total number of reactivity values- Param target:
The structural context for which pseudo energies are requested from the strategy
- Param options:
An arbitrary data structure the strategy requires for working on the data
- Return:
A pointer to an array of pseudo energies ready to be included as soft constraints
Functions
-
double *vrna_probing_strategy_chain(vrna_fold_compound_t *fc, const double *data, size_t data_size, unsigned int target, vrna_probing_strategy_opt_t options)#
#include <ViennaRNA/probing/basic.h>
-
vrna_probing_strategy_opt_t vrna_probing_strategy_chain_data(vrna_probing_strategy_f strategy_cb, vrna_probing_strategy_opt_t strategy_cb_options, vrna_auxdata_free_f strategy_cb_options_free)#
#include <ViennaRNA/probing/basic.h>
-
size_t vrna_probing_strategy_chain_data_append(vrna_probing_strategy_opt_t chain, vrna_probing_strategy_f strategy_cb, vrna_probing_strategy_opt_t strategy_cb_options, vrna_auxdata_free_f strategy_cb_options_free)#
#include <ViennaRNA/probing/basic.h>
-
size_t vrna_probing_strategy_chain_data_size(vrna_probing_strategy_opt_t chain)#
#include <ViennaRNA/probing/basic.h>
-
vrna_probing_strategy_f vrna_probing_strategy_chain_data_at(vrna_probing_strategy_opt_t chain, size_t pos, vrna_probing_strategy_opt_t *strategy_cb_options)#
#include <ViennaRNA/probing/basic.h>
-
void vrna_probing_strategy_chain_data_free(vrna_probing_strategy_opt_t options)#
#include <ViennaRNA/probing/basic.h>
-
VRNA_PROBING_DATA_WEIGHT_POSITION_WISE#
The Deigan 2009 Strategy API#
Defines
Functions
-
double *vrna_probing_strategy_deigan(vrna_fold_compound_t *fc, const double *data, size_t data_size, unsigned int target, void *options)#
#include <ViennaRNA/probing/strategy_deigan.h>
-
void *vrna_probing_strategy_deigan_options(double m, double b, double max_value, vrna_math_fun_dbl_f cb_preprocess, vrna_math_fun_dbl_opt_t cb_preprocess_opt, vrna_math_fun_dbl_opt_free_f cb_preprocess_opt_free)#
#include <ViennaRNA/probing/strategy_deigan.h>
-
void vrna_probing_strategy_deigan_options_free(void *options)#
#include <ViennaRNA/probing/strategy_deigan.h>
-
vrna_probing_data_t vrna_probing_data_deigan(const double *reactivities, unsigned int n, double m, double b)#
Prepare probing data according to Deigan et al. 2009 method.
#include <ViennaRNA/probing/strategy_deigan.h>
Prepares a data structure to be used with vrna_sc_probing() to directed RNA folding using the simple linear ansatz
\[ \Delta G_{\text{SHAPE}}(i) = m \ln(\text{SHAPE reactivity}(i)+1)+ b \]to convert probing data, e.g. SHAPE reactivity values, to pseudo energies whenever a nucleotide \( i \) contributes to a stacked pair. A positive slope \( m \) penalizes high reactivities in paired regions, while a negative intercept \( b \) results in a confirmatory bonus free energy for correctly predicted base pairs. Since the energy evaluation of a base pair stack involves two pairs, the pseudo energies are added for all four contributing nucleotides. Consequently, the energy term is applied twice for pairs inside a helix and only once for pairs adjacent to other structures. For all other loop types the energy model remains unchanged even when the experimental data highly disagrees with a certain motif.
See also
vrna_probing_data_t, vrna_probing_data_free(), vrna_sc_probing(), vrna_probing_data_deigan_comparative(), vrna_probing_data_zarringhalam(), vrna_probing_data_zarringhalam_comparative(), vrna_probing_data_eddy(), vrna_probing_data_eddy_comparative()
Note
For further details, we refer to Deigan et al. [2009] .
- Parameters:
reactivities – 1-based array of per-nucleotide probing data, e.g. SHAPE reactivities
n – The length of the
reactivitieslistm – The slope used for the probing data to soft constraints conversion strategy
b – The intercept used for the probing data to soft constraints conversion strategy
- Returns:
A pointer to a data structure containing the probing data and any preparations necessary to use it in vrna_sc_probing() according to the method of Deigan et al. [2009] or NULL on any error.
-
vrna_probing_data_t vrna_probing_data_deigan_trans(const double *reactivities, unsigned int n, double m, double b, vrna_math_fun_dbl_f cb_preprocess, vrna_math_fun_dbl_opt_t cb_preprocess_opt, vrna_math_fun_dbl_opt_free_f cb_preprocess_opt_free)#
#include <ViennaRNA/probing/strategy_deigan.h>
-
vrna_probing_data_t vrna_probing_data_deigan_comparative(const double **reactivities, const unsigned int *n, unsigned int n_seq, double *ms, double *bs, unsigned int multi_params)#
Prepare (multiple) probing data according to Deigan et al. 2009 method for comparative structure predictions.
#include <ViennaRNA/probing/strategy_deigan.h>
Similar to vrna_probing_data_deigan(), this function prepares a data structure to be used with vrna_sc_probing() to directed RNA folding using the simple linear ansatz
\[ \Delta G_{\text{SHAPE}}(i) = m \ln(\text{SHAPE reactivity}(i)+1)+ b \]to convert probing data, e.g. SHAPE reactivity values, to pseudo energies whenever a nucleotide \( i \) contributes to a stacked pair. This functions purpose is to allow for adding multiple probing data as required for comparative structure predictions over multiple sequence alignments (MSA) with
n_seqsequences. For that purpose,reactivitiescan be provided for any of the sequences in the MSA. Individual probing data is always expected to be specified in sequence coordinates, i.e. without considering gaps in the MSA. Therefore, each set ofreactivitiesmay have a different length as specified the parametern. In addition, each set of probing data may undergo the conversion using different parameters \( m \) and \( b \). Whether or not multiple sets of conversion parameters are provided must be specified using themulti_paramsflag parameter. Use VRNA_PROBING_METHOD_MULTI_PARAMS_1 to indicate thatmspoints to an array of slopes for each sequence. Along with that, VRNA_PROBING_METHOD_MULTI_PARAMS_2 indicates thatbsis pointing to an array of intercepts for each sequence. Bitwise-OR of the two values renders both parameters to be sequence specific.See also
vrna_probing_data_t, vrna_probing_data_free(), vrna_sc_probing(), vrna_probing_data_deigan(), vrna_probing_data_zarringhalam(), vrna_probing_data_zarringhalam_comparative(), vrna_probing_data_eddy(), vrna_probing_data_eddy_comparative(), VRNA_PROBING_METHOD_MULTI_PARAMS_0, VRNA_PROBING_METHOD_MULTI_PARAMS_1, VRNA_PROBING_METHOD_MULTI_PARAMS_2, VRNA_PROBING_METHOD_MULTI_PARAMS_DEFAULT
Note
For further details, we refer to Deigan et al. [2009] .
- Parameters:
reactivities – 0-based array of 1-based arrays of per-nucleotide probing data, e.g. SHAPE reactivities
n – 0-based array of lengths of the
reactivitieslistsn_seq – The number of sequences in the MSA
ms – 0-based array of the slopes used for the probing data to soft constraints conversion strategy or the address of a single slope value to be applied for all data
bs – 0-based array of the intercepts used for the probing data to soft constraints conversion strategy or the address of a single intercept value to be applied for all data
multi_params – A flag indicating what is passed through parameters
msandbs
- Returns:
A pointer to a data structure containing the probing data and any preparations necessary to use it in vrna_sc_probing() according to the method of Deigan et al. [2009] or NULL on any error.
-
vrna_probing_data_t vrna_probing_data_deigan_trans_comparative(const double **reactivities, const unsigned int *n, unsigned int n_seq, double *ms, double *bs, unsigned int multi_params, vrna_math_fun_dbl_f *cb_preprocess, vrna_math_fun_dbl_opt_t *cb_preprocess_opt, vrna_math_fun_dbl_opt_free_f *cb_preprocess_opt_free)#
#include <ViennaRNA/probing/strategy_deigan.h>
-
double *vrna_probing_strategy_deigan(vrna_fold_compound_t *fc, const double *data, size_t data_size, unsigned int target, void *options)#
The Zarringhalam 2012 Strategy API#
Defines
-
VRNA_PROBING_METHOD_ZARRINGHALAM2012_DEFAULT_beta#
Default parameter
betaas used in method of Zarringhalam et al. [2012] .#include <ViennaRNA/probing/strategy_zarringhalam.h>
Functions
-
double *vrna_probing_strategy_zarringhalam(vrna_fold_compound_t *fc, const double *data, size_t data_size, unsigned int target, void *options)#
#include <ViennaRNA/probing/strategy_zarringhalam.h>
-
void *vrna_probing_strategy_zarringhalam_options(double beta, double default_probability, double max_value, vrna_math_fun_dbl_f cb_preprocess, vrna_math_fun_dbl_opt_t cb_preprocess_opt, vrna_math_fun_dbl_opt_free_f cb_preprocess_opt_free)#
#include <ViennaRNA/probing/strategy_zarringhalam.h>
-
void vrna_probing_strategy_zarringhalam_options_free(void *option)#
#include <ViennaRNA/probing/strategy_zarringhalam.h>
-
vrna_probing_data_t vrna_probing_data_zarringhalam(const double *reactivities, unsigned int n, double beta, const char *pr_conversion, double pr_default)#
Prepare probing data according to Zarringhalam et al. 2012 method.
#include <ViennaRNA/probing/strategy_zarringhalam.h>
Prepares a data structure to be used with vrna_sc_probing() to directed RNA folding using the method of Zarringhalam et al. [2012] .
This method first converts the observed probing data of nucleotide \( i \) into a probability \( q_i \) that position \( i \) is unpaired by means of a non-linear map. Then pseudo-energies of the form
\[ \Delta G_{\text{SHAPE}}(x,i) = \beta\ |x_i - q_i| \]are computed, where \( x_i=0 \) if position \( i \) is unpaired and \( x_i=1 \) if \( i \) is paired in a given secondary structure. The parameter \( \beta \) serves as scaling factor. The magnitude of discrepancy between prediction and experimental observation is represented by \( |x_i - q_i| \).
See also
vrna_probing_data_t, vrna_probing_data_free(), vrna_sc_probing(), vrna_probing_data_zarringhalam_comparative(), vrna_probing_data_deigan(), vrna_probing_data_deigan_comparative(), vrna_probing_data_eddy(), vrna_probing_data_eddy_comparative()
Note
For further details, we refer to Zarringhalam et al. [2012]
- Parameters:
reactivities – 1-based array of per-nucleotide probing data, e.g. SHAPE reactivities
n – The length of the
reactivitieslistbeta – The scaling factor \( \beta \) of the conversion function
pr_conversion – A flag that specifies how to convert reactivities to probabilities
pr_default – The default probability for a nucleotide where reactivity data is missing for
- Returns:
A pointer to a data structure containing the probing data and any preparations necessary to use it in vrna_sc_probing() according to the method of Zarringhalam et al. [2012] or NULL on any error.
-
vrna_probing_data_t vrna_probing_data_zarringhalam_trans(const double *reactivities, unsigned int n, double beta, double pr_default, vrna_math_fun_dbl_f cb_preprocess, vrna_math_fun_dbl_opt_t cb_preprocess_opt, vrna_math_fun_dbl_opt_free_f cb_preprocess_opt_free)#
#include <ViennaRNA/probing/strategy_zarringhalam.h>
-
vrna_probing_data_t vrna_probing_data_zarringhalam_comparative(const double **reactivities, unsigned int *n, unsigned int n_seq, double *betas, const char **pr_conversions, double *pr_defaults, unsigned int multi_params)#
Prepare probing data according to Zarringhalam et al. 2012 method for comparative structure predictions.
#include <ViennaRNA/probing/strategy_zarringhalam.h>
Similar to vrna_probing_data_zarringhalam(), this function prepares a data structure to be used with vrna_sc_probing() to guide RNA folding using the method of Zarringhalam et al. [2012] .
This functions purpose is to allow for adding multiple probing data as required for comparative structure predictions over multiple sequence alignments (MSA) with
n_seqsequences. For that purpose,reactivitiescan be provided for any of the sequences in the MSA. Individual probing data is always expected to be specified in sequence coordinates, i.e. without considering gaps in the MSA. Therefore, each set ofreactivitiesmay have a different length as specified the parametern. In addition, each set of probing data may undergo the conversion using different parameters \( beta \). Additionally, the probing data to probability conversions strategy and default values for missing data can be specified in a sequence-based manner. Whether or not multiple conversion parameters are provided must be specified using themulti_paramsflag parameter. Use VRNA_PROBING_METHOD_MULTI_PARAMS_1 to indicate thatbetaspoints to an array of \( beta \) values for each sequence. VRNA_PROBING_METHOD_MULTI_PARAMS_2 indicates thatpr_conversionsis pointing to an array of probing data to probability conversion strategies, and VRNA_PROBING_METHOD_MULTI_PARAMS_3 indicates multiple default probabilities for missing data. Bitwise-OR of the three values renders all of them to be sequence specific.See also
vrna_probing_data_t, vrna_probing_data_free(), vrna_sc_probing(), vrna_probing_data_zarringhalam_comparative(), vrna_probing_data_deigan(), vrna_probing_data_deigan_comparative(), vrna_probing_data_eddy(), vrna_probing_data_eddy_comparative(), VRNA_PROBING_METHOD_MULTI_PARAMS_0, VRNA_PROBING_METHOD_MULTI_PARAMS_1, VRNA_PROBING_METHOD_MULTI_PARAMS_2, VRNA_PROBING_METHOD_MULTI_PARAMS_3, VRNA_PROBING_METHOD_MULTI_PARAMS_DEFAULT
Note
For further details, we refer to Zarringhalam et al. [2012]
- Parameters:
reactivities – 0-based array of 1-based arrays of per-nucleotide probing data, e.g. SHAPE reactivities
n – 0-based array of lengths of the
reactivitieslistsn_seq – The number of sequences in the MSA
betas – 0-based array with scaling factors \( \beta \) of the conversion function or the address of a scaling factor to be applied for all data
pr_conversions – 0-based array of flags that specifies how to convert reactivities to probabilities or the address of a conversion strategy to be applied for all data
pr_defaults – 0-based array of default probabilities for a nucleotide where reactivity data is missing for or the address of a single default probability to be applied for all data
multi_params – A flag indicating what is passed through parameters
betas,pr_conversions, andpr_defaults
- Returns:
A pointer to a data structure containing the probing data and any preparations necessary to use it in vrna_sc_probing() according to the method of Zarringhalam et al. [2012] or NULL on any error.
-
vrna_probing_data_t vrna_probing_data_zarringhalam_trans_comparative(const double **reactivities, unsigned int *n, unsigned int n_seq, double *betas, double *pr_defaults, unsigned int multi_params, vrna_math_fun_dbl_f *cb_preprocess, vrna_math_fun_dbl_opt_t *cb_preprocess_opt, vrna_math_fun_dbl_opt_free_f *cb_preprocess_opt_free)#
#include <ViennaRNA/probing/strategy_zarringhalam.h>
-
VRNA_PROBING_METHOD_ZARRINGHALAM2012_DEFAULT_beta#
The Eddy 2014 Strategy API#
Defines
-
VRNA_PROBING_STRATEGY_EDDY_OPTIONS_DEFAULT#
Default options for the Eddy [2014] : probing data conversion strategy.
#include <ViennaRNA/probing/strategy_eddy.h>
See also
vrna_probing_strategy_eddy_options(), vrna_probing_data_eddy(), vrna_probing_data_eddy_trans(), vrna_probing_data_eddy_comparative(), vrna_probing_data_eddy_trans_comparative()
-
VRNA_PROBING_STRATEGY_EDDY_NO_TEMPERATURE_RESCALING#
Prevent temperature dependent energy rescaling in Eddy [2014] strategy.
#include <ViennaRNA/probing/strategy_eddy.h>
This option flag forces the probing data conversion strategy to always use the same thermodynamic temperature \( T \), no matter what temperature the predictions are made for.
See also
vrna_probing_strategy_eddy_options(), vrna_probing_data_eddy(), vrna_probing_data_eddy_trans(), vrna_probing_data_eddy_comparative(), vrna_probing_data_eddy_trans_comparative()
Functions
-
double *vrna_probing_strategy_eddy(vrna_fold_compound_t *fc, const double *data, size_t data_size, unsigned int target, void *options)#
#include <ViennaRNA/probing/strategy_eddy.h>
-
void *vrna_probing_strategy_eddy_options(double temperature, unsigned char options, const double *prior_unpaired, size_t prior_unpaired_size, const double *prior_paired, size_t prior_paired_size, vrna_math_fun_dbl_f cb_preprocess, vrna_math_fun_dbl_opt_t cb_preprocess_opt, vrna_math_fun_dbl_opt_free_f cb_preprocess_opt_free)#
#include <ViennaRNA/probing/strategy_eddy.h>
-
void vrna_probing_strategy_eddy_options_free(void *options)#
#include <ViennaRNA/probing/strategy_eddy.h>
-
struct vrna_probing_data_s *vrna_probing_data_eddy(const double *reactivities, unsigned int n, double temperature, unsigned char options, const double *unpaired_data, unsigned int unpaired_len, const double *paired_data, unsigned int paired_len)#
Add probing data as soft constraints (Eddy/RNAprob-2 method).
#include <ViennaRNA/probing/strategy_eddy.h>
This approach of probing data directed RNA folding uses the probability framework proposed by Eddy [2014] :
\[ \Delta G_{\text{data}}(i) = - RT\ln(\mathbb{P}(\text{data}(i)\mid x_i\pi_i)) \]to convert probing data to pseudo energies for given nucleotide \( x_i \) and class probability \( \pi_i \) at position \( i \). The conditional probability is taken from a prior-distribution of probing data for the respective classes.
Here, the method distinguishes exactly two different classes of structural context, (i) unpaired and (ii) paired positions, following the lines of the RNAprob-2 method of Deng et al. [2016] . The reactivity distribution is computed using Gaussian kernel density estimation (KDE) with bandwidth \( h \) computed using Scott factor
\[ h = n^{-\frac{1}{5}} \]where \( n \) is the number of data points of the prior distribution.
See also
vrna_probing_data_t, vrna_probing_data_free(), vrna_sc_probing(), vrna_probing_data_eddy_comparative(), vrna_probing_data_deigan(), vrna_probing_data_deigan_comparative(), vrna_probing_data_zarringhalam(), vrna_probing_data_zarringhalam_comparative(), VRNA_PROBING_STRATEGY_EDDY_NO_TEMPERATURE_RESCALING, VRNA_PROBING_STRATEGY_EDDY_OPTIONS_DEFAULT
- Parameters:
reactivities – A 1-based vector of probing data, e.g. normalized SHAPE reactivities
n – Length of
reactivitiestemperature – The thermodynamic temperature \( T \)
options – Options bit flags to change the behavior of the strategy
unpaired_data – Pointer to an array of probing data for unpaired nucleotides
unpaired_len – Length of
unpaired_datapaired_data – Pointer to an array of probing data for paired nucleotides
paired_len – Length of
paired_data
- Returns:
A pointer to a data structure containing the probing data and any preparations necessary to use it in vrna_sc_probing() according to the method of Eddy [2014] or NULL on any error.
-
struct vrna_probing_data_s *vrna_probing_data_eddy_trans(const double *reactivities, unsigned int n, double temperature, unsigned char options, const double *unpaired_data, unsigned int unpaired_len, const double *paired_data, unsigned int paired_len, vrna_math_fun_dbl_f cb_preprocess, vrna_math_fun_dbl_opt_t cb_preprocess_opt, vrna_math_fun_dbl_opt_free_f cb_preprocess_opt_free)#
#include <ViennaRNA/probing/strategy_eddy.h>
-
struct vrna_probing_data_s *vrna_probing_data_eddy_comparative(const double **reactivities, const unsigned int *n, unsigned int n_seq, double temperature, unsigned char options, const double **unpaired_datas, const unsigned int *unpaired_lens, const double **paired_datas, const unsigned int *paired_lens, unsigned int multi_params)#
Add probing data as soft constraints (Eddy/RNAprob-2 method) for comparative structure predictions.
#include <ViennaRNA/probing/strategy_eddy.h>
Similar to vrna_probing_data_eddy(), this function prepares a data structure for probing data directed RNA folding. It uses the probability framework proposed by Eddy [2014] :
\[ \Delta G_{\text{data}}(i) = - RT\ln(\mathbb{P}(\text{data}(i)\mid x_i\pi_i)) \]to convert probing data to pseudo energies for given nucleotide \( x_i \) and class probability \( \pi_i \) at position \( i \). The conditional probability is taken from a prior-distribution of probing data for the respective classes.
This functions purpose is to allow for adding multiple probing data as required for comparative structure predictions over multiple sequence alignments (MSA) with
n_seqsequences. For that purpose,reactivitiescan be provided for any of the sequences in the MSA. Individual probing data is always expected to be specified in sequence coordinates, i.e. without considering gaps in the MSA. Therefore, each set ofreactivitiesmay have a different length as specified the parametern. In addition, each set of probing data may undergo the conversion using different prior distributions for unpaired and paired nucleotides. Whether or not multiple sets of conversion priors are provided must be specified using themulti_paramsflag parameter. Use VRNA_PROBING_METHOD_MULTI_PARAMS_1 to indicate thatunpaired_dataspoints to an array of unpaired probing data for each sequence. Similarly, VRNA_PROBING_METHOD_MULTI_PARAMS_2 indicates thatpaired_datasis pointing to an array paired probing data for each sequence. Bitwise-OR of the two values renders both parameters to be sequence specific.See also
vrna_probing_data_t, vrna_probing_data_free(), vrna_sc_probing(), vrna_probing_data_eddy(), vrna_probing_data_deigan(), vrna_probing_data_deigan_comparative(), vrna_probing_data_zarringhalam(), vrna_probing_data_zarringhalam_comparative(), VRNA_PROBING_METHOD_MULTI_PARAMS_0, VRNA_PROBING_METHOD_MULTI_PARAMS_1, VRNA_PROBING_METHOD_MULTI_PARAMS_2, VRNA_PROBING_METHOD_MULTI_PARAMS_DEFAULT
- Parameters:
reactivities – 0-based array of 1-based arrays of per-nucleotide probing data, e.g. SHAPE reactivities
n – 0-based array of lengths of the
reactivitieslistsn_seq – The number of sequences in the MSA
temperature – The thermodynamic temperature \( T \)
options – Options bit flags to change the behavior of the strategy
unpaired_datas – 0-based array of 0-based arrays with probing data for unpaired nucleotides or address of a single array of such data
unpaired_lens – 0-based array of lengths for each probing data array in
unpaired_dataspaired_datas – 0-based array of 0-based arrays with probing data for paired nucleotides or address of a single array of such data
paired_lens – 0-based array of lengths for each probing data array in
paired_datamulti_params – A flag indicating what is passed through parameters
unpaired_datasandpaired_datas
- Returns:
A pointer to a data structure containing the probing data and any preparations necessary to use it in vrna_sc_probing() according to the method of Eddy [2014] or NULL on any error.
-
struct vrna_probing_data_s *vrna_probing_data_eddy_trans_comparative(const double **reactivities, const unsigned int *n, unsigned int n_seq, double temperature, unsigned char options, const double **unpaired_datas, const unsigned int *unpaired_lens, const double **paired_datas, const unsigned int *paired_lens, unsigned int multi_params, vrna_math_fun_dbl_f *cb_preprocess, vrna_math_fun_dbl_opt_t *cb_preprocess_opt, vrna_math_fun_dbl_opt_free_f *cb_preprocess_opt_free)#
#include <ViennaRNA/probing/strategy_eddy.h>
-
VRNA_PROBING_STRATEGY_EDDY_OPTIONS_DEFAULT#
SHAPE Reactivity Data#
Incorporate SHAPE reactivity structure probing data into the folding recursions by means of soft constraints.
Defines
-
VRNA_PROBING_DATA_CHECK_SEQUENCE#
#include <ViennaRNA/probing/SHAPE.h>
Functions
-
int vrna_sc_SHAPE_to_pr(const char *shape_conversion, double *values, int length, double default_value)#
Convert SHAPE reactivity values to probabilities for being unpaired.
#include <ViennaRNA/probing/basic.h>
This function parses the informations from a given file and stores the result in the pre-allocated string sequence and the FLT_OR_DBL array values.
See also
- Parameters:
shape_conversion – String defining the method used for the conversion process
values – Pointer to an array of SHAPE reactivities
length – Length of the array of SHAPE reactivities
default_value – Result used for position with invalid/missing reactivity values
-
int vrna_sc_add_SHAPE_deigan(vrna_fold_compound_t *fc, const double *reactivities, double m, double b, unsigned int options)#
Add SHAPE reactivity data as soft constraints (Deigan et al. method).
#include <ViennaRNA/probing/SHAPE.h>
This approach of SHAPE directed RNA folding uses the simple linear ansatz
\[ \Delta G_{\text{SHAPE}}(i) = m \ln(\text{SHAPE reactivity}(i)+1)+ b \]to convert SHAPE reactivity values to pseudo energies whenever a nucleotide \( i \) contributes to a stacked pair. A positive slope \( m \) penalizes high reactivities in paired regions, while a negative intercept \( b \) results in a confirmatory bonus free energy for correctly predicted base pairs. Since the energy evaluation of a base pair stack involves two pairs, the pseudo energies are added for all four contributing nucleotides. Consequently, the energy term is applied twice for pairs inside a helix and only once for pairs adjacent to other structures. For all other loop types the energy model remains unchanged even when the experimental data highly disagrees with a certain motif.
- SWIG Wrapper Notes:
This function is attached as method
sc_add_SHAPE_deigan()to objects of typefold_compound. See, e.g.RNA.fold_compound.sc_add_SHAPE_deigan()in the The RNA Python module .
Note
For further details, we refer to Deigan et al. [2009] .
- Parameters:
fc – The vrna_fold_compound_t the soft constraints are associated with
reactivities – A vector of normalized SHAPE reactivities
m – The slope of the conversion function
b – The intercept of the conversion function
options – The options flag indicating how/where to store the soft constraints
- Returns:
1 on successful extraction of the method, 0 on errors
-
int vrna_sc_add_SHAPE_deigan_ali(vrna_fold_compound_t *fc, const char **shape_files, const int *shape_file_association, double m, double b, unsigned int options)#
Add SHAPE reactivity data from files as soft constraints for consensus structure prediction (Deigan et al. method).
#include <ViennaRNA/probing/SHAPE.h>
- SWIG Wrapper Notes:
This function is attached as method
sc_add_SHAPE_deigan_ali()to objects of typefold_compound. See, e.g.RNA.fold_compound.sc_add_SHAPE_deigan_ali()in the The RNA Python module .
- Parameters:
fc – The vrna_fold_compound_t the soft constraints are associated with
shape_files – A set of filenames that contain normalized SHAPE reactivity data
shape_file_association – An array of integers that associate the files with sequences in the alignment
m – The slope of the conversion function
b – The intercept of the conversion function
options – The options flag indicating how/where to store the soft constraints
- Returns:
1 on successful extraction of the method, 0 on errors
-
int vrna_sc_add_SHAPE_zarringhalam(vrna_fold_compound_t *fc, const double *reactivities, double b, double default_value, const char *shape_conversion, unsigned int options)#
Add SHAPE reactivity data as soft constraints (Zarringhalam et al. method).
#include <ViennaRNA/probing/SHAPE.h>
This method first converts the observed SHAPE reactivity of nucleotide \( i \) into a probability \( q_i \) that position \( i \) is unpaired by means of a non-linear map. Then pseudo-energies of the form
\[ \Delta G_{\text{SHAPE}}(x,i) = \beta\ |x_i - q_i| \]are computed, where \( x_i=0 \) if position \( i \) is unpaired and \( x_i=1 \) if \( i \) is paired in a given secondary structure. The parameter \( \beta \) serves as scaling factor. The magnitude of discrepancy between prediction and experimental observation is represented by \( |x_i - q_i| \).
- SWIG Wrapper Notes:
This function is attached as method
sc_add_SHAPE_zarringhalam()to objects of typefold_compound. See, e.g.RNA.fold_compound.sc_add_SHAPE_zarringhalam()in the The RNA Python module .
Note
For further details, we refer to Zarringhalam et al. [2012]
- Parameters:
fc – The vrna_fold_compound_t the soft constraints are associated with
reactivities – A vector of normalized SHAPE reactivities
b – The scaling factor \( \beta \) of the conversion function
default_value – The default value for a nucleotide where reactivity data is missing for
shape_conversion – A flag that specifies how to convert reactivities to probabilities
options – The options flag indicating how/where to store the soft constraints
- Returns:
1 on successful extraction of the method, 0 on errors
-
int vrna_sc_add_SHAPE_eddy_2(vrna_fold_compound_t *fc, const double *reactivities, int unpaired_nb, const double *unpaired_data, int paired_nb, const double *paired_data)#
Add SHAPE reactivity data as soft constraints (Eddy/RNAprob-2 method).
#include <ViennaRNA/probing/SHAPE.h>
This approach of SHAPE directed RNA folding uses the probability framework proposed by Eddy
\[ \Delta G_{\text{SHAPE}}(i) = - RT\ln(\mathbb{P}(\text{SHAPE reactivity}(i)\mid x_i\pi_i))+ \]to convert SHAPE reactivity values to pseudo energies for given nucleotide \( x_i \) and pairedness \( \pi_i \) at position \( i \). The reactivity distribution is computed using Gaussian kernel density estimation (KDE) with bandwidth \( h \) computed using Scott factor
\[ h = n^{-\frac{1}{5}} \]where \( n \) is the number of data points.
- Parameters:
fc – The vrna_fold_compound_t the soft constraints are associated with
reactivities – A vector of normalized SHAPE reactivities
unpaired_nb – Length of the array of unpaired SHAPE reactivities
unpaired_data – Pointer to an array of unpaired SHAPE reactivities
paired_nb – Length of the array of paired SHAPE reactivities
paired_data – Pointer to an array of paired SHAPE reactivities
- Returns:
1 on successful extraction of the method, 0 on errors
-
void vrna_constraints_add_SHAPE_ali(vrna_fold_compound_t *fc, const char *shape_method, const char **shape_files, const int *shape_file_association, int verbose, unsigned int constraint_type)#
#include <ViennaRNA/probing/SHAPE.h>
-
void vrna_constraints_add_SHAPE(vrna_fold_compound_t *fc, const char *shape_file, const char *shape_method, const char *shape_conversion, int verbose, unsigned int constraint_type)#
#include <ViennaRNA/probing/SHAPE.h>
-
VRNA_PROBING_DATA_CHECK_SEQUENCE#
Generate Soft Constraints from Data#
Find a vector of perturbation energies that minimizes the discripancies between predicted and observed pairing probabilities and the amount of neccessary adjustments.
Defines
-
VRNA_OBJECTIVE_FUNCTION_QUADRATIC#
Use the sum of squared aberrations as objective function.
#include <ViennaRNA/perturbation_fold.h>
\( F(\vec\epsilon) = \sum_{i = 1}^n{ \frac{\epsilon_i^2}{\tau^2} } + \sum_{i = 1}^n{ \frac{(p_i(\vec\epsilon) - q_i)^2}{\sigma^2} } \to min \)
-
VRNA_OBJECTIVE_FUNCTION_ABSOLUTE#
Use the sum of absolute aberrations as objective function.
#include <ViennaRNA/perturbation_fold.h>
\( F(\vec\epsilon) = \sum_{i = 1}^n{ \frac{|\epsilon_i|}{\tau^2} } + \sum_{i = 1}^n{ \frac{|p_i(\vec\epsilon) - q_i|}{\sigma^2} } \to min \)
-
VRNA_MINIMIZER_DEFAULT#
Use a custom implementation of the gradient descent algorithm to minimize the objective function.
#include <ViennaRNA/perturbation_fold.h>
-
VRNA_MINIMIZER_CONJUGATE_FR#
Use the GNU Scientific Library implementation of the Fletcher-Reeves conjugate gradient algorithm to minimize the objective function.
#include <ViennaRNA/perturbation_fold.h>
Please note that this algorithm can only be used when the GNU Scientific Library is available on your system
-
VRNA_MINIMIZER_CONJUGATE_PR#
Use the GNU Scientific Library implementation of the Polak-Ribiere conjugate gradient algorithm to minimize the objective function.
#include <ViennaRNA/perturbation_fold.h>
Please note that this algorithm can only be used when the GNU Scientific Library is available on your system
-
VRNA_MINIMIZER_VECTOR_BFGS#
Use the GNU Scientific Library implementation of the vector Broyden-Fletcher-Goldfarb-Shanno algorithm to minimize the objective function.
#include <ViennaRNA/perturbation_fold.h>
Please note that this algorithm can only be used when the GNU Scientific Library is available on your system
-
VRNA_MINIMIZER_VECTOR_BFGS2#
Use the GNU Scientific Library implementation of the vector Broyden-Fletcher-Goldfarb-Shanno algorithm to minimize the objective function.
#include <ViennaRNA/perturbation_fold.h>
Please note that this algorithm can only be used when the GNU Scientific Library is available on your system
-
VRNA_MINIMIZER_STEEPEST_DESCENT#
Use the GNU Scientific Library implementation of the steepest descent algorithm to minimize the objective function.
#include <ViennaRNA/perturbation_fold.h>
Please note that this algorithm can only be used when the GNU Scientific Library is available on your system
Typedefs
-
typedef void (*progress_callback)(int iteration, double score, double *epsilon)#
Callback for following the progress of the minimization process.
#include <ViennaRNA/perturbation_fold.h>
- Param iteration:
The number of the current iteration
- Param score:
The score of the objective function
- Param epsilon:
The perturbation vector yielding the reported score
Functions
-
void vrna_sc_minimize_pertubation(vrna_fold_compound_t *fc, const double *q_prob_unpaired, int objective_function, double sigma_squared, double tau_squared, int algorithm, int sample_size, double *epsilon, double initialStepSize, double minStepSize, double minImprovement, double minimizerTolerance, progress_callback callback)#
Find a vector of perturbation energies that minimizes the discripancies between predicted and observed pairing probabilities and the amount of neccessary adjustments.
#include <ViennaRNA/perturbation_fold.h>
Use an iterative minimization algorithm to find a vector of perturbation energies whose incorporation as soft constraints shifts the predicted pairing probabilities closer to the experimentally observed probabilities. The algorithm aims to minimize an objective function that penalizes discripancies between predicted and observed pairing probabilities and energy model adjustments, i.e. an appropriate vector of perturbation energies satisfies
\[F(\vec\epsilon) = \sum_{\mu}{ \frac{\epsilon_{\mu}^2}{\tau^2} } + \sum_{i = 1}^n{ \frac{(p_i(\vec\epsilon) - q_i)^2}{\sigma^2} } \to \min. \]An initialized fold compound and an array containing the observed probability for each nucleotide to be unbound are required as input data. The parameters objective_function, sigma_squared and tau_squared are responsible for adjusting the aim of the objective function. Dependend on which type of objective function is selected, either squared or absolute aberrations are contributing to the objective function. The ratio of the parameters sigma_squared and tau_squared can be used to adjust the algorithm to find a solution either close to the thermodynamic prediction (sigma_squared >> tau_squared) or close to the experimental data (tau_squared >> sigma_squared). The minimization can be performed by makeing use of a custom gradient descent implementation or using one of the minimizing algorithms provided by the GNU Scientific Library. All algorithms require the evaluation of the gradient of the objective function, which includes the evaluation of conditional pairing probabilites. Since an exact evaluation is expensive, the probabilities can also be estimated from sampling by setting an appropriate sample size. The found vector of perturbation energies will be stored in the array epsilon. The progress of the minimization process can be tracked by implementing and passing a callback function.
See also
For further details we refer to Washietl et al. [2012] .
- Parameters:
fc – Pointer to a fold compound
q_prob_unpaired – Pointer to an array containing the probability to be unpaired for each nucleotide
objective_function – The type of objective function to be used (VRNA_OBJECTIVE_FUNCTION_QUADRATIC / VRNA_OBJECTIVE_FUNCTION_LINEAR)
sigma_squared – A factor used for weighting the objective function. More weight on this factor will lead to a solution close to the null vector.
tau_squared – A factor used for weighting the objective function. More weight on this factor will lead to a solution close to the data provided in q_prob_unpaired.
algorithm – The minimization algorithm (VRNA_MINIMIZER_*)
sample_size – The number of sampled sequences used for estimating the pairing probabilities. A value <= 0 will lead to an exact evaluation.
epsilon – A pointer to an array used for storing the calculated vector of perturbation energies
initialStepSize
minStepSize
minImprovement
minimizerTolerance
callback – A pointer to a callback function used for reporting the current minimization progress
-
VRNA_OBJECTIVE_FUNCTION_QUADRATIC#