RNAlib-2.4.3
2Dpfold.h
Go to the documentation of this file.
1 #ifndef VIENNA_RNA_PACKAGE_TWO_D_PF_FOLD_H
2 #define VIENNA_RNA_PACKAGE_TWO_D_PF_FOLD_H
3 
4 /* make this interface backward compatible with RNAlib < 2.2.0 */
5 #define VRNA_BACKWARD_COMPAT
6 
7 #ifdef VRNA_WARN_DEPRECATED
8 # ifdef __GNUC__
9 # define DEPRECATED(func) func __attribute__ ((deprecated))
10 # else
11 # define DEPRECATED(func) func
12 # endif
13 #else
14 # define DEPRECATED(func) func
15 #endif
16 
34 
47 typedef struct vrna_sol_TwoD_pf_t {
48  int k;
49  int l;
52 
77  int maxDistance1,
78  int maxDistance2);
79 
80  /* End of group kl_neighborhood_pf */
82 
106 char *
108  int d1,
109  int d2);
110 
111 
131 char *
133  int d1,
134  int d2,
135  unsigned int length);
136 
137  /* End of group kl_neighborhood_stochbt */
141 
142 
143 #ifdef VRNA_BACKWARD_COMPAT
144 
145 #define TwoDpfold_solution vrna_sol_TwoD_pf_t /* restore compatibility of struct rename */
146 
154 typedef struct {
155  unsigned int alloc;
156  char *ptype;
157  char *sequence;
158  short *S, *S1;
159  unsigned int maxD1;
160  unsigned int maxD2;
162  double temperature; /* temperature in last call to scale_pf_params */
163  double init_temp; /* temperature in last call to scale_pf_params */
164  FLT_OR_DBL *scale;
166  vrna_exp_param_t *pf_params; /* holds all [unscaled] pf parameters */
167 
168  int *my_iindx;
169  int *jindx;
171  short *reference_pt1;
172  short *reference_pt2;
173 
174  unsigned int *referenceBPs1;
175  unsigned int *referenceBPs2;
176  unsigned int *bpdist;
178  unsigned int *mm1;
179  unsigned int *mm2;
181  int circ;
182  int dangles;
183  unsigned int seq_length;
184 
185  FLT_OR_DBL ***Q;
186  FLT_OR_DBL ***Q_B;
187  FLT_OR_DBL ***Q_M;
188  FLT_OR_DBL ***Q_M1;
189  FLT_OR_DBL ***Q_M2;
190 
191  FLT_OR_DBL **Q_c;
192  FLT_OR_DBL **Q_cH;
193  FLT_OR_DBL **Q_cI;
194  FLT_OR_DBL **Q_cM;
195 
196  int **l_min_values;
197  int **l_max_values;
198  int *k_min_values;
199  int *k_max_values;
200 
201  int **l_min_values_b;
202  int **l_max_values_b;
203  int *k_min_values_b;
204  int *k_max_values_b;
205 
206  int **l_min_values_m;
207  int **l_max_values_m;
208  int *k_min_values_m;
209  int *k_max_values_m;
210 
211  int **l_min_values_m1;
212  int **l_max_values_m1;
213  int *k_min_values_m1;
214  int *k_max_values_m1;
215 
216  int **l_min_values_m2;
217  int **l_max_values_m2;
218  int *k_min_values_m2;
219  int *k_max_values_m2;
220 
221  int *l_min_values_qc;
222  int *l_max_values_qc;
223  int k_min_values_qc;
224  int k_max_values_qc;
225 
226  int *l_min_values_qcH;
227  int *l_max_values_qcH;
228  int k_min_values_qcH;
229  int k_max_values_qcH;
230 
231  int *l_min_values_qcI;
232  int *l_max_values_qcI;
233  int k_min_values_qcI;
234  int k_max_values_qcI;
235 
236  int *l_min_values_qcM;
237  int *l_max_values_qcM;
238  int k_min_values_qcM;
239  int k_max_values_qcM;
240 
241  /* auxilary arrays for remaining set of coarse graining (k,l) > (k_max, l_max) */
242  FLT_OR_DBL *Q_rem;
243  FLT_OR_DBL *Q_B_rem;
244  FLT_OR_DBL *Q_M_rem;
245  FLT_OR_DBL *Q_M1_rem;
246  FLT_OR_DBL *Q_M2_rem;
247 
248  FLT_OR_DBL Q_c_rem;
249  FLT_OR_DBL Q_cH_rem;
250  FLT_OR_DBL Q_cI_rem;
251  FLT_OR_DBL Q_cM_rem;
252 
253  vrna_fold_compound_t *compatibility;
255 
274 DEPRECATED(TwoDpfold_vars *
275  get_TwoDpfold_variables(const char *seq,
276  const char *structure1,
277  char *structure2,
278  int circ));
279 
293 DEPRECATED(void
295 
320 DEPRECATED(TwoDpfold_solution *
322  int maxDistance1,
323  int maxDistance2));
324 
346 DEPRECATED(char *
348  int d1,
349  int d2));
350 
374 DEPRECATED(char *
376  int d1,
377  int d2,
378  unsigned int length));
379 
385 DEPRECATED(FLT_OR_DBL **TwoDpfold(TwoDpfold_vars *our_variables,
386  int maxDistance1,
387  int maxDistance2));
388 
394 DEPRECATED(FLT_OR_DBL **TwoDpfold_circ(TwoDpfold_vars *our_variables,
395  int maxDistance1,
396  int maxDistance2));
397 
398 #endif
399 
400 #endif
double FLT_OR_DBL
Typename for floating point number in partition function computations.
Definition: data_structures.h:43
The most basic data structure required by many functions throughout the RNAlib.
Definition: fold_compound.h:130
char * ptype
Precomputed array of pair types.
Definition: 2Dpfold.h:156
Solution element returned from vrna_pf_TwoD()
Definition: 2Dpfold.h:47
double temperature
Rescale energy parameters to a temperature in degC.
unsigned int * referenceBPs1
Matrix containing number of basepairs of reference structure1 in interval [i,j].
Definition: 2Dpfold.h:174
unsigned int maxD2
Maximum allowed base pair distance to second reference.
Definition: 2Dpfold.h:160
int * my_iindx
Index for moving in quadratic distancy dimensions.
Definition: 2Dpfold.h:168
FLT_OR_DBL q
partition function
Definition: 2Dpfold.h:50
TwoDpfold_vars * get_TwoDpfold_variables(const char *seq, const char *structure1, char *structure2, int circ)
Get a datastructure containing all necessary attributes and global folding switches.
Various data structures and pre-processor macros.
char * TwoDpfold_pbacktrack5(TwoDpfold_vars *vars, int d1, int d2, unsigned int length)
Sample secondary structure representatives with a specified length from a set of distance classes acc...
The data structure that contains temperature scaled Boltzmann weights of the energy parameters...
Definition: params.h:102
double pf_scale
A scaling factor used by pf_fold() to avoid overflows.
unsigned int * bpdist
Matrix containing base pair distance of reference structure 1 and 2 on interval [i,j].
Definition: 2Dpfold.h:176
void destroy_TwoDpfold_variables(TwoDpfold_vars *vars)
Free all memory occupied by a TwoDpfold_vars datastructure.
unsigned int maxD1
Maximum allowed base pair distance to first reference.
Definition: 2Dpfold.h:159
char * TwoDpfold_pbacktrack(TwoDpfold_vars *vars, int d1, int d2)
Sample secondary structure representatives from a set of distance classes according to their Boltzman...
struct vrna_sol_TwoD_pf_t vrna_sol_TwoD_pf_t
Solution element returned from vrna_pf_TwoD()
int l
Distance to second reference.
Definition: 2Dpfold.h:49
unsigned int * mm1
Maximum matching matrix, reference struct 1 disallowed.
Definition: 2Dpfold.h:178
char * vrna_pbacktrack5_TwoD(vrna_fold_compound_t *vc, int d1, int d2, unsigned int length)
Sample secondary structure representatives with a specified length from a set of distance classes acc...
vrna_sol_TwoD_pf_t * TwoDpfoldList(TwoDpfold_vars *vars, int maxDistance1, int maxDistance2)
Compute the partition function for all distance classes.
int * jindx
Index for moving in the triangular matrix qm1.
Definition: 2Dpfold.h:169
char * vrna_pbacktrack_TwoD(vrna_fold_compound_t *vc, int d1, int d2)
Sample secondary structure representatives from a set of distance classes according to their Boltzman...
int circ
backward compatibility variable.. this does not effect anything
int dangles
Switch the energy model for dangling end contributions (0, 1, 2, 3)
char * sequence
The input sequence.
Definition: 2Dpfold.h:157
vrna_sol_TwoD_pf_t * vrna_pf_TwoD(vrna_fold_compound_t *vc, int maxDistance1, int maxDistance2)
Compute the partition function for all distance classes.
unsigned int * mm2
Maximum matching matrix, reference struct 2 disallowed.
Definition: 2Dpfold.h:179
unsigned int * referenceBPs2
Matrix containing number of basepairs of reference structure2 in interval [i,j].
Definition: 2Dpfold.h:175
int k
Distance to first reference.
Definition: 2Dpfold.h:48
Variables compound for 2Dfold partition function folding.
Definition: 2Dpfold.h:154