RNAlib-2.2.4
|
Modules | |
Generalized Soft Constraints | |
Files | |
file | ligand.h |
Data Structures | |
struct | vrna_sc_s |
The soft constraints data structure. More... | |
Macros | |
#define | VRNA_CONSTRAINT_SOFT_MFE 8192U |
Soft constraints flag, apply constraints for MFE calculations. | |
#define | VRNA_CONSTRAINT_SOFT_PF 16384U |
Soft constraints flag, apply constraints for partition function calculations. | |
#define | VRNA_OBJECTIVE_FUNCTION_QUADRATIC 0 |
Use the sum of squared aberrations as objective function. More... | |
#define | VRNA_OBJECTIVE_FUNCTION_ABSOLUTE 1 |
Use the sum of absolute aberrations as objective function. More... | |
#define | VRNA_MINIMIZER_DEFAULT 0 |
Use a custom implementation of the gradient descent algorithm to minimize the objective function. | |
#define | VRNA_MINIMIZER_CONJUGATE_FR 1 |
Use the GNU Scientific Library implementation of the Fletcher-Reeves conjugate gradient algorithm to minimize the objective function. More... | |
#define | VRNA_MINIMIZER_CONJUGATE_PR 2 |
Use the GNU Scientific Library implementation of the Polak-Ribiere conjugate gradient algorithm to minimize the objective function. More... | |
#define | VRNA_MINIMIZER_VECTOR_BFGS 3 |
Use the GNU Scientific Library implementation of the vector Broyden-Fletcher-Goldfarb-Shanno algorithm to minimize the objective function. More... | |
#define | VRNA_MINIMIZER_VECTOR_BFGS2 4 |
Use the GNU Scientific Library implementation of the vector Broyden-Fletcher-Goldfarb-Shanno algorithm to minimize the objective function. More... | |
#define | VRNA_MINIMIZER_STEEPEST_DESCENT 5 |
Use the GNU Scientific Library implementation of the steepest descent algorithm to minimize the objective function. More... | |
Typedefs | |
typedef void(* | progress_callback) (int iteration, double score, double *epsilon) |
Callback for following the progress of the minimization process. More... | |
Functions | |
void | vrna_sc_init (vrna_fold_compound_t *vc) |
Initialize an empty soft constraints data structure within a vrna_fold_compound_t. More... | |
void | vrna_sc_add_bp (vrna_fold_compound_t *vc, const FLT_OR_DBL **constraints, unsigned int options) |
Add soft constraints for paired nucleotides. More... | |
void | vrna_sc_add_up (vrna_fold_compound_t *vc, const FLT_OR_DBL *constraints, unsigned int options) |
Add soft constraints for unpaired nucleotides. More... | |
void | vrna_sc_remove (vrna_fold_compound_t *vc) |
Remove soft constraints from vrna_fold_compound_t. More... | |
void | vrna_sc_free (vrna_sc_t *sc) |
Free memory occupied by a vrna_sc_t data structure. More... | |
int | vrna_sc_add_SHAPE_deigan (vrna_fold_compound_t *vc, const double *reactivities, double m, double b, unsigned int options) |
Add SHAPE reactivity data as soft constraints (Deigan et al. method) More... | |
int | vrna_sc_add_SHAPE_deigan_ali (vrna_fold_compound_t *vc, 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) More... | |
int | vrna_sc_add_SHAPE_zarringhalam (vrna_fold_compound_t *vc, 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) More... | |
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. More... | |
void | vrna_sc_minimize_pertubation (vrna_fold_compound_t *vc, 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. More... | |
struct vrna_sc_s |
The soft constraints data structure.
Data Fields | |
int ** | energy_up |
Energy contribution for stretches of unpaired nucleotides. | |
int * | energy_bp |
Energy contribution for base pairs. | |
FLT_OR_DBL ** | exp_energy_up |
Boltzmann Factors of the energy contributions for unpaired sequence stretches. | |
FLT_OR_DBL * | exp_energy_bp |
Boltzmann Factors of the energy contribution for base pairs. | |
int * | energy_stack |
Pseudo Energy contribution per base pair involved in a stack. | |
FLT_OR_DBL * | exp_energy_stack |
Boltzmann weighted pseudo energy contribution per nucleotide involved in a stack. | |
vrna_callback_sc_energy * | f |
A function pointer used for pseudo energy contribution in MFE calculations. More... | |
vrna_callback_sc_backtrack * | bt |
A function pointer used to obtain backtraced base pairs in loop regions that were altered by soft constrained pseudo energy contributions. More... | |
vrna_callback_sc_exp_energy * | exp_f |
A function pointer used for pseudo energy contribution boltzmann factors in PF calculations. More... | |
void * | data |
A pointer to the data object provided for for pseudo energy contribution functions of the generalized soft constraints feature. | |
vrna_callback_sc_energy* vrna_sc_s::f |
A function pointer used for pseudo energy contribution in MFE calculations.
vrna_callback_sc_backtrack* vrna_sc_s::bt |
A function pointer used to obtain backtraced base pairs in loop regions that were altered by soft constrained pseudo energy contributions.
vrna_callback_sc_exp_energy* vrna_sc_s::exp_f |
A function pointer used for pseudo energy contribution boltzmann factors in PF calculations.
#define VRNA_OBJECTIVE_FUNCTION_QUADRATIC 0 |
#include <ViennaRNA/perturbation_fold.h>
Use the sum of squared aberrations as objective function.
#define VRNA_OBJECTIVE_FUNCTION_ABSOLUTE 1 |
#include <ViennaRNA/perturbation_fold.h>
Use the sum of absolute aberrations as objective function.
#define VRNA_MINIMIZER_CONJUGATE_FR 1 |
#include <ViennaRNA/perturbation_fold.h>
Use the GNU Scientific Library implementation of the Fletcher-Reeves conjugate gradient algorithm to minimize the objective function.
Please note that this algorithm can only be used when the GNU Scientific Library is available on your system
#define VRNA_MINIMIZER_CONJUGATE_PR 2 |
#include <ViennaRNA/perturbation_fold.h>
Use the GNU Scientific Library implementation of the Polak-Ribiere conjugate gradient algorithm to minimize the objective function.
Please note that this algorithm can only be used when the GNU Scientific Library is available on your system
#define VRNA_MINIMIZER_VECTOR_BFGS 3 |
#include <ViennaRNA/perturbation_fold.h>
Use the GNU Scientific Library implementation of the vector Broyden-Fletcher-Goldfarb-Shanno algorithm to minimize the objective function.
Please note that this algorithm can only be used when the GNU Scientific Library is available on your system
#define VRNA_MINIMIZER_VECTOR_BFGS2 4 |
#include <ViennaRNA/perturbation_fold.h>
Use the GNU Scientific Library implementation of the vector Broyden-Fletcher-Goldfarb-Shanno algorithm to minimize the objective function.
Please note that this algorithm can only be used when the GNU Scientific Library is available on your system
#define VRNA_MINIMIZER_STEEPEST_DESCENT 5 |
#include <ViennaRNA/perturbation_fold.h>
Use the GNU Scientific Library implementation of the steepest descent algorithm to minimize the objective function.
Please note that this algorithm can only be used when the GNU Scientific Library is available on your system
typedef void(* progress_callback) (int iteration, double score, double *epsilon) |
#include <ViennaRNA/perturbation_fold.h>
Callback for following the progress of the minimization process.
iteration | The number of the current iteration |
score | The score of the objective function |
epsilon | The perturbation vector yielding the reported score |
void vrna_sc_init | ( | vrna_fold_compound_t * | vc | ) |
#include <ViennaRNA/constraints.h>
Initialize an empty soft constraints data structure within a vrna_fold_compound_t.
This function adds a proper soft constraints data structure to the vrna_fold_compound_t data structure. If soft constraints already exist within the fold compound, they are removed.
vc | The vrna_fold_compound_t where an empty soft constraint feature is to be added to |
void vrna_sc_add_bp | ( | vrna_fold_compound_t * | vc, |
const FLT_OR_DBL ** | constraints, | ||
unsigned int | options | ||
) |
#include <ViennaRNA/constraints.h>
Add soft constraints for paired nucleotides.
vc | The vrna_fold_compound_t the soft constraints are associated with |
constraints | A two-dimensional array of pseudo free energies in ![]() |
options | The options flag indicating how/where to store the soft constraints |
void vrna_sc_add_up | ( | vrna_fold_compound_t * | vc, |
const FLT_OR_DBL * | constraints, | ||
unsigned int | options | ||
) |
#include <ViennaRNA/constraints.h>
Add soft constraints for unpaired nucleotides.
vc | The vrna_fold_compound_t the soft constraints are associated with |
constraints | A vector of pseudo free energies in ![]() |
options | The options flag indicating how/where to store the soft constraints |
void vrna_sc_remove | ( | vrna_fold_compound_t * | vc | ) |
#include <ViennaRNA/constraints.h>
Remove soft constraints from vrna_fold_compound_t.
vc | The vrna_fold_compound_t possibly containing soft constraints |
void vrna_sc_free | ( | vrna_sc_t * | sc | ) |
#include <ViennaRNA/constraints.h>
Free memory occupied by a vrna_sc_t data structure.
sc | The data structure to free from memory |
int vrna_sc_add_SHAPE_deigan | ( | vrna_fold_compound_t * | vc, |
const double * | reactivities, | ||
double | m, | ||
double | b, | ||
unsigned int | options | ||
) |
#include <ViennaRNA/constraints.h>
Add SHAPE reactivity data as soft constraints (Deigan et al. method)
This approach of SHAPE directed RNA folding uses the simple linear ansatz
to convert SHAPE reactivity values to pseudo energies whenever a nucleotide contributes to a stacked pair. A positive slope
penalizes high reactivities in paired regions, while a negative intercept
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.
vc | 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 |
int vrna_sc_add_SHAPE_deigan_ali | ( | vrna_fold_compound_t * | vc, |
const char ** | shape_files, | ||
const int * | shape_file_association, | ||
double | m, | ||
double | b, | ||
unsigned int | options | ||
) |
#include <ViennaRNA/constraints.h>
Add SHAPE reactivity data from files as soft constraints for consensus structure prediction (Deigan et al. method)
vc | 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 |
int vrna_sc_add_SHAPE_zarringhalam | ( | vrna_fold_compound_t * | vc, |
const double * | reactivities, | ||
double | b, | ||
double | default_value, | ||
const char * | shape_conversion, | ||
unsigned int | options | ||
) |
#include <ViennaRNA/constraints.h>
Add SHAPE reactivity data as soft constraints (Zarringhalam et al. method)
This method first converts the observed SHAPE reactivity of nucleotide into a probability
that position
is unpaired by means of a non-linear map. Then pseudo-energies of the form
are computed, where if position
is unpaired and
if
is paired in a given secondary structure. The parameter
serves as scaling factor. The magnitude of discrepancy between prediction and experimental observation is represented by
.
vc | The vrna_fold_compound_t the soft constraints are associated with |
reactivities | A vector of normalized SHAPE reactivities |
b | The scaling factor ![]() |
options | The options flag indicating how/where to store the soft constraints |
int vrna_sc_SHAPE_to_pr | ( | const char * | shape_conversion, |
double * | values, | ||
int | length, | ||
double | default_value | ||
) |
#include <ViennaRNA/constraints.h>
Convert SHAPE reactivity values to probabilities for being unpaired.
This function parses the informations from a given file and stores the result in the preallocated string sequence and the FLT_OR_DBL array values.
shape_conversion | String definining 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 |
void vrna_sc_minimize_pertubation | ( | vrna_fold_compound_t * | vc, |
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 | ||
) |
#include <ViennaRNA/perturbation_fold.h>
Find a vector of perturbation energies that minimizes the discripancies between predicted and observed pairing probabilities and the amount of neccessary adjustments.
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
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.
vc | 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 |
callback | A pointer to a callback function used for reporting the current minimization progress |