RNAlib-2.5.0
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 
8 typedef struct vrna_dimer_pf_s vrna_dimer_pf_t;
9 
11 
12 #ifndef VRNA_DISABLE_BACKWARD_COMPATIBILITY
13 
18 typedef struct vrna_dimer_pf_s cofoldF;
19 
20 #endif
21 
22 
26 #include <ViennaRNA/params/basic.h>
27 #include <ViennaRNA/centroid.h>
30 
31 #ifdef VRNA_WARN_DEPRECATED
32 # if defined(__clang__)
33 # define DEPRECATED(func, msg) func __attribute__ ((deprecated("", msg)))
34 # elif defined(__GNUC__)
35 # define DEPRECATED(func, msg) func __attribute__ ((deprecated(msg)))
36 # else
37 # define DEPRECATED(func, msg) func
38 # endif
39 #else
40 # define DEPRECATED(func, msg) func
41 #endif
42 
52 /*
53  #################################################
54  # PARTITION FUNCTION COMPUTATION #
55  #################################################
56  */
57 
99  /* free energies for: */
100  double F0AB;
101  double FAB;
102  double FcAB;
103  double FA;
104  double FB;
105 };
106 
108  /* free energies for: */
109  double F_connected;
110  double *F_monomers;
111  size_t num_monomers;
112 };
113 
149  char *structure);
150 
151 
172  char *structure);
173 
174 
175 FLT_OR_DBL *
176 vrna_pf_substrands(vrna_fold_compound_t *fc,
177  size_t complex_size);
178 
180 vrna_pf_add(FLT_OR_DBL dG1,
181  FLT_OR_DBL dG2,
182  double kT);
183 
184 /* End basic global interface */
213 float
214 vrna_pf_fold(const char *sequence,
215  char *structure,
216  vrna_ep_t **pl);
217 
218 
243 float
244 vrna_pf_circfold(const char *sequence,
245  char *structure,
246  vrna_ep_t **pl);
247 
248 
270 float
271 vrna_pf_alifold(const char **sequences,
272  char *structure,
273  vrna_ep_t **pl);
274 
275 
300 float
301 vrna_pf_circalifold(const char **sequences,
302  char *structure,
303  vrna_ep_t **pl);
304 
305 
333 vrna_pf_co_fold(const char *seq,
334  char *structure,
335  vrna_ep_t **pl);
336 
337 
338 /* End simplified global interface */
343 /*
344  #################################################
345  # OTHER PARTITION FUNCTION RELATED DECLARATIONS #
346  #################################################
347  */
348 
358 int
360 
361 
362 #ifndef VRNA_DISABLE_BACKWARD_COMPATIBILITY
363 
364 /*
365  #################################################
366  # DEPRECATED FUNCTIONS #
367  #################################################
368  */
369 
382 extern int st_back;
383 
424 DEPRECATED(float
425  pf_fold_par(const char *sequence,
426  char *structure,
427  vrna_exp_param_t *parameters,
428  int calculate_bppm,
429  int is_constrained,
430  int is_circular),
431  "Use the new API and vrna_pf() instead");
432 
472 DEPRECATED(float
473  pf_fold(const char *sequence,
474  char *structure),
475  "Use vrna_pf_fold() or vrna_pf() instead");
476 
503 DEPRECATED(float
504  pf_circ_fold(const char *sequence,
505  char *structure),
506  "Use vrna_pf_circfold() or vrna_pf() instead");
507 
519 DEPRECATED(char *pbacktrack(char *sequence), "Use vrna_pbacktrack() instead");
520 
526 DEPRECATED(char *pbacktrack5(char *sequence,
527  int length), "Use vrna_pbacktrack5() instead");
528 
544 DEPRECATED(char *pbacktrack_circ(char *sequence), "Use vrna_pbacktrack() instead");
545 
564 DEPRECATED(void
565  free_pf_arrays(void), "This function is obsolete");
566 
578 DEPRECATED(void
579  update_pf_params(int length), "This function is obsolete");
580 
589 DEPRECATED(void
590  update_pf_params_par(int length,
591  vrna_exp_param_t *parameters),
592  "Use the new API with vrna_fold_compound_t instead");
593 
611 DEPRECATED(FLT_OR_DBL * export_bppm(void),
612  "Use the new API with vrna_fold_compound_t instead");
613 
614 
631 DEPRECATED(int
632  get_pf_arrays(short **S_p,
633  short **S1_p,
634  char **ptype_p,
635  FLT_OR_DBL **qb_p,
636  FLT_OR_DBL **qm_p,
637  FLT_OR_DBL **q1k_p,
638  FLT_OR_DBL **qln_p),
639  "Use the new API with vrna_fold_compound_t instead");
640 
646 DEPRECATED(double
647  get_subseq_F(int i,
648  int j),
649  "Use the new API with vrna_fold_compound_t instead");
650 
651 
663 DEPRECATED(double
664  mean_bp_distance(int length),
665  "Use vrna_mean_bp_distance() or vrna_mean_bp_distance_pr() instead");
666 
684 DEPRECATED(double
685  mean_bp_distance_pr(int length,
686  FLT_OR_DBL *pr),
687  "Use vrna_mean_bp_distance() or vrna_mean_bp_distance_pr() instead");
688 
696 DEPRECATED(vrna_ep_t * stackProb(double cutoff), "Use vrna_stack_prob() instead");
697 
698 
706 DEPRECATED(void
707  init_pf_fold(int length), "This function is obsolete");
708 
713 DEPRECATED(char *centroid(int length,
714  double *dist),
715  "Use vrna_centroid() instead");
716 
721 DEPRECATED(char *get_centroid_struct_gquad_pr(int length,
722  double *dist),
723  "Use vrna_centroid() instead");
724 
730 DEPRECATED(double
731  mean_bp_dist(int length),
732  "Use vrna_mean_bp_distance() or vrna_mean_bp_distance_pr() instead");
733 
737 DEPRECATED(double
738  expLoopEnergy(int u1,
739  int u2,
740  int type,
741  int type2,
742  short si1,
743  short sj1,
744  short sp1,
745  short sq1),
746  "");
747 
751 DEPRECATED(double
752  expHairpinEnergy(int u,
753  int type,
754  short si1,
755  short sj1,
756  const char *string),
757  "");
758 
759 /* this doesn't work if free_pf_arrays() is called before */
760 DEPRECATED(void
761  assign_plist_gquad_from_pr(vrna_ep_t **pl,
762  int length,
763  double cut_off),
764  "Use vrna_plist_from_probs() instead");
765 
766 #endif
767 
768 #endif
Boltzmann Sampling of secondary structures from the ensemble.
Centroid structure computation.
Various data structures and pre-processor macros.
Equilibrium Probability implementations.
The Basic Fold Compound API.
FLT_OR_DBL * pr
A pointer to the base pair probability matrix.
double FLT_OR_DBL
Typename for floating point number in partition function computations.
Definition: basic.h:43
The data structure that contains temperature scaled Boltzmann weights of the energy parameters.
Definition: basic.h:103
The most basic data structure required by many functions throughout the RNAlib.
Definition: fold_compound.h:137
void init_pf_fold(int length)
Allocate space for pf_fold()
double get_subseq_F(int i, int j)
Get the free energy of a subsequence from the q[] array.
void update_pf_params(int length)
Recalculate energy parameters.
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.
double mean_bp_distance(int length)
Get the mean base pair distance of the last partition function computation.
float pf_circ_fold(const char *sequence, char *structure)
Compute the partition function of a circular RNA sequence.
vrna_ep_t * stackProb(double cutoff)
Get the probability of stacks.
void update_pf_params_par(int length, vrna_exp_param_t *parameters)
Recalculate energy parameters.
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.
FLT_OR_DBL * export_bppm(void)
Get a pointer to the base pair probability array.
double mean_bp_distance_pr(int length, FLT_OR_DBL *pr)
Get the mean base pair distance in the thermodynamic ensemble.
float pf_fold(const char *sequence, char *structure)
Compute the partition function of an RNA sequence.
void free_pf_arrays(void)
Free arrays for the partition function recursions.
double FAB
all states with DuplexInit correction
Definition: part_func.h:101
double FA
monomer A
Definition: part_func.h:103
size_t num_monomers
Number of monomers.
Definition: part_func.h:111
double * F_monomers
monomers
Definition: part_func.h:110
double FcAB
true hybrid states only
Definition: part_func.h:102
double F0AB
Null model without DuplexInit.
Definition: part_func.h:100
double FB
monomer B
Definition: part_func.h:104
double F_connected
Fully connected ensemble (incl. DuplexInititiation and rotational symmetry correction.
Definition: part_func.h:109
FLT_OR_DBL vrna_pf(vrna_fold_compound_t *vc, char *structure)
Compute the partition function for a given RNA sequence, or sequence alignment.
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...
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.
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 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 ...
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...
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.
Data structure returned by vrna_pf_dimer()
Definition: part_func.h:98
Definition: part_func.h:107
int vrna_pf_float_precision(void)
Find out whether partition function computations are using single precision floating points.
Data structure representing a single entry of an element probability list (e.g. list of pair probabil...
Definition: structures.h:459
char * pbacktrack_circ(char *sequence)
Sample a secondary structure of a circular RNA from the Boltzmann ensemble according its probability.
char * pbacktrack(char *sequence)
Sample a secondary structure from the Boltzmann ensemble according its probability.
int st_back
Flag indicating that auxilary arrays are needed throughout the computations. This is essential for st...
char * pbacktrack5(char *sequence, int length)
Sample a sub-structure from the Boltzmann ensemble according its probability.
Functions to deal with sets of energy parameters.
char * get_centroid_struct_gquad_pr(int length, double *dist)
double expLoopEnergy(int u1, int u2, int type, int type2, short si1, short sj1, short sp1, short sq1)
double expHairpinEnergy(int u, int type, short si1, short sj1, const char *string)
char * centroid(int length, double *dist)
double mean_bp_dist(int length)
Various utility- and helper-functions for secondary structure parsing, converting,...