# Deprecated Interface for Global Partition Function Computation

  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)
    #include <ViennaRNA/alifold.h>

    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.

    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)
    #include <ViennaRNA/alifold.h>

    Get a pointer to the base pair probability array.

    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)
    #include <ViennaRNA/alifold.h>

    Free the memory occupied by folding matrices allocated by alipf_fold, alipf_circ_fold, etc.

    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)
    #include <ViennaRNA/alifold.h>

    Sample a consensus secondary structure from the Boltzmann ensemble according its probability.

    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)
    #include <ViennaRNA/alifold.h>

    Get pointers to (almost) all relavant arrays used in alifold’s partition function computation.

    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

  float pf_fold_par(const char *sequence, char *structure, vrna_exp_param_t *parameters, int calculate_bppm, int is_constrained, int is_circular)
    #include <ViennaRNA/part_func.h>

    Compute the partition function \(Q\) for a given RNA sequence.

    If structure is not a NULL pointer on input, it contains on return a string consisting of the letters “ . , | { } ( ) “ denoting bases that are essentially unpaired, weakly paired, strongly paired without preference, weakly upstream (downstream) paired, or strongly up- (down-)stream paired bases, respectively. If fold_constrained is not 0, the structure string is interpreted on input as a list of constraints for the folding. The character “x” marks bases that must be unpaired, matching brackets “ ( ) “ denote base pairs, all other characters are ignored. Any pairs conflicting with the constraint will be forbidden. This is usually sufficient to ensure the constraints are honored. If the parameter calculate_bppm is set to 0 base pairing probabilities will not be computed (saving CPU time), otherwise after calculations took place pr will contain the probability that bases i and j pair.

    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)
    #include <ViennaRNA/part_func.h>

    Compute the partition function \(Q\) of an RNA sequence.

    If structure is not a NULL pointer on input, it contains on return a string consisting of the letters “ . , | { } ( ) “ denoting bases that are essentially unpaired, weakly paired, strongly paired without preference, weakly upstream (downstream) paired, or strongly up- (down-)stream paired bases, respectively. If fold_constrained is not 0, the structure string is interpreted on input as a list of constraints for the folding. The character “x” marks bases that must be unpaired, matching brackets “ ( ) “ denote base pairs, all other characters are ignored. Any pairs conflicting with the constraint will be forbidden. This is usually sufficient to ensure the constraints are honored. If do_backtrack has been set to 0 base pairing probabilities will not be computed (saving CPU time), otherwise pr will contain the probability that bases i and j pair.

    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)
    #include <ViennaRNA/part_func.h>

    Compute the partition function of a circular RNA sequence.

    Deprecated:

      Use vrna_pf() instead!

    See also

    vrna_pf()

    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)
    #include <ViennaRNA/part_func.h>

    Free arrays for the partition function recursions.

    Call this function if you want to free all allocated memory associated with the partition function forward recursion.

    Deprecated:

      See vrna_fold_compound_t and its related functions for how to free memory occupied by the dynamic programming matrices

    See also

    pf_fold_par(), pf_fold(), pf_circ_fold()

    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)
    #include <ViennaRNA/part_func.h>

    Recalculate energy parameters.

    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)
    #include <ViennaRNA/part_func.h>

    Recalculate energy parameters.

    Deprecated:

      Use vrna_exp_params_subst() instead

  FLT_OR_DBL *export_bppm(void)
    #include <ViennaRNA/part_func.h>

    Get a pointer to the base pair probability array.

    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

    pf_fold(), pf_circ_fold(), vrna_idx_row_wise()

    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)
    #include <ViennaRNA/part_func.h>

    Get the pointers to (almost) all relavant computation arrays used in partition function computation.

    See also

    pf_fold_par(), pf_fold(), pf_circ_fold()

    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)
    #include <ViennaRNA/part_func.h>

    Get the free energy of a subsequence from the q[] array.

  double mean_bp_distance(int length)
    #include <ViennaRNA/part_func.h>

    Get the mean base pair distance of the last partition function computation.

    Deprecated:

      Use vrna_mean_bp_distance() or vrna_mean_bp_distance_pr() instead!

    See also

    vrna_mean_bp_distance(), vrna_mean_bp_distance_pr()

    Parameters:

      - length –

    Returns:

      mean base pair distance in thermodynamic ensemble

  double mean_bp_distance_pr(int length, FLT_OR_DBL *pr)
    #include <ViennaRNA/part_func.h>

    Get the mean base pair distance in the thermodynamic ensemble.

    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)
    #include <ViennaRNA/part_func.h>

    Get the probability of stacks.

    Deprecated:

      Use vrna_stack_prob() instead!

  void init_pf_fold(int length)
    #include <ViennaRNA/part_func.h>

    Allocate space for pf_fold()

    Deprecated:

      This function is obsolete and will be removed soon!

  vrna_dimer_pf_t co_pf_fold(char *sequence, char *structure)
    #include <ViennaRNA/part_func_co.h>

    Calculate partition function and base pair probabilities.

    This is the cofold partition function folding. The second molecule starts at the cut_point nucleotide.

    Deprecated:

    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)
    #include <ViennaRNA/part_func_co.h>

    Calculate partition function and base pair probabilities.

    This is the cofold partition function folding. The second molecule starts at the cut_point nucleotide.

    Deprecated:

      Use vrna_pf_dimer() instead!

    See also

    get_boltzmann_factors(), co_pf_fold()

    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)
    #include <ViennaRNA/part_func_co.h>

    Compute Boltzmann probabilities of dimerization without homodimers.

    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.

    Deprecated:
    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

    Deprecated:
  FLT_OR_DBL *export_co_bppm(void)
    #include <ViennaRNA/part_func_co.h>

    Get a pointer to the base pair probability array.

    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

    vrna_idx_row_wise()

    Returns:

      A pointer to the base pair probability array

  void free_co_pf_arrays(void)
    #include <ViennaRNA/part_func_co.h>

    Free the memory occupied by co_pf_fold()

    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)
    #include <ViennaRNA/part_func_co.h>

    Recalculate energy parameters.

    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)
    #include <ViennaRNA/part_func_co.h>

    Recalculate energy parameters.

    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

  void assign_plist_from_db(vrna_ep_t **pl, const char *struc, float pr)
    #include <ViennaRNA/utils/structures.h>

    Create a vrna_ep_t from a dot-bracket string.

    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)
    #include <ViennaRNA/utils/structures.h>

    Create a vrna_ep_t from a probability matrix.

    The probability matrix given is parsed and all pair probabilities above the given threshold are used to create an entry in the plist

    The end of the plist is marked by sequence positions i as well as j equal to 0. This condition should be used to stop looping over its entries

    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