RNAlib-2.2.0-RC2
2Dpfold.h
Go to the documentation of this file.
1 /*
2  minimum free energy
3  RNA secondary structure with
4  basepair distance d to reference structure prediction
5 
6 */
7 #ifndef VIENNA_RNA_PACKAGE_TWO_D_PF_FOLD_H
8 #define VIENNA_RNA_PACKAGE_TWO_D_PF_FOLD_H
9 
10 /* make this interface backward compatible with RNAlib < 2.2.0 */
11 #define VRNA_BACKWARD_COMPAT
12 
13 #ifdef __GNUC__
14 #define DEPRECATED(func) func __attribute__ ((deprecated))
15 #else
16 #define DEPRECATED(func) func
17 #endif
18 
30 
43 typedef struct vrna_sol_TwoD_pf_t{
44  int k;
45  int l;
46  FLT_OR_DBL q;
48 
73  int maxDistance1,
74  int maxDistance2);
75  /* End of group kl_neighborhood_pf */
77 
101 char *
103  int d1,
104  int d2);
105 
125 char *
127  int d1,
128  int d2,
129  unsigned int length);
130  /* End of group kl_neighborhood_stochbt */
134 
135 
136 #ifdef VRNA_BACKWARD_COMPAT
137 
138 #define TwoDpfold_solution vrna_sol_TwoD_pf_t /* restore compatibility of struct rename */
139 
147 typedef struct{
148 
149  unsigned int alloc;
150  char *ptype;
151  char *sequence;
152  short *S, *S1;
153  unsigned int maxD1;
154  unsigned int maxD2;
156  double temperature; /* temperature in last call to scale_pf_params */
157  double init_temp; /* temperature in last call to scale_pf_params */
158  FLT_OR_DBL *scale;
159  FLT_OR_DBL pf_scale;
160  struct vrna_exp_param_t *pf_params; /* holds all [unscaled] pf parameters */
161 
162  int *my_iindx;
163  int *jindx;
165  short *reference_pt1;
166  short *reference_pt2;
167 
168  unsigned int *referenceBPs1;
169  unsigned int *referenceBPs2;
170  unsigned int *bpdist;
172  unsigned int *mm1;
173  unsigned int *mm2;
175  int circ;
176  int dangles;
177  unsigned int seq_length;
178 
179  FLT_OR_DBL ***Q;
180  FLT_OR_DBL ***Q_B;
181  FLT_OR_DBL ***Q_M;
182  FLT_OR_DBL ***Q_M1;
183  FLT_OR_DBL ***Q_M2;
184 
185  FLT_OR_DBL **Q_c;
186  FLT_OR_DBL **Q_cH;
187  FLT_OR_DBL **Q_cI;
188  FLT_OR_DBL **Q_cM;
189 
190  int **l_min_values;
191  int **l_max_values;
192  int *k_min_values;
193  int *k_max_values;
194 
195  int **l_min_values_b;
196  int **l_max_values_b;
197  int *k_min_values_b;
198  int *k_max_values_b;
199 
200  int **l_min_values_m;
201  int **l_max_values_m;
202  int *k_min_values_m;
203  int *k_max_values_m;
204 
205  int **l_min_values_m1;
206  int **l_max_values_m1;
207  int *k_min_values_m1;
208  int *k_max_values_m1;
209 
210  int **l_min_values_m2;
211  int **l_max_values_m2;
212  int *k_min_values_m2;
213  int *k_max_values_m2;
214 
215  int *l_min_values_qc;
216  int *l_max_values_qc;
217  int k_min_values_qc;
218  int k_max_values_qc;
219 
220  int *l_min_values_qcH;
221  int *l_max_values_qcH;
222  int k_min_values_qcH;
223  int k_max_values_qcH;
224 
225  int *l_min_values_qcI;
226  int *l_max_values_qcI;
227  int k_min_values_qcI;
228  int k_max_values_qcI;
229 
230  int *l_min_values_qcM;
231  int *l_max_values_qcM;
232  int k_min_values_qcM;
233  int k_max_values_qcM;
234 
235  /* auxilary arrays for remaining set of coarse graining (k,l) > (k_max, l_max) */
236  FLT_OR_DBL *Q_rem;
237  FLT_OR_DBL *Q_B_rem;
238  FLT_OR_DBL *Q_M_rem;
239  FLT_OR_DBL *Q_M1_rem;
240  FLT_OR_DBL *Q_M2_rem;
241 
242  FLT_OR_DBL Q_c_rem;
243  FLT_OR_DBL Q_cH_rem;
244  FLT_OR_DBL Q_cI_rem;
245  FLT_OR_DBL Q_cM_rem;
246 
247  vrna_fold_compound *compatibility;
249 
268 DEPRECATED(TwoDpfold_vars *
269 get_TwoDpfold_variables(const char *seq,
270  const char *structure1,
271  char *structure2,
272  int circ));
273 
287 DEPRECATED(void
289 
314 DEPRECATED(TwoDpfold_solution *
316  int maxDistance1,
317  int maxDistance2));
318 
340 DEPRECATED(char *
342  int d1,
343  int d2));
344 
368 DEPRECATED(char *
370  int d1,
371  int d2,
372  unsigned int length));
373 
379 DEPRECATED(FLT_OR_DBL **TwoDpfold(TwoDpfold_vars *our_variables,
380  int maxDistance1,
381  int maxDistance2));
382 
388 DEPRECATED(FLT_OR_DBL **TwoDpfold_circ(
389  TwoDpfold_vars *our_variables,
390  int maxDistance1,
391  int maxDistance2));
392 
393 #endif
394 
395 #endif
vrna_sol_TwoD_pf_t * vrna_TwoD_pf_fold(vrna_fold_compound *vc, int maxDistance1, int maxDistance2)
Compute the partition function for all distance classes.
char * vrna_TwoD_pbacktrack5(vrna_fold_compound *vc, int d1, int d2, unsigned int length)
Sample secondary structure representatives with a specified length from a set of distance classes acc...
int circ
backward compatibility variable.. this does not effect anything
char * ptype
Precomputed array of pair types.
Definition: 2Dpfold.h:150
int dangles
Switch the energy model for dangling end contributions (0, 1, 2, 3)
unsigned int * referenceBPs1
Matrix containing number of basepairs of reference structure1 in interval [i,j].
Definition: 2Dpfold.h:168
unsigned int maxD2
Maximum allowed base pair distance to second reference.
Definition: 2Dpfold.h:154
int * my_iindx
Index for moving in quadratic distancy dimensions.
Definition: 2Dpfold.h:162
The most basic data structure required by many functions throughout the RNAlib.
Definition: data_structures.h:689
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.
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...
unsigned int * bpdist
Matrix containing base pair distance of reference structure 1 and 2 on interval [i,j].
Definition: 2Dpfold.h:170
void destroy_TwoDpfold_variables(TwoDpfold_vars *vars)
Free all memory occupied by a TwoDpfold_vars datastructure.
Solution element returned from vrna_TwoD_pf_fold()
Definition: 2Dpfold.h:43
int k
Distance to first reference.
Definition: 2Dpfold.h:44
unsigned int maxD1
Maximum allowed base pair distance to first reference.
Definition: 2Dpfold.h:153
char * TwoDpfold_pbacktrack(TwoDpfold_vars *vars, int d1, int d2)
Sample secondary structure representatives from a set of distance classes according to their Boltzman...
char * vrna_TwoD_pbacktrack(vrna_fold_compound *vc, int d1, int d2)
Sample secondary structure representatives from a set of distance classes according to their Boltzman...
unsigned int * mm1
Maximum matching matrix, reference struct 1 disallowed.
Definition: 2Dpfold.h:172
double temperature
Rescale energy parameters to a temperature in degC.
double pf_scale
A scaling factor used by pf_fold() to avoid overflows.
vrna_sol_TwoD_pf_t * TwoDpfoldList(TwoDpfold_vars *vars, int maxDistance1, int maxDistance2)
Compute the partition function for all distance classes.
int l
Distance to second reference.
Definition: 2Dpfold.h:45
int * jindx
Index for moving in the triangular matrix qm1.
Definition: 2Dpfold.h:163
short * S1
The input sequences in numeric form.
Definition: 2Dpfold.h:152
The datastructure that contains temperature scaled Boltzmann weights of the energy parameters...
Definition: params.h:86
char * sequence
The input sequence.
Definition: 2Dpfold.h:151
unsigned int * mm2
Maximum matching matrix, reference struct 2 disallowed.
Definition: 2Dpfold.h:173
unsigned int * referenceBPs2
Matrix containing number of basepairs of reference structure2 in interval [i,j].
Definition: 2Dpfold.h:169
FLT_OR_DBL q
partition function
Definition: 2Dpfold.h:46
Variables compound for 2Dfold partition function folding.
Definition: 2Dpfold.h:147