1 #ifndef VIENNA_RNA_PACKAGE_FOLD_H 2 #define VIENNA_RNA_PACKAGE_FOLD_H 3 4 #ifndef VRNA_DISABLE_BACKWARD_COMPATIBILITY 5 6 #include <ViennaRNA/datastructures/basic.h> 7 #include <ViennaRNA/params/basic.h> 8 #include <ViennaRNA/mfe.h> 9 #include <ViennaRNA/eval.h> 10 11 #ifdef VRNA_WARN_DEPRECATED 12 # if defined(__clang__) 13 # define DEPRECATED(func, msg) func __attribute__ ((deprecated("", msg))) 14 # elif defined(__GNUC__) 15 # define DEPRECATED(func, msg) func __attribute__ ((deprecated(msg))) 16 # else 17 # define DEPRECATED(func, msg) func 18 # endif 19 #else 20 # define DEPRECATED(func, msg) func 21 #endif 22 23 /** 24 * @file fold.h 25 * @ingroup mfe_global_deprecated 26 * @brief MFE calculations for single RNA sequences 27 */ 28 29 /** 30 * @addtogroup mfe_global_deprecated 31 * @{ 32 */ 33 34 /** 35 * @brief Compute minimum free energy and an appropriate secondary 36 * structure of an RNA sequence 37 * 38 * The first parameter given, the RNA sequence, must be @a uppercase and should only contain 39 * an alphabet @f$\Sigma@f$ that is understood by the RNAlib\n 40 * (e.g. @f$ \Sigma = \{A,U,C,G\} @f$)\n 41 * 42 * The second parameter, @a structure, must always point to an allocated 43 * block of memory with a size of at least @f$\mathrm{strlen}(\mathrm{sequence})+1@f$ 44 * 45 * If the third parameter is NULL, global model detail settings are assumed for the folding 46 * recursions. Otherwise, the provided parameters are used. 47 * 48 * The fourth parameter indicates whether a secondary structure constraint in enhanced dot-bracket 49 * notation is passed through the structure parameter or not. If so, the characters " | x < > " are 50 * recognized to mark bases that are paired, unpaired, paired upstream, or downstream, respectively. 51 * Matching brackets " ( ) " denote base pairs, dots "." are used for unconstrained bases. 52 * 53 * To indicate that the RNA sequence is circular and thus has to be post-processed, set the last 54 * parameter to non-zero 55 * 56 * After a successful call of fold_par(), a backtracked secondary structure (in dot-bracket notation) 57 * that exhibits the minimum of free energy will be written to the memory @a structure is pointing to. 58 * The function returns the minimum of free energy for any fold of the sequence given. 59 * 60 * @note OpenMP: Passing NULL to the 'parameters' argument involves access to several global model 61 * detail variables and thus is not to be considered threadsafe 62 * 63 * @deprecated use vrna_mfe() instead! 64 * 65 * @see vrna_mfe(), fold(), circfold(), #vrna_md_t, set_energy_model(), get_scaled_parameters() 66 * 67 * @param sequence RNA sequence 68 * @param structure A pointer to the character array where the 69 * secondary structure in dot-bracket notation will be written to 70 * @param parameters A data structure containing the pre-scaled energy contributions 71 * and the model details. (NULL may be passed, see OpenMP notes above) 72 * @param is_constrained Switch to indicate that a structure constraint is passed via the structure argument (0==off) 73 * @param is_circular Switch to (de-)activate post-processing steps in case RNA sequence is circular (0==off) 74 * 75 * @return the minimum free energy (MFE) in kcal/mol 76 */ 77 DEPRECATED(float 78 fold_par( const char *sequence, 79 char *structure, 80 vrna_param_t *parameters, 81 int is_constrained, 82 int is_circular), 83 "Use the new API and vrna_mfe() instead"); 84 85 /** 86 * @brief Compute minimum free energy and an appropriate secondary structure of an RNA sequence 87 * 88 * This function essentially does the same thing as fold_par(). However, it takes its model details, 89 * i.e. #temperature, #dangles, #tetra_loop, #noGU, #no_closingGU, #fold_constrained, #noLonelyPairs 90 * from the current global settings within the library 91 * 92 * @deprecated use vrna_fold(), or vrna_mfe() instead! 93 * 94 * @see fold_par(), circfold() 95 * 96 * @param sequence RNA sequence 97 * @param structure A pointer to the character array where the 98 * secondary structure in dot-bracket notation will be written to 99 * @return the minimum free energy (MFE) in kcal/mol 100 */ 101 DEPRECATED(float fold( const char *sequence, char *structure), 102 "Use vrna_fold() or vrna_mfe() instead"); 103 104 /** 105 * @brief Compute minimum free energy and an appropriate secondary structure of a circular RNA sequence 106 * 107 * This function essentially does the same thing as fold_par(). However, it takes its model details, 108 * i.e. #temperature, #dangles, #tetra_loop, #noGU, #no_closingGU, #fold_constrained, #noLonelyPairs 109 * from the current global settings within the library 110 * 111 * @deprecated Use vrna_circfold(), or vrna_mfe() instead! 112 * 113 * @see fold_par(), circfold() 114 * 115 * @param sequence RNA sequence 116 * @param structure A pointer to the character array where the 117 * secondary structure in dot-bracket notation will be written to 118 * @return the minimum free energy (MFE) in kcal/mol 119 */ 120 DEPRECATED(float circfold( const char *sequence, char *structure), 121 "Use vrna_circfold() or vrna_mfe() instead"); 122 123 124 /** 125 * @brief Free arrays for mfe folding 126 * 127 * @deprecated See vrna_fold(), vrna_circfold(), or vrna_mfe() and #vrna_fold_compound_t for the usage of the new API! 128 * 129 */ 130 DEPRECATED(void free_arrays(void), 131 "This function is obsolete"); 132 133 134 135 /** 136 * @brief Recalculate energy parameters 137 * 138 * @deprecated For non-default model settings use the new API with vrna_params_subst() and vrna_mfe() instead! 139 * 140 */ 141 DEPRECATED(void update_fold_params(void), 142 "This function is obsolete"); 143 144 /** 145 * @brief Recalculate energy parameters 146 * 147 * @deprecated For non-default model settings use the new API with vrna_params_subst() and vrna_mfe() instead! 148 * 149 */ 150 DEPRECATED(void update_fold_params_par(vrna_param_t *parameters), 151 "Use the new API with vrna_fold_compound_t datastructure instead"); 152 153 /** 154 * 155 * @deprecated See vrna_mfe() and #vrna_fold_compound_t for the usage of the new API! 156 * 157 */ 158 DEPRECATED(void 159 export_fold_arrays( int **f5_p, 160 int **c_p, 161 int **fML_p, 162 int **fM1_p, 163 int **indx_p, 164 char **ptype_p), 165 "Use the new API with vrna_fold_compound_t datastructure instead"); 166 167 /** 168 * 169 * @deprecated See vrna_mfe() and #vrna_fold_compound_t for the usage of the new API! 170 * 171 */ 172 DEPRECATED(void 173 export_fold_arrays_par( int **f5_p, 174 int **c_p, 175 int **fML_p, 176 int **fM1_p, 177 int **indx_p, 178 char **ptype_p, 179 vrna_param_t **P_p), 180 "Use the new API with vrna_fold_compound_t datastructure instead"); 181 182 /** 183 * 184 * @deprecated See vrna_mfe() and #vrna_fold_compound_t for the usage of the new API! 185 * 186 */ 187 DEPRECATED(void 188 export_circfold_arrays( int *Fc_p, 189 int *FcH_p, 190 int *FcI_p, 191 int *FcM_p, 192 int **fM2_p, 193 int **f5_p, 194 int **c_p, 195 int **fML_p, 196 int **fM1_p, 197 int **indx_p, 198 char **ptype_p), 199 "Use the new API with vrna_fold_compound_t datastructure instead"); 200 201 /** 202 * 203 * @deprecated See vrna_mfe() and #vrna_fold_compound_t for the usage of the new API! 204 * 205 */ 206 DEPRECATED(void 207 export_circfold_arrays_par( int *Fc_p, 208 int *FcH_p, 209 int *FcI_p, 210 int *FcM_p, 211 int **fM2_p, 212 int **f5_p, 213 int **c_p, 214 int **fML_p, 215 int **fM1_p, 216 int **indx_p, 217 char **ptype_p, 218 vrna_param_t **P_p), 219 "Use the new API with vrna_fold_compound_t datastructure instead"); 220 221 222 223 /* finally moved the loop energy function declarations to this header... */ 224 /* BUT: The functions only exist for backward compatibility reasons! */ 225 /* You better include "loop_energies.h" and call the functions: */ 226 /* E_Hairpin() and E_IntLoop() which are (almost) threadsafe as they get */ 227 /* a pointer to the energy parameter data structure as additional argument */ 228 229 /** 230 * @deprecated {This function is deprecated and will be removed soon. 231 * Use @ref E_IntLoop() instead!} 232 */ 233 DEPRECATED(int LoopEnergy(int n1, 234 int n2, 235 int type, 236 int type_2, 237 int si1, 238 int sj1, 239 int sp1, 240 int sq1), 241 "This function is obsolete"); 242 243 /** 244 * @deprecated {This function is deprecated and will be removed soon. 245 * Use @ref E_Hairpin() instead!} 246 */ 247 DEPRECATED(int HairpinE(int size, 248 int type, 249 int si1, 250 int sj1, 251 const char *string), 252 "Use E_Hairpin() instead"); 253 254 /** 255 * Allocate arrays for folding\n 256 * @deprecated See vrna_mfe() and #vrna_fold_compound_t for the usage of the new API! 257 * 258 */ 259 DEPRECATED(void initialize_fold(int length), 260 "This function is obsolete"); 261 262 /** 263 * 264 */ 265 DEPRECATED(char *backtrack_fold_from_pair(char *sequence, 266 int i, 267 int j), 268 "This function is obsolete. Consider using vrna_backtrack_from_intervals() instead"); 269 270 271 #endif 272 273 /** 274 * @} 275 */ 276 277 #endif 278