RNAlib-2.4.14
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 #ifdef VRNA_WARN_DEPRECATED
5 # if defined(__clang__)
6 # define DEPRECATED(func, msg) func __attribute__ ((deprecated("", msg)))
7 # elif defined(__GNUC__)
8 # define DEPRECATED(func, msg) func __attribute__ ((deprecated(msg)))
9 # else
10 # define DEPRECATED(func, msg) func
11 # endif
12 #else
13 # define DEPRECATED(func, msg) func
14 #endif
15 
35 #include <ViennaRNA/params/basic.h>
36 
49 typedef struct vrna_sol_TwoD_pf_t {
50  int k;
51  int l;
54 
79  int maxDistance1,
80  int maxDistance2);
81 
82  /* End of group kl_neighborhood_pf */
84 
108 char *
110  int d1,
111  int d2);
112 
113 
133 char *
135  int d1,
136  int d2,
137  unsigned int length);
138 
139  /* End of group kl_neighborhood_stochbt */
143 
144 #ifndef VRNA_DISABLE_BACKWARD_COMPATIBILITY
145 
146 #define TwoDpfold_solution vrna_sol_TwoD_pf_t /* restore compatibility of struct rename */
147 
155 typedef struct {
156  unsigned int alloc;
157  char *ptype;
158  char *sequence;
159  short *S, *S1;
160  unsigned int maxD1;
161  unsigned int maxD2;
163  double temperature; /* temperature in last call to scale_pf_params */
164  double init_temp; /* temperature in last call to scale_pf_params */
165  FLT_OR_DBL *scale;
167  vrna_exp_param_t *pf_params; /* holds all [unscaled] pf parameters */
168 
169  int *my_iindx;
170  int *jindx;
172  short *reference_pt1;
173  short *reference_pt2;
174 
175  unsigned int *referenceBPs1;
176  unsigned int *referenceBPs2;
177  unsigned int *bpdist;
179  unsigned int *mm1;
180  unsigned int *mm2;
182  int circ;
183  int dangles;
184  unsigned int seq_length;
185 
186  FLT_OR_DBL ***Q;
187  FLT_OR_DBL ***Q_B;
188  FLT_OR_DBL ***Q_M;
189  FLT_OR_DBL ***Q_M1;
190  FLT_OR_DBL ***Q_M2;
191 
192  FLT_OR_DBL **Q_c;
193  FLT_OR_DBL **Q_cH;
194  FLT_OR_DBL **Q_cI;
195  FLT_OR_DBL **Q_cM;
196 
197  int **l_min_values;
198  int **l_max_values;
199  int *k_min_values;
200  int *k_max_values;
201 
202  int **l_min_values_b;
203  int **l_max_values_b;
204  int *k_min_values_b;
205  int *k_max_values_b;
206 
207  int **l_min_values_m;
208  int **l_max_values_m;
209  int *k_min_values_m;
210  int *k_max_values_m;
211 
212  int **l_min_values_m1;
213  int **l_max_values_m1;
214  int *k_min_values_m1;
215  int *k_max_values_m1;
216 
217  int **l_min_values_m2;
218  int **l_max_values_m2;
219  int *k_min_values_m2;
220  int *k_max_values_m2;
221 
222  int *l_min_values_qc;
223  int *l_max_values_qc;
224  int k_min_values_qc;
225  int k_max_values_qc;
226 
227  int *l_min_values_qcH;
228  int *l_max_values_qcH;
229  int k_min_values_qcH;
230  int k_max_values_qcH;
231 
232  int *l_min_values_qcI;
233  int *l_max_values_qcI;
234  int k_min_values_qcI;
235  int k_max_values_qcI;
236 
237  int *l_min_values_qcM;
238  int *l_max_values_qcM;
239  int k_min_values_qcM;
240  int k_max_values_qcM;
241 
242  /* auxilary arrays for remaining set of coarse graining (k,l) > (k_max, l_max) */
243  FLT_OR_DBL *Q_rem;
244  FLT_OR_DBL *Q_B_rem;
245  FLT_OR_DBL *Q_M_rem;
246  FLT_OR_DBL *Q_M1_rem;
247  FLT_OR_DBL *Q_M2_rem;
248 
249  FLT_OR_DBL Q_c_rem;
250  FLT_OR_DBL Q_cH_rem;
251  FLT_OR_DBL Q_cI_rem;
252  FLT_OR_DBL Q_cM_rem;
253 
254  vrna_fold_compound_t *compatibility;
256 
275 DEPRECATED(TwoDpfold_vars *
276  get_TwoDpfold_variables(const char *seq,
277  const char *structure1,
278  char *structure2,
279  int circ),
280  "Use the new API and vrna_fold_compound_TwoD() instead");
281 
295 DEPRECATED(void
297  "Use the new API and vrna_fold_compound_free() instead");
298 
323 DEPRECATED(TwoDpfold_solution *
325  int maxDistance1,
326  int maxDistance2),
327  "Use the new API and vrna_pf_TwoD() instead");
328 
350 DEPRECATED(char *
352  int d1,
353  int d2),
354  "Use the new API and vrna_pbacktrack_TwoD() instead");
355 
379 DEPRECATED(char *
381  int d1,
382  int d2,
383  unsigned int length),
384  "Use the new API and vrna_pbacktrack5_TwoD() instead");
385 
391 DEPRECATED(FLT_OR_DBL **TwoDpfold(TwoDpfold_vars *our_variables,
392  int maxDistance1,
393  int maxDistance2),
394  "Use the new API and vrna_pf_TwoD() instead");
395 
401 DEPRECATED(FLT_OR_DBL **TwoDpfold_circ(TwoDpfold_vars *our_variables,
402  int maxDistance1,
403  int maxDistance2),
404  "Use the new API and vrna_pf_TwoD() instead");
405 
406 #endif
407 
408 #endif
double FLT_OR_DBL
Typename for floating point number in partition function computations.
Definition: basic.h:43
The most basic data structure required by many functions throughout the RNAlib.
Definition: fold_compound.h:132
char * ptype
Precomputed array of pair types.
Definition: 2Dpfold.h:157
Solution element returned from vrna_pf_TwoD()
Definition: 2Dpfold.h:49
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:175
unsigned int maxD2
Maximum allowed base pair distance to second reference.
Definition: 2Dpfold.h:161
int * my_iindx
Index for moving in quadratic distancy dimensions.
Definition: 2Dpfold.h:169
FLT_OR_DBL q
partition function
Definition: 2Dpfold.h:52
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: basic.h:103
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:177
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:160
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:51
unsigned int * mm1
Maximum matching matrix, reference struct 1 disallowed.
Definition: 2Dpfold.h:179
Functions to deal with sets of energy parameters.
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:170
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...
The Basic Fold Compound API.
short * S1
The input sequences in numeric form.
Definition: 2Dpfold.h:159
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:158
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:180
unsigned int * referenceBPs2
Matrix containing number of basepairs of reference structure2 in interval [i,j].
Definition: 2Dpfold.h:176
int k
Distance to first reference.
Definition: 2Dpfold.h:50
Variables compound for 2Dfold partition function folding.
Definition: 2Dpfold.h:155