1 #ifndef __VIENNA_RNA_PACKAGE_COFOLD_H__
2 #define __VIENNA_RNA_PACKAGE_COFOLD_H__
4 #include "data_structures.h"
7 #define DEPRECATED(func) func __attribute__ ((deprecated))
9 #define DEPRECATED(func) func
14 * \brief Predict structures formed by two molecules upon hybridization.
16 * The function of an RNA molecule often depends on its interaction with
17 * other RNAs. The following routines therefore allow to predict structures
18 * formed by two RNA molecules upon hybridization.\n
19 * One approach to co-folding two RNAs consists of concatenating the two
20 * sequences and keeping track of the concatenation point in all energy
21 * evaluations. Correspondingly, many of the cofold() and
22 * co_pf_fold() routines below take one sequence string as argument
23 * and use the the global variable #cut_point to mark the concatenation
24 * point. Note that while the <i>RNAcofold</i> program uses the '&' character
25 * to mark the chain break in its input, you should not use an '&' when using
26 * the library routines (set #cut_point instead).\n
27 * In a second approach to co-folding two RNAs, cofolding is seen as a
28 * stepwise process. In the first step the probability of an unpaired region
29 * is calculated and in a second step this probability of an unpaired region
30 * is multiplied with the probability of an interaction between the two RNAs.
31 * This approach is implemented for the interaction between a long
32 * target sequence and a short ligand RNA. Function pf_unstru() calculates
33 * the partition function over all unpaired regions in the input
34 * sequence. Function pf_interact(), which calculates the
35 * partition function over all possible interactions between two
36 * sequences, needs both sequence as separate strings as input.
41 * \addtogroup mfe_cofold
45 * \brief MFE version of cofolding routines
47 * This file includes (almost) all function declarations within the <b>RNAlib</b> that are related to
49 * This also includes the Zuker suboptimals calculations, since they are implemented using the cofold
54 * \brief Compute the minimum free energy of two interacting RNA molecules
56 * The code is analog to the fold() function. If #cut_point ==-1 results
57 * should be the same as with fold().
61 * \param sequence The two sequences concatenated
62 * \param structure Will hold the barcket dot structure of the dimer molecule
63 * \return minimum free energy of the structure
65 float cofold( const char *sequence,
69 * \brief Compute the minimum free energy of two interacting RNA molecules
72 float cofold_par( const char *string,
78 * \brief Free memory occupied by cofold()
80 void free_co_arrays(void);
83 * \brief Recalculate parameters
85 void update_cofold_params(void);
87 void update_cofold_params_par(paramT *parameters);
91 * \brief Export the arrays of partition function cofold (with gquadruplex support)
93 * Export the cofold arrays for use e.g. in the concentration
94 * Computations or suboptimal secondary structure backtracking
96 * \param f5_p A pointer to the 'f5' array, i.e. array conatining best free energy in interval [1,j]
97 * \param c_p A pointer to the 'c' array, i.e. array containing best free energy in interval [i,j] given that i pairs with j
98 * \param fML_p A pointer to the 'M' array, i.e. array containing best free energy in interval [i,j] for any multiloop segment with at least one stem
99 * \param fM1_p A pointer to the 'M1' array, i.e. array containing best free energy in interval [i,j] for multiloop segment with exactly one stem
100 * \param fc_p A pointer to the 'fc' array, i.e. array ...
101 * \param ggg_p A pointer to the 'ggg' array, i.e. array containing best free energy of a gquadruplex delimited by [i,j]
102 * \param indx_p A pointer to the indexing array used for accessing the energy matrices
103 * \param ptype_p A pointer to the ptype array containing the base pair types for each possibility (i,j)
105 void export_cofold_arrays_gq( int **f5_p,
115 * \brief Export the arrays of partition function cofold
117 * Export the cofold arrays for use e.g. in the concentration
118 * Computations or suboptimal secondary structure backtracking
120 * \param f5_p A pointer to the 'f5' array, i.e. array conatining best free energy in interval [1,j]
121 * \param c_p A pointer to the 'c' array, i.e. array containing best free energy in interval [i,j] given that i pairs with j
122 * \param fML_p A pointer to the 'M' array, i.e. array containing best free energy in interval [i,j] for any multiloop segment with at least one stem
123 * \param fM1_p A pointer to the 'M1' array, i.e. array containing best free energy in interval [i,j] for multiloop segment with exactly one stem
124 * \param fc_p A pointer to the 'fc' array, i.e. array ...
125 * \param indx_p A pointer to the indexing array used for accessing the energy matrices
126 * \param ptype_p A pointer to the ptype array containing the base pair types for each possibility (i,j)
128 void export_cofold_arrays(int **f5_p,
142 * \brief Compute Zuker type suboptimal structures
144 * Compute Suboptimal structures according to M. Zuker, i.e. for every
145 * possible base pair the minimum energy structure containing the resp. base pair.
146 * Returns a list of these structures and their energies.
148 * \ingroup subopt_zuker
150 * \param string RNA sequence
151 * \return List of zuker suboptimal structures
153 SOLUTION *zukersubopt(const char *string);
156 * \brief Compute Zuker type suboptimal structures
158 * \ingroup subopt_zuker
161 SOLUTION *zukersubopt_par( const char *string,
165 * \brief get_monomer_free_energies
167 * Export monomer free energies out of cofold arrays
169 * \param e1 A pointer to a variable where the energy of molecule A will be written to
170 * \param e2 A pointer to a variable where the energy of molecule B will be written to
172 void get_monomere_mfes( float *e1,
177 * allocate arrays for folding
178 * \deprecated{This function is obsolete and will be removed soon!}
180 DEPRECATED(void initialize_cofold(int length));