Replace Progs/RNAalifold with x64 binary and add all other programs
[jabaws.git] / binaries / src / ViennaRNA / H / LPfold.h
1 #ifndef __VIENNA_RNA_PACKAGE_LPFOLD_H__
2 #define __VIENNA_RNA_PACKAGE_LPFOLD_H__
3
4 #include "data_structures.h"
5
6 #ifdef __GNUC__
7 #define DEPRECATED(func) func __attribute__ ((deprecated))
8 #else
9 #define DEPRECATED(func) func
10 #endif
11
12 /**
13  *  \addtogroup local_pf_fold
14  *  @{
15  *    \file LPfold.h
16  *    \brief Function declarations of partition function variants of the Lfold algorithm
17  *
18  *  @}
19  */
20
21
22 /**
23  *  \brief
24  *
25  *  \ingroup local_pf_fold
26  * 
27  *  \param  length
28  */
29 void update_pf_paramsLP(int length);
30
31 /**
32  *  \brief
33  *
34  *  \ingroup local_pf_fold
35  * 
36  */
37 void update_pf_paramsLP_par(int length, pf_paramT *parameters);
38
39 /**
40  *  \brief Compute partition functions for locally stable secondary structures
41  * 
42  *  pfl_fold computes partition functions for every window of size
43  *  'winSize' possible in a RNA molecule, allowing only pairs with a span
44  *  smaller than 'pairSize'. It returns the mean pair probabilities averaged
45  *  over all windows containing the pair in 'pl'. 'winSize' should
46  *  always be >= 'pairSize'. Note that in contrast to Lfold(),
47  *  bases outside of the window do not influence the structure at all. Only
48  *  probabilities higher than 'cutoffb' are kept.
49  * 
50  *  If 'pU' is supplied (i.e is not the NULL pointer), pfl_fold()
51  *  will also compute the mean probability that regions of length 'u' and smaller are 
52  *  unpaired. The parameter 'u' is supplied in 'pup[0][0]'. On return
53  *  the 'pup' array will contain these probabilities, with the entry on
54  *  'pup[x][y]' containing the mean probability that x and the y-1
55  *  preceding bases are unpaired. The 'pU' array needs to be large
56  *  enough to hold n+1 float* entries, where n is the sequence length.
57  * 
58  *  If an array dpp2 is supplied, the probability of base pair (i,j)
59  *  given that there already exists a base pair (i+1,j-1) is also
60  *  computed and saved in this array. If pUfp is given (i.e. not NULL), pU
61  *  is not saved but put out imediately. If spup is given (i.e. is not NULL),
62  *  the pair probabilities in pl are not saved but put out imediately.
63  *
64  *  \ingroup local_pf_fold
65  * 
66  *  \param  sequence  RNA sequence
67  *  \param  winSize   size of the window
68  *  \param  pairSize  maximum size of base pair
69  *  \param  cutoffb   cutoffb for base pairs
70  *  \param  pU        array holding all unpaired probabilities   
71  *  \param  dpp2  array of dependent pair probabilities    
72  *  \param  pUfp     file pointer for pU 
73  *  \param  spup     file pointer for pair probabilities   
74  *  \return list of pair probabilities       
75  */
76 plist *pfl_fold(char *sequence,
77                 int winSize,
78                 int pairSize,
79                 float cutoffb,
80                 double **pU,
81                 struct plist **dpp2,
82                 FILE *pUfp,
83                 FILE *spup);
84
85 /**
86  *  \brief Compute partition functions for locally stable secondary structures
87  * 
88  *  \ingroup local_pf_fold
89  * 
90  */
91 plist *pfl_fold_par(char *sequence,
92                     int winSize,
93                     int pairSize,
94                     float cutoffb,
95                     double **pU,
96                     struct plist **dpp2,
97                     FILE *pUfp,
98                     FILE *spup,
99                     pf_paramT *parameters);
100
101
102 void putoutpU_prob_par( double **pU,
103                         int length,
104                         int ulength,
105                         FILE *fp,
106                         int energies,
107                         pf_paramT *parameters);
108
109
110 /**
111  *  \brief Writes the unpaired probabilities (pU) or opening energies into a file
112  * 
113  *  Can write either the unpaired probabilities (accessibilities) pU or
114  *  the opening energies -log(pU)kT into a file
115  * 
116  *  \ingroup local_pf_fold
117  * 
118  *  \param  pU       pair probabilities
119  *  \param  length   length of RNA sequence 
120  *  \param  ulength  maximum length of unpaired stretch 
121  *  \param  fp file pointer of destination file       
122  *  \param  energies  switch to put out as  opening energies 
123  */
124 void    putoutpU_prob(double **pU,
125                       int length,
126                       int ulength,
127                       FILE *fp,
128                       int energies);
129
130 void putoutpU_prob_bin_par( double **pU,
131                             int length,
132                             int ulength,
133                             FILE *fp,
134                             int energies,
135                             pf_paramT *parameters);
136
137 /**
138  *  \brief Writes the unpaired probabilities (pU) or opening energies into a binary file 
139  * 
140  *  Can write either the unpaired probabilities (accessibilities) pU or
141  *  the opening energies -log(pU)kT into a file
142  * 
143  *  \ingroup local_pf_fold
144  * 
145  *  \param  pU       pair probabilities
146  *  \param  length   length of RNA sequence 
147  *  \param  ulength  maximum length of unpaired stretch 
148  *  \param  fp file pointer of destination file       
149  *  \param  energies  switch to put out as  opening energies 
150  */
151 void    putoutpU_prob_bin(double **pU,
152                           int length,
153                           int ulength,
154                           FILE *fp,
155                           int energies);
156
157 /**
158  *  Dunno if this function was ever used by external programs linking to RNAlib, but it
159  *  was declared PUBLIC before.
160  *  Anyway, never use this function as it will be removed soon and does nothing at all
161  */
162 DEPRECATED(void init_pf_foldLP(int length));
163
164 #endif