RNAlib-2.4.14
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 
25 #include <ViennaRNA/params/basic.h>
26 #include <ViennaRNA/centroid.h>
29 
30 #ifdef VRNA_WARN_DEPRECATED
31 # if defined(__clang__)
32 # define DEPRECATED(func, msg) func __attribute__ ((deprecated("", msg)))
33 # elif defined(__GNUC__)
34 # define DEPRECATED(func, msg) func __attribute__ ((deprecated(msg)))
35 # else
36 # define DEPRECATED(func, msg) func
37 # endif
38 #else
39 # define DEPRECATED(func, msg) func
40 #endif
41 
51 /*
52  #################################################
53  # PARTITION FUNCTION COMPUTATION #
54  #################################################
55  */
56 
98  /* free energies for: */
99  double F0AB;
100  double FAB;
101  double FcAB;
102  double FA;
103  double FB;
104 };
105 
139 float
141  char *structure);
142 
143 
164  char *structure);
165 
166 
167 /* End basic global interface */
196 float
197 vrna_pf_fold(const char *sequence,
198  char *structure,
199  vrna_ep_t **pl);
200 
201 
226 float
227 vrna_pf_circfold(const char *sequence,
228  char *structure,
229  vrna_ep_t **pl);
230 
231 
253 float
254 vrna_pf_alifold(const char **sequences,
255  char *structure,
256  vrna_ep_t **pl);
257 
258 
283 float
284 vrna_pf_circalifold(const char **sequences,
285  char *structure,
286  vrna_ep_t **pl);
287 
288 
316 vrna_pf_co_fold(const char *seq,
317  char *structure,
318  vrna_ep_t **pl);
319 
320 
321 /* End simplified global interface */
326 /*
327  #################################################
328  # OTHER PARTITION FUNCTION RELATED DECLARATIONS #
329  #################################################
330  */
331 
341 int
343 
344 
345 #ifndef VRNA_DISABLE_BACKWARD_COMPATIBILITY
346 
347 /*
348  #################################################
349  # DEPRECATED FUNCTIONS #
350  #################################################
351  */
352 
365 extern int st_back;
366 
407 DEPRECATED(float pf_fold_par(const char *sequence,
408  char *structure,
409  vrna_exp_param_t *parameters,
410  int calculate_bppm,
411  int is_constrained,
412  int is_circular),
413  "Use the new API and vrna_pf() instead");
414 
454 DEPRECATED(float pf_fold(const char *sequence,
455  char *structure),
456  "Use vrna_pf_fold() or vrna_pf() instead");
457 
484 DEPRECATED(float pf_circ_fold(const char *sequence,
485  char *structure),
486  "Use vrna_pf_circfold() or vrna_pf() instead");
487 
499 DEPRECATED(char *pbacktrack(char *sequence), "Use vrna_pbacktrack() instead");
500 
506 DEPRECATED(char *pbacktrack5(char *sequence,
507  int length), "Use vrna_pbacktrack5() instead");
508 
524 DEPRECATED(char *pbacktrack_circ(char *sequence), "Use vrna_pbacktrack() instead");
525 
544 DEPRECATED(void free_pf_arrays(void), "This function is obsolete");
545 
557 DEPRECATED(void update_pf_params(int length), "This function is obsolete");
558 
567 DEPRECATED(void update_pf_params_par(int length,
568  vrna_exp_param_t *parameters),
569  "Use the new API with vrna_fold_compound_t instead");
570 
588 DEPRECATED(FLT_OR_DBL *export_bppm(void),
589  "Use the new API with vrna_fold_compound_t instead");
590 
591 
608 DEPRECATED(int get_pf_arrays(short **S_p,
609  short **S1_p,
610  char **ptype_p,
611  FLT_OR_DBL **qb_p,
612  FLT_OR_DBL **qm_p,
613  FLT_OR_DBL **q1k_p,
614  FLT_OR_DBL **qln_p),
615  "Use the new API with vrna_fold_compound_t instead");
616 
622 DEPRECATED(double get_subseq_F(int i,
623  int j),
624  "Use the new API with vrna_fold_compound_t instead");
625 
626 
638 DEPRECATED(double mean_bp_distance(int length),
639  "Use vrna_mean_bp_distance() or vrna_mean_bp_distance_pr() instead");
640 
658 DEPRECATED(double mean_bp_distance_pr(int length,
659  FLT_OR_DBL *pr),
660  "Use vrna_mean_bp_distance() or vrna_mean_bp_distance_pr() instead");
661 
669 DEPRECATED(vrna_ep_t *stackProb(double cutoff), "Use vrna_stack_prob() instead");
670 
671 
679 DEPRECATED(void init_pf_fold(int length), "This function is obsolete");
680 
685 DEPRECATED(char *centroid(int length,
686  double *dist),
687  "Use vrna_centroid() instead");
688 
693 DEPRECATED(char *get_centroid_struct_gquad_pr(int length,
694  double *dist),
695  "Use vrna_centroid() instead");
696 
702 DEPRECATED(double mean_bp_dist(int length),
703  "Use vrna_mean_bp_distance() or vrna_mean_bp_distance_pr() instead");
704 
708 DEPRECATED(double expLoopEnergy(int u1,
709  int u2,
710  int type,
711  int type2,
712  short si1,
713  short sj1,
714  short sp1,
715  short sq1),
716  "");
717 
721 DEPRECATED(double expHairpinEnergy(int u,
722  int type,
723  short si1,
724  short sj1,
725  const char *string),
726  "");
727 
728 /* this doesn't work if free_pf_arrays() is called before */
729 DEPRECATED(void assign_plist_gquad_from_pr(vrna_ep_t **pl,
730  int length,
731  double cut_off),
732  "Use vrna_plist_from_probs() instead");
733 
734 #endif
735 
736 #endif
float vrna_pf_circalifold(const char **sequences, char *structure, vrna_ep_t **pl)
Compute Partition function (and base pair probabilities) for an alignment of circular RNA sequences ...
vrna_ep_t * stackProb(double cutoff)
Get the probability of stacks.
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(const char *sequence, char *structure)
Compute the partition function of an RNA sequence.
int vrna_pf_float_precision(void)
Find out whether partition function computations are using single precision floating points...
char * get_centroid_struct_gquad_pr(int length, double *dist)
void update_pf_params(int length)
Recalculate energy parameters.
double FAB
all states with DuplexInit correction
Definition: part_func.h:100
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.
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...
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
float pf_circ_fold(const char *sequence, char *structure)
Compute the partition function of a circular RNA sequence.
double FB
monomer B
Definition: part_func.h:103
Equilibrium Probability implementations.
vrna_dimer_pf_t vrna_pf_co_fold(const char *seq, char *structure, vrna_ep_t **pl)
Calculate partition function and base pair probabilities of nucleic acid/nucleic acid dimers...
double mean_bp_distance(int length)
Get the mean base pair distance of the last partition function computation.
double expHairpinEnergy(int u, int type, short si1, short sj1, const char *string)
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...
void init_pf_fold(int length)
Allocate space for pf_fold()
Data structure returned by vrna_pf_dimer()
Definition: part_func.h:97
Various data structures and pre-processor macros.
double get_subseq_F(int i, int j)
Get the free energy of a subsequence from the q[] array.
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...
char * centroid(int length, double *dist)
The data structure that contains temperature scaled Boltzmann weights of the energy parameters...
Definition: basic.h:103
char * pbacktrack_circ(char *sequence)
Sample a secondary structure of a circular RNA from the Boltzmann ensemble according its probability...
Boltzmann Sampling of secondary structures from the ensemble.
char * pbacktrack5(char *sequence, int length)
Sample a sub-structure from the Boltzmann ensemble according its probability.
float vrna_pf_alifold(const char **sequences, char *structure, vrna_ep_t **pl)
Compute Partition function (and base pair probabilities) for an RNA sequence alignment using a compa...
double mean_bp_distance_pr(int length, FLT_OR_DBL *pr)
Get the mean base pair distance in the thermodynamic ensemble.
double FA
monomer A
Definition: part_func.h:102
int st_back
Flag indicating that auxilary arrays are needed throughout the computations. This is essential for st...
void free_pf_arrays(void)
Free arrays for the partition function recursions.
void update_pf_params_par(int length, vrna_exp_param_t *parameters)
Recalculate energy parameters.
FLT_OR_DBL * pr
A pointer to the base pair probability matrix.
Functions to deal with sets of energy parameters.
FLT_OR_DBL * export_bppm(void)
Get a pointer to the base pair probability array.
Various utility- and helper-functions for secondary structure parsing, converting, etc.
The Basic Fold Compound API.
double expLoopEnergy(int u1, int u2, int type, int type2, short si1, short sj1, short sp1, short sq1)
double mean_bp_dist(int length)
Data structure representing a single entry of an element probability list (e.g. list of pair probabil...
Definition: structures.h:453
double F0AB
Null model without DuplexInit.
Definition: part_func.h:99
float vrna_pf(vrna_fold_compound_t *vc, char *structure)
Compute the partition function for a given RNA sequence, or sequence alignment.
Centroid structure computation.
double FcAB
true hybrid states only
Definition: part_func.h:101