RNAlib-2.4.5
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 
9 
10 
11 #ifndef VRNA_DISABLE_BACKWARD_COMPATIBILITY
12 
17 typedef struct vrna_dimer_pf_s cofoldF;
18 
19 #endif
20 
21 
23 #include <ViennaRNA/params.h>
24 #include <ViennaRNA/centroid.h>
27 
28 #ifdef VRNA_WARN_DEPRECATED
29 # if defined(__clang__)
30 # define DEPRECATED(func, msg) func __attribute__ ((deprecated("", msg)))
31 # elif defined(__GNUC__)
32 # define DEPRECATED(func, msg) func __attribute__ ((deprecated(msg)))
33 # else
34 # define DEPRECATED(func, msg) func
35 # endif
36 #else
37 # define DEPRECATED(func, msg) func
38 #endif
39 
49 /*
50 #################################################
51 # PARTITION FUNCTION COMPUTATION #
52 #################################################
53 */
54 
66  /* free energies for: */
67  double F0AB;
68  double FAB;
69  double FcAB;
70  double FA;
71  double FB;
72 };
73 
100 float vrna_pf(vrna_fold_compound_t *vc, char *structure);
101 
125 float vrna_pf_fold(const char *sequence, char *structure, vrna_ep_t **pl);
126 
153 float vrna_pf_circfold(const char *sequence, char *structure, vrna_ep_t **pl);
154 
171  char *structure);
172 
173 
174 /*
175 #################################################
176 # OTHER PARTITION FUNCTION RELATED DECLARATIONS #
177 #################################################
178 */
179 
187 int vrna_pf_float_precision(void);
188 
189 #ifndef VRNA_DISABLE_BACKWARD_COMPATIBILITY
190 
191 /*
192 #################################################
193 # DEPRECATED FUNCTIONS #
194 #################################################
195 */
196 
209 extern int st_back;
210 
251 DEPRECATED(float pf_fold_par( const char *sequence,
252  char *structure,
253  vrna_exp_param_t *parameters,
254  int calculate_bppm,
255  int is_constrained,
256  int is_circular),
257 "Use the new API and vrna_pf() instead");
258 
298 DEPRECATED(float pf_fold(const char *sequence,
299  char *structure),
300 "Use vrna_pf_fold() or vrna_pf() instead");
301 
328 DEPRECATED(float pf_circ_fold( const char *sequence,
329  char *structure),
330 "Use vrna_pf_circfold() or vrna_pf() instead");
331 
342 DEPRECATED(char *pbacktrack(char *sequence), "Use vrna_pbacktrack() instead");
343 
344 DEPRECATED(char *pbacktrack5(char *sequence, int length), "Use vrna_pbacktrack5() instead");
345 
361 DEPRECATED(char *pbacktrack_circ(char *sequence), "Use vrna_pbacktrack() instead");
362 
381 DEPRECATED(void free_pf_arrays(void), "This function is obsolete");
382 
393 DEPRECATED(void update_pf_params(int length), "This function is obsolete");
394 
402 DEPRECATED(void update_pf_params_par(int length, vrna_exp_param_t *parameters),
403 "Use the new API with vrna_fold_compound_t instead");
404 
421 DEPRECATED(FLT_OR_DBL *export_bppm(void),
422 "Use the new API with vrna_fold_compound_t instead");
423 
424 
440 DEPRECATED(int get_pf_arrays(short **S_p,
441  short **S1_p,
442  char **ptype_p,
443  FLT_OR_DBL **qb_p,
444  FLT_OR_DBL **qm_p,
445  FLT_OR_DBL **q1k_p,
446  FLT_OR_DBL **qln_p),
447 "Use the new API with vrna_fold_compound_t instead");
448 
452 DEPRECATED(double get_subseq_F(int i, int j),
453 "Use the new API with vrna_fold_compound_t instead");
454 
455 
467 DEPRECATED(double mean_bp_distance(int length),
468 "Use vrna_mean_bp_distance() or vrna_mean_bp_distance_pr() instead");
469 
487 DEPRECATED(double mean_bp_distance_pr(int length, FLT_OR_DBL *pr),
488 "Use vrna_mean_bp_distance() or vrna_mean_bp_distance_pr() instead");
489 
495 DEPRECATED(vrna_ep_t *stackProb(double cutoff), "Use vrna_stack_prob() instead");
496 
497 
503 DEPRECATED(void init_pf_fold(int length), "This function is obsolete");
504 
509 DEPRECATED(char *centroid(int length, double *dist),
510 "Use vrna_centroid() instead");
511 
516 DEPRECATED(char *get_centroid_struct_gquad_pr(int length,
517  double *dist),
518 "Use vrna_centroid() instead");
519 
525 DEPRECATED(double mean_bp_dist(int length),
526 "Use vrna_mean_bp_distance() or vrna_mean_bp_distance_pr() instead");
527 
531 DEPRECATED(double expLoopEnergy(int u1,
532  int u2,
533  int type,
534  int type2,
535  short si1,
536  short sj1,
537  short sp1,
538  short sq1),
539 "");
540 
544 DEPRECATED(double expHairpinEnergy( int u,
545  int type,
546  short si1,
547  short sj1,
548  const char *string),
549 "");
550 
551 /* this doesn't work if free_pf_arrays() is called before */
552 DEPRECATED(void assign_plist_gquad_from_pr(vrna_ep_t **pl,
553  int length,
554  double cut_off),
555 "Use vrna_plist_from_probs() instead");
556 
557 #endif
558 
559 #endif
float vrna_pf_circfold(const char *sequence, char *structure, vrna_ep_t **pl)
Compute Partition function (and base pair probabilities) for a circular RNA sequences using a compar...
float pf_circ_fold(const char *sequence, char *structure)
Compute the partition function of a circular RNA sequence.
char * get_centroid_struct_gquad_pr(int length, double *dist)
Data structure representing a single entry of an element probability list (e.g. list of pair probabil...
Definition: structure_utils.h:114
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:131
Equilibrium Probability implementations.
double F0AB
Null model without DuplexInit.
Definition: part_func.h:67
double expHairpinEnergy(int u, int type, short si1, short sj1, const char *string)
vrna_ep_t * stackProb(double cutoff)
Get the probability of stacks.
double FA
monomer A
Definition: part_func.h:70
double get_subseq_F(int i, int j)
Get the free energy of a subsequence from the q[] array.
Various data structures and pre-processor macros.
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...
Functions to deal with sets of energy parameters.
The data structure that contains temperature scaled Boltzmann weights of the energy parameters...
Definition: params.h:101
vrna_dimer_pf_t vrna_pf_dimer(vrna_fold_compound_t *vc, char *structure)
Calculate partition function and base pair probabilities of nucleic acid/nucleic acid dimers...
double FB
monomer B
Definition: part_func.h:71
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.
char * pbacktrack_circ(char *sequence)
Sample a secondary structure of a circular RNA from the Boltzmann ensemble according its probability...
float vrna_pf_fold(const char *sequence, char *structure, vrna_ep_t **pl)
Compute Partition function (and base pair probabilities) for an RNA sequence using a comparative met...
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.
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 FcAB
true hybrid states only
Definition: part_func.h:69
Data structure returned by vrna_pf_dimer()
Definition: part_func.h:65
double mean_bp_dist(int length)
Centroid structure computation.
double FAB
all states with DuplexInit correction
Definition: part_func.h:68