Generate soft constraints from data
Constraining the Secondary Structure Predictions and Evaluations

Find a vector of perturbation energies that minimizes the discripancies between predicted and observed pairing probabilities and the amount of neccessary adjustments. More...

Collaboration diagram for Generate soft constraints from data:

## Files

file | 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.

## Macros

#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_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...

## Detailed Description

Find a vector of perturbation energies that minimizes the discripancies between predicted and observed pairing probabilities and the amount of neccessary adjustments.

## Macro Definition Documentation

#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 Documentation

typedef void(* progress_callback) (int iteration, double score, double *epsilon)

`#include <ViennaRNA/perturbation_fold.h>`

Callback for following the progress of the minimization process.

Parameters

  iteration | The number of the current iteration
  score | The score of the objective function
  epsilon | The perturbation vector yielding the reported score

## Function Documentation

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.

See also
  For further details we refere to [16].

Parameters

  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