RNAlib-2.2.7
part_func.h
Go to the documentation of this file.
1 #ifndef VIENNA_RNA_PACKAGE_PART_FUNC_H
2 #define VIENNA_RNA_PACKAGE_PART_FUNC_H
3 
4 /* make this interface backward compatible with RNAlib < 2.2.0 */
5 #define VRNA_BACKWARD_COMPAT
6 
8 #include <ViennaRNA/params.h>
9 #include <ViennaRNA/centroid.h>
11 
12 #ifdef DEPRECATION_WARNINGS
13 # ifdef __GNUC__
14 # define DEPRECATED(func) func __attribute__ ((deprecated))
15 # else
16 # define DEPRECATED(func) func
17 # endif
18 #else
19 # define DEPRECATED(func) func
20 #endif
21 
40 /*
41 #################################################
42 # PARTITION FUNCTION COMPUTATION #
43 #################################################
44 */
45 
72 float vrna_pf(vrna_fold_compound_t *vc, char *structure);
73 
97 float vrna_pf_fold(const char *seq, char *structure, vrna_plist_t **pl);
98 
125 float vrna_pf_circfold(const char *seq, char *structure, vrna_plist_t **pl);
126 
127 /*
128 #################################################
129 # OTHER PARTITION FUNCTION RELATED DECLARATIONS #
130 #################################################
131 */
132 
140 int vrna_pf_float_precision(void);
141 
155 double vrna_mean_bp_distance_pr(int length, FLT_OR_DBL *pr);
156 
170 
184 
185 #ifdef VRNA_BACKWARD_COMPAT
186 
187 /*
188 #################################################
189 # DEPRECATED FUNCTIONS #
190 #################################################
191 */
192 
205 extern int st_back;
206 
247 DEPRECATED(float pf_fold_par( const char *sequence,
248  char *structure,
249  vrna_exp_param_t *parameters,
250  int calculate_bppm,
251  int is_constrained,
252  int is_circular));
253 
293 DEPRECATED(float pf_fold(const char *sequence,
294  char *structure));
295 
322 DEPRECATED(float pf_circ_fold( const char *sequence,
323  char *structure));
324 
335 DEPRECATED(char *pbacktrack(char *sequence));
336 
337 DEPRECATED(char *pbacktrack5(char *sequence, int length));
338 
354 DEPRECATED(char *pbacktrack_circ(char *sequence));
355 
374 DEPRECATED(void free_pf_arrays(void));
375 
386 DEPRECATED(void update_pf_params(int length));
387 
395 DEPRECATED(void update_pf_params_par(int length, vrna_exp_param_t *parameters));
396 
413 DEPRECATED(FLT_OR_DBL *export_bppm(void));
414 
415 
431 DEPRECATED(int get_pf_arrays(short **S_p,
432  short **S1_p,
433  char **ptype_p,
434  FLT_OR_DBL **qb_p,
435  FLT_OR_DBL **qm_p,
436  FLT_OR_DBL **q1k_p,
437  FLT_OR_DBL **qln_p));
438 
442 DEPRECATED(double get_subseq_F(int i, int j));
443 
444 
456 DEPRECATED(double mean_bp_distance(int length));
457 
475 DEPRECATED(double mean_bp_distance_pr(int length, FLT_OR_DBL *pr));
476 
482 DEPRECATED(vrna_plist_t *stackProb(double cutoff));
483 
484 
490 DEPRECATED(void init_pf_fold(int length));
491 
496 DEPRECATED(char *centroid(int length, double *dist));
497 
502 DEPRECATED(char *get_centroid_struct_gquad_pr(int length,
503  double *dist));
504 
510 DEPRECATED(double mean_bp_dist(int length));
511 
515 DEPRECATED(double expLoopEnergy(int u1,
516  int u2,
517  int type,
518  int type2,
519  short si1,
520  short sj1,
521  short sp1,
522  short sq1));
523 
527 DEPRECATED(double expHairpinEnergy( int u,
528  int type,
529  short si1,
530  short sj1,
531  const char *string));
532 
533 /* this doesn't work if free_pf_arrays() is called before */
534 DEPRECATED(void assign_plist_gquad_from_pr(vrna_plist_t **pl,
535  int length,
536  double cut_off));
537 
538 #endif
539 
540 #endif
float pf_circ_fold(const char *sequence, char *structure)
Compute the partition function of a circular RNA sequence.
float vrna_pf_fold(const char *seq, char *structure, vrna_plist_t **pl)
Compute Partition function (and base pair probabilities) for an RNA sequence using a comparative met...
char * get_centroid_struct_gquad_pr(int length, double *dist)
float vrna_pf_circfold(const char *seq, char *structure, vrna_plist_t **pl)
Compute Partition function (and base pair probabilities) for a circular RNA sequences using a compar...
double vrna_mean_bp_distance(vrna_fold_compound_t *vc)
Get the mean base pair distance in the thermodynamic ensemble.
double FLT_OR_DBL
Typename for floating point number in partition function computations.
Definition: data_structures.h:39
The most basic data structure required by many functions throughout the RNAlib.
Definition: data_structures.h:390
double expHairpinEnergy(int u, int type, short si1, short sj1, const char *string)
vrna_plist_t * vrna_stack_prob(vrna_fold_compound_t *vc, double cutoff)
Compute stacking probabilities.
double get_subseq_F(int i, int j)
Get the free energy of a subsequence from the q[] array.
void update_pf_params_par(int length, vrna_exp_param_t *parameters)
Recalculate energy parameters.
void init_pf_fold(int length)
Allocate space for pf_fold()
int st_back
Flag indicating that auxilary arrays are needed throughout the computations. This is essential for st...
char * centroid(int length, double *dist)
float vrna_pf(vrna_fold_compound_t *vc, char *structure)
Compute the partition function for a given RNA sequence, or sequence alignment.
float pf_fold(const char *sequence, char *structure)
Compute the partition function of an RNA sequence.
FLT_OR_DBL * export_bppm(void)
Get a pointer to the base pair probability arrayAccessing the base pair probabilities for a pair (i...
The datastructure that contains temperature scaled Boltzmann weights of the energy parameters...
Definition: params.h:94
Boltzmann Sampling of secondary structures from the ensemble.
void free_pf_arrays(void)
Free arrays for the partition function recursions.
double mean_bp_distance(int length)
Get the mean base pair distance of the last partition function computation.
this datastructure is used as input parameter in functions of PS_dot.h and others ...
Definition: data_structures.h:164
double vrna_mean_bp_distance_pr(int length, FLT_OR_DBL *pr)
Get the mean base pair distance in the thermodynamic ensemble from a probability matrix.
char * pbacktrack_circ(char *sequence)
Sample a secondary structure of a circular RNA from the Boltzmann ensemble according its probability...
void update_pf_params(int length)
Recalculate energy parameters.
double mean_bp_distance_pr(int length, FLT_OR_DBL *pr)
Get the mean base pair distance in the thermodynamic ensemble.
FLT_OR_DBL * pr
A pointer to the base pair probability matrix.
int get_pf_arrays(short **S_p, short **S1_p, char **ptype_p, FLT_OR_DBL **qb_p, FLT_OR_DBL **qm_p, FLT_OR_DBL **q1k_p, FLT_OR_DBL **qln_p)
Get the pointers to (almost) all relavant computation arrays used in partition function computation...
char * pbacktrack(char *sequence)
Sample a secondary structure from the Boltzmann ensemble according its probability.
vrna_plist_t * stackProb(double cutoff)
Get the probability of stacks.
float pf_fold_par(const char *sequence, char *structure, vrna_exp_param_t *parameters, int calculate_bppm, int is_constrained, int is_circular)
Compute the partition function for a given RNA sequence.
double expLoopEnergy(int u1, int u2, int type, int type2, short si1, short sj1, short sp1, short sq1)
int vrna_pf_float_precision(void)
Find out whether partition function computations are using single precision floating points...
double mean_bp_dist(int length)
Centroid structure computation.