1 \hypertarget{group__pf__fold}{\section{Calculating Partition Functions and Pair Probabilities}
2 \label{group__pf__fold}\index{Calculating Partition Functions and Pair Probabilities@{Calculating Partition Functions and Pair Probabilities}}
6 This section provides information about all functions and variables related to the calculation of the partition function and base pair probabilities.
9 Collaboration diagram for Calculating Partition Functions and Pair Probabilities\-:
14 \includegraphics[width=350pt]{group__pf__fold}
18 \begin{DoxyCompactItemize}
20 \hyperlink{group__mea__fold}{Compute the structure with maximum expected accuracy (\-M\-E\-A)}
22 \hyperlink{group__centroid__fold}{Compute the centroid structure}
24 \hyperlink{group__pf__cofold}{Partition Function for two hybridized Sequences}
25 \begin{DoxyCompactList}\small\item\em Partition Function Cofolding. \end{DoxyCompactList}\item
26 \hyperlink{group__up__cofold}{Partition Function for two hybridized Sequences as a stepwise Process}
27 \begin{DoxyCompactList}\small\item\em Partition Function Cofolding as a stepwise process. \end{DoxyCompactList}\item
28 \hyperlink{group__consensus__pf__fold}{Partition Function and Base Pair Probabilities for Sequence Alignment(s)}
30 \hyperlink{group__local__pf__fold}{Partition functions for locally stable secondary structures}
32 \hyperlink{group__kl__neighborhood__pf}{Calculate Partition Functions of a Distance Based Partitioning}
33 \begin{DoxyCompactList}\small\item\em Compute the partition function and stochastically sample secondary structures for a partitioning of the secondary structure space according to the base pair distance to two fixed reference structures. \end{DoxyCompactList}\end{DoxyCompactItemize}
35 \begin{DoxyCompactItemize}
37 file \hyperlink{part__func_8h}{part\-\_\-func.\-h}
38 \begin{DoxyCompactList}\small\item\em Partition function of single R\-N\-A sequences. \end{DoxyCompactList}\end{DoxyCompactItemize}
39 \subsection*{Functions}
40 \begin{DoxyCompactItemize}
42 float \hyperlink{group__pf__fold_ga1839c61275760944b3a007c41d5c0823}{pf\-\_\-fold\-\_\-par} (const char $\ast$sequence, char $\ast$structure, \hyperlink{structpf__paramT}{pf\-\_\-param\-T} $\ast$parameters, int calculate\-\_\-bppm, int is\-\_\-constrained, int is\-\_\-circular)
43 \begin{DoxyCompactList}\small\item\em Compute the partition function $Q$ for a given R\-N\-A sequence. \end{DoxyCompactList}\item
44 float \hyperlink{group__pf__fold_gadc3db3d98742427e7001a7fd36ef28c2}{pf\-\_\-fold} (const char $\ast$sequence, char $\ast$structure)
45 \begin{DoxyCompactList}\small\item\em Compute the partition function $Q$ of an R\-N\-A sequence. \end{DoxyCompactList}\item
46 float \hyperlink{group__pf__fold_ga819ce5fca8984004ac81c4a3b04cb735}{pf\-\_\-circ\-\_\-fold} (const char $\ast$sequence, char $\ast$structure)
47 \begin{DoxyCompactList}\small\item\em Compute the partition function of a circular R\-N\-A sequence. \end{DoxyCompactList}\item
48 void \hyperlink{group__pf__fold_gae73db3f49a94f0f72e067ecd12681dbd}{free\-\_\-pf\-\_\-arrays} (void)
49 \begin{DoxyCompactList}\small\item\em Free arrays for the partition function recursions. \end{DoxyCompactList}\item
50 void \hyperlink{group__pf__fold_ga384e927890f9c034ff09fa66da102d28}{update\-\_\-pf\-\_\-params} (int length)
51 \begin{DoxyCompactList}\small\item\em Recalculate energy parameters. \end{DoxyCompactList}\item
52 \hypertarget{group__pf__fold_ga0733527a94de3b79eee3c3c03c99c1bc}{void \hyperlink{group__pf__fold_ga0733527a94de3b79eee3c3c03c99c1bc}{update\-\_\-pf\-\_\-params\-\_\-par} (int length, \hyperlink{structpf__paramT}{pf\-\_\-param\-T} $\ast$parameters)}\label{group__pf__fold_ga0733527a94de3b79eee3c3c03c99c1bc}
54 \begin{DoxyCompactList}\small\item\em Recalculate energy parameters. \end{DoxyCompactList}\item
55 double $\ast$ \hyperlink{group__pf__fold_ga6d463707d5f64bdc4d21515b7dd9b115}{export\-\_\-bppm} (void)
56 \begin{DoxyCompactList}\small\item\em Get a pointer to the base pair probability array
58 Accessing the base pair probabilities for a pair (i,j) is achieved by. \end{DoxyCompactList}\item
59 void \hyperlink{group__pf__fold_ga03e15e831a31b1154855ab47edbdb019}{assign\-\_\-plist\-\_\-from\-\_\-pr} (\hyperlink{structplist}{plist} $\ast$$\ast$pl, double $\ast$probs, int length, double cutoff)
60 \begin{DoxyCompactList}\small\item\em Create a plist from a probability matrix. \end{DoxyCompactList}\item
61 int \hyperlink{group__pf__fold_ga18607e79e106cad827f482eedd2f632e}{get\-\_\-pf\-\_\-arrays} (short $\ast$$\ast$S\-\_\-p, short $\ast$$\ast$S1\-\_\-p, char $\ast$$\ast$ptype\-\_\-p, double $\ast$$\ast$qb\-\_\-p, double $\ast$$\ast$qm\-\_\-p, double $\ast$$\ast$q1k\-\_\-p, double $\ast$$\ast$qln\-\_\-p)
62 \begin{DoxyCompactList}\small\item\em Get the pointers to (almost) all relavant computation arrays used in partition function computation. \end{DoxyCompactList}\item
63 double \hyperlink{group__pf__fold_ga79cbc375af65f11609feb6b055269e7d}{mean\-\_\-bp\-\_\-distance} (int length)
64 \begin{DoxyCompactList}\small\item\em Get the mean base pair distance of the last partition function computation. \end{DoxyCompactList}\item
65 double \hyperlink{group__pf__fold_ga72d84525f0afd3a9d60d830a2f501fa5}{mean\-\_\-bp\-\_\-distance\-\_\-pr} (int length, double $\ast$\hyperlink{fold__vars_8h_a0f5757427fd5f2f79d6fca0081cd5a52}{pr})
66 \begin{DoxyCompactList}\small\item\em Get the mean base pair distance in the thermodynamic ensemble. \end{DoxyCompactList}\end{DoxyCompactItemize}
69 \subsection{Detailed Description}
70 This section provides information about all functions and variables related to the calculation of the partition function and base pair probabilities. Instead of the minimum free energy structure the partition function of all possible structures and from that the pairing probability for every possible pair can be calculated, using a dynamic programming algorithm as described in\cite{mccaskill:1990}.
72 \subsection{Function Documentation}
73 \hypertarget{group__pf__fold_ga1839c61275760944b3a007c41d5c0823}{\index{Calculating Partition Functions and Pair Probabilities@{Calculating Partition Functions and Pair Probabilities}!pf\-\_\-fold\-\_\-par@{pf\-\_\-fold\-\_\-par}}
74 \index{pf\-\_\-fold\-\_\-par@{pf\-\_\-fold\-\_\-par}!Calculating Partition Functions and Pair Probabilities@{Calculating Partition Functions and Pair Probabilities}}
75 \subsubsection[{pf\-\_\-fold\-\_\-par}]{\setlength{\rightskip}{0pt plus 5cm}float pf\-\_\-fold\-\_\-par (
76 \begin{DoxyParamCaption}
77 \item[{const char $\ast$}]{sequence, }
78 \item[{char $\ast$}]{structure, }
79 \item[{{\bf pf\-\_\-param\-T} $\ast$}]{parameters, }
80 \item[{int}]{calculate\-\_\-bppm, }
81 \item[{int}]{is\-\_\-constrained, }
82 \item[{int}]{is\-\_\-circular}
83 \end{DoxyParamCaption}
84 )}}\label{group__pf__fold_ga1839c61275760944b3a007c41d5c0823}
87 Compute the partition function $Q$ for a given R\-N\-A sequence.
89 If {\itshape structure} is not a N\-U\-L\-L pointer on input, it contains on return a string consisting of the letters \char`\"{} . , $|$ \{ \} ( ) \char`\"{} denoting bases that are essentially unpaired, weakly paired, strongly paired without preference, weakly upstream (downstream) paired, or strongly up-\/ (down-\/)stream paired bases, respectively. If \hyperlink{fold__vars_8h_a0afc287c2464866d94858c39175154af}{fold\-\_\-constrained} is not 0, the {\itshape structure} string is interpreted on input as a list of constraints for the folding. The character \char`\"{}x\char`\"{} marks bases that must be unpaired, matching brackets \char`\"{} ( ) \char`\"{} denote base pairs, all other characters are ignored. Any pairs conflicting with the constraint will be forbidden. This is usually sufficient to ensure the constraints are honored. If tha parameter calculate\-\_\-bppm is set to 0 base pairing probabilities will not be computed (saving C\-P\-U time), otherwise after calculations took place \hyperlink{fold__vars_8h_a0f5757427fd5f2f79d6fca0081cd5a52}{pr} will contain the probability that bases {\itshape i} and {\itshape j} pair.
91 \begin{DoxyNote}{Note}
92 The global array \hyperlink{fold__vars_8h_a0f5757427fd5f2f79d6fca0081cd5a52}{pr} is deprecated and the user who wants the calculated base pair probabilities for further computations is advised to use the function \hyperlink{group__pf__fold_ga6d463707d5f64bdc4d21515b7dd9b115}{export\-\_\-bppm()}
94 \begin{DoxyPostcond}{Postcondition}
95 After successful run the hidden folding matrices are filled with the appropriate Boltzmann factors. Depending on whether the global variable \hyperlink{fold__vars_8h_ad512b5dd4dbec60faccfe137bb474489}{do\-\_\-backtrack} was set the base pair probabilities are already computed and may be accessed for further usage via the \hyperlink{group__pf__fold_ga6d463707d5f64bdc4d21515b7dd9b115}{export\-\_\-bppm()} function. A call of \hyperlink{group__pf__fold_gae73db3f49a94f0f72e067ecd12681dbd}{free\-\_\-pf\-\_\-arrays()} will free all memory allocated by this function. Successive calls will first free previously allocated memory before starting the computation.
97 \begin{DoxySeeAlso}{See Also}
98 \hyperlink{group__pf__fold_gadc3db3d98742427e7001a7fd36ef28c2}{pf\-\_\-fold()}, \hyperlink{group__pf__fold_ga819ce5fca8984004ac81c4a3b04cb735}{pf\-\_\-circ\-\_\-fold()}, \hyperlink{part__func_8h_a1f562d463c14d4703d9656056200eb38}{bppm\-\_\-to\-\_\-structure()}, \hyperlink{group__pf__fold_ga6d463707d5f64bdc4d21515b7dd9b115}{export\-\_\-bppm()}, \hyperlink{group__energy__parameters_ga6fc2f3eef5a3024d44963ac59a42e39d}{get\-\_\-boltzmann\-\_\-factors()}, \hyperlink{group__pf__fold_gae73db3f49a94f0f72e067ecd12681dbd}{free\-\_\-pf\-\_\-arrays()}
101 \begin{DoxyParams}[1]{Parameters}
102 \mbox{\tt in} & {\em sequence} & The R\-N\-A sequence input \\
104 \mbox{\tt in,out} & {\em structure} & A pointer to a char array where a base pair probability information can be stored in a pseudo-\/dot-\/bracket notation (may be N\-U\-L\-L, too) \\
106 \mbox{\tt in} & {\em parameters} & Data structure containing the precalculated Boltzmann factors \\
108 \mbox{\tt in} & {\em calculate\-\_\-bppm} & Switch to Base pair probability calculations on/off (0==off) \\
110 \mbox{\tt in} & {\em is\-\_\-constrained} & Switch to indicate that a structure contraint is passed via the structure argument (0==off) \\
112 \mbox{\tt in} & {\em is\-\_\-circular} & Switch to (de-\/)activate postprocessing steps in case R\-N\-A sequence is circular (0==off) \\
115 \begin{DoxyReturn}{Returns}
116 The Gibbs free energy of the ensemble ( $G = -RT \cdot \log(Q) $) in kcal/mol
118 \hypertarget{group__pf__fold_gadc3db3d98742427e7001a7fd36ef28c2}{\index{Calculating Partition Functions and Pair Probabilities@{Calculating Partition Functions and Pair Probabilities}!pf\-\_\-fold@{pf\-\_\-fold}}
119 \index{pf\-\_\-fold@{pf\-\_\-fold}!Calculating Partition Functions and Pair Probabilities@{Calculating Partition Functions and Pair Probabilities}}
120 \subsubsection[{pf\-\_\-fold}]{\setlength{\rightskip}{0pt plus 5cm}float pf\-\_\-fold (
121 \begin{DoxyParamCaption}
122 \item[{const char $\ast$}]{sequence, }
123 \item[{char $\ast$}]{structure}
124 \end{DoxyParamCaption}
125 )}}\label{group__pf__fold_gadc3db3d98742427e7001a7fd36ef28c2}
128 Compute the partition function $Q$ of an R\-N\-A sequence.
130 If {\itshape structure} is not a N\-U\-L\-L pointer on input, it contains on return a string consisting of the letters \char`\"{} . , $|$ \{ \} ( ) \char`\"{} denoting bases that are essentially unpaired, weakly paired, strongly paired without preference, weakly upstream (downstream) paired, or strongly up-\/ (down-\/)stream paired bases, respectively. If \hyperlink{fold__vars_8h_a0afc287c2464866d94858c39175154af}{fold\-\_\-constrained} is not 0, the {\itshape structure} string is interpreted on input as a list of constraints for the folding. The character \char`\"{}x\char`\"{} marks bases that must be unpaired, matching brackets \char`\"{} ( ) \char`\"{} denote base pairs, all other characters are ignored. Any pairs conflicting with the constraint will be forbidden. This is usually sufficient to ensure the constraints are honored. If \hyperlink{fold__vars_8h_ad512b5dd4dbec60faccfe137bb474489}{do\-\_\-backtrack} has been set to 0 base pairing probabilities will not be computed (saving C\-P\-U time), otherwise \hyperlink{fold__vars_8h_a0f5757427fd5f2f79d6fca0081cd5a52}{pr} will contain the probability that bases {\itshape i} and {\itshape j} pair.
132 \begin{DoxyNote}{Note}
133 The global array \hyperlink{fold__vars_8h_a0f5757427fd5f2f79d6fca0081cd5a52}{pr} is deprecated and the user who wants the calculated base pair probabilities for further computations is advised to use the function \hyperlink{group__pf__fold_ga6d463707d5f64bdc4d21515b7dd9b115}{export\-\_\-bppm()}.
135 {\bfseries Open\-M\-P\-:} This function is not entirely threadsafe. While the recursions are working on their own copies of data the model details for the recursions are determined from the global settings just before entering the recursions. Consider using \hyperlink{group__pf__fold_ga1839c61275760944b3a007c41d5c0823}{pf\-\_\-fold\-\_\-par()} for a really threadsafe implementation.
137 \begin{DoxyPrecond}{Precondition}
138 This function takes its model details from the global variables provided in {\itshape R\-N\-Alib}
140 \begin{DoxyPostcond}{Postcondition}
141 After successful run the hidden folding matrices are filled with the appropriate Boltzmann factors. Depending on whether the global variable \hyperlink{fold__vars_8h_ad512b5dd4dbec60faccfe137bb474489}{do\-\_\-backtrack} was set the base pair probabilities are already computed and may be accessed for further usage via the \hyperlink{group__pf__fold_ga6d463707d5f64bdc4d21515b7dd9b115}{export\-\_\-bppm()} function. A call of \hyperlink{group__pf__fold_gae73db3f49a94f0f72e067ecd12681dbd}{free\-\_\-pf\-\_\-arrays()} will free all memory allocated by this function. Successive calls will first free previously allocated memory before starting the computation.
143 \begin{DoxySeeAlso}{See Also}
144 \hyperlink{group__pf__fold_ga1839c61275760944b3a007c41d5c0823}{pf\-\_\-fold\-\_\-par()}, \hyperlink{group__pf__fold_ga819ce5fca8984004ac81c4a3b04cb735}{pf\-\_\-circ\-\_\-fold()}, \hyperlink{part__func_8h_a1f562d463c14d4703d9656056200eb38}{bppm\-\_\-to\-\_\-structure()}, \hyperlink{group__pf__fold_ga6d463707d5f64bdc4d21515b7dd9b115}{export\-\_\-bppm()}
147 \begin{DoxyParams}{Parameters}
148 {\em sequence} & The R\-N\-A sequence input \\
150 {\em structure} & A pointer to a char array where a base pair probability information can be stored in a pseudo-\/dot-\/bracket notation (may be N\-U\-L\-L, too) \\
153 \begin{DoxyReturn}{Returns}
154 The Gibbs free energy of the ensemble ( $G = -RT \cdot \log(Q) $) in kcal/mol
156 \hypertarget{group__pf__fold_ga819ce5fca8984004ac81c4a3b04cb735}{\index{Calculating Partition Functions and Pair Probabilities@{Calculating Partition Functions and Pair Probabilities}!pf\-\_\-circ\-\_\-fold@{pf\-\_\-circ\-\_\-fold}}
157 \index{pf\-\_\-circ\-\_\-fold@{pf\-\_\-circ\-\_\-fold}!Calculating Partition Functions and Pair Probabilities@{Calculating Partition Functions and Pair Probabilities}}
158 \subsubsection[{pf\-\_\-circ\-\_\-fold}]{\setlength{\rightskip}{0pt plus 5cm}float pf\-\_\-circ\-\_\-fold (
159 \begin{DoxyParamCaption}
160 \item[{const char $\ast$}]{sequence, }
161 \item[{char $\ast$}]{structure}
162 \end{DoxyParamCaption}
163 )}}\label{group__pf__fold_ga819ce5fca8984004ac81c4a3b04cb735}
166 Compute the partition function of a circular R\-N\-A sequence.
168 \begin{DoxyNote}{Note}
169 The global array \hyperlink{fold__vars_8h_a0f5757427fd5f2f79d6fca0081cd5a52}{pr} is deprecated and the user who wants the calculated base pair probabilities for further computations is advised to use the function \hyperlink{group__pf__fold_ga6d463707d5f64bdc4d21515b7dd9b115}{export\-\_\-bppm()}.
171 {\bfseries Open\-M\-P\-:} This function is not entirely threadsafe. While the recursions are working on their own copies of data the model details for the recursions are determined from the global settings just before entering the recursions. Consider using \hyperlink{group__pf__fold_ga1839c61275760944b3a007c41d5c0823}{pf\-\_\-fold\-\_\-par()} for a really threadsafe implementation.
173 \begin{DoxyPrecond}{Precondition}
174 This function takes its model details from the global variables provided in {\itshape R\-N\-Alib}
176 \begin{DoxyPostcond}{Postcondition}
177 After successful run the hidden folding matrices are filled with the appropriate Boltzmann factors. Depending on whether the global variable \hyperlink{fold__vars_8h_ad512b5dd4dbec60faccfe137bb474489}{do\-\_\-backtrack} was set the base pair probabilities are already computed and may be accessed for further usage via the \hyperlink{group__pf__fold_ga6d463707d5f64bdc4d21515b7dd9b115}{export\-\_\-bppm()} function. A call of \hyperlink{group__pf__fold_gae73db3f49a94f0f72e067ecd12681dbd}{free\-\_\-pf\-\_\-arrays()} will free all memory allocated by this function. Successive calls will first free previously allocated memory before starting the computation.
179 \begin{DoxySeeAlso}{See Also}
180 \hyperlink{group__pf__fold_ga1839c61275760944b3a007c41d5c0823}{pf\-\_\-fold\-\_\-par()}, \hyperlink{group__pf__fold_gadc3db3d98742427e7001a7fd36ef28c2}{pf\-\_\-fold()}
183 \begin{DoxyParams}[1]{Parameters}
184 \mbox{\tt in} & {\em sequence} & The R\-N\-A sequence input \\
186 \mbox{\tt in,out} & {\em structure} & A pointer to a char array where a base pair probability information can be stored in a pseudo-\/dot-\/bracket notation (may be N\-U\-L\-L, too) \\
189 \begin{DoxyReturn}{Returns}
190 The Gibbs free energy of the ensemble ( $G = -RT \cdot \log(Q) $) in kcal/mol
192 \hypertarget{group__pf__fold_gae73db3f49a94f0f72e067ecd12681dbd}{\index{Calculating Partition Functions and Pair Probabilities@{Calculating Partition Functions and Pair Probabilities}!free\-\_\-pf\-\_\-arrays@{free\-\_\-pf\-\_\-arrays}}
193 \index{free\-\_\-pf\-\_\-arrays@{free\-\_\-pf\-\_\-arrays}!Calculating Partition Functions and Pair Probabilities@{Calculating Partition Functions and Pair Probabilities}}
194 \subsubsection[{free\-\_\-pf\-\_\-arrays}]{\setlength{\rightskip}{0pt plus 5cm}void free\-\_\-pf\-\_\-arrays (
195 \begin{DoxyParamCaption}
197 \end{DoxyParamCaption}
198 )}}\label{group__pf__fold_gae73db3f49a94f0f72e067ecd12681dbd}
201 Free arrays for the partition function recursions.
203 Call this function if you want to free all allocated memory associated with the partition function forward recursion. \begin{DoxyNote}{Note}
204 Successive calls of \hyperlink{group__pf__fold_gadc3db3d98742427e7001a7fd36ef28c2}{pf\-\_\-fold()}, \hyperlink{group__pf__fold_ga819ce5fca8984004ac81c4a3b04cb735}{pf\-\_\-circ\-\_\-fold()} already check if they should free any memory from a previous run.
206 {\bfseries Open\-M\-P notice\-:}\par
207 This function should be called before leaving a thread in order to avoid leaking memory
209 \begin{DoxyPostcond}{Postcondition}
210 All memory allocated by \hyperlink{group__pf__fold_ga1839c61275760944b3a007c41d5c0823}{pf\-\_\-fold\-\_\-par()}, \hyperlink{group__pf__fold_gadc3db3d98742427e7001a7fd36ef28c2}{pf\-\_\-fold()} or \hyperlink{group__pf__fold_ga819ce5fca8984004ac81c4a3b04cb735}{pf\-\_\-circ\-\_\-fold()} will be free'd
212 \begin{DoxySeeAlso}{See Also}
213 \hyperlink{group__pf__fold_ga1839c61275760944b3a007c41d5c0823}{pf\-\_\-fold\-\_\-par()}, \hyperlink{group__pf__fold_gadc3db3d98742427e7001a7fd36ef28c2}{pf\-\_\-fold()}, \hyperlink{group__pf__fold_ga819ce5fca8984004ac81c4a3b04cb735}{pf\-\_\-circ\-\_\-fold()}
215 \hypertarget{group__pf__fold_ga384e927890f9c034ff09fa66da102d28}{\index{Calculating Partition Functions and Pair Probabilities@{Calculating Partition Functions and Pair Probabilities}!update\-\_\-pf\-\_\-params@{update\-\_\-pf\-\_\-params}}
216 \index{update\-\_\-pf\-\_\-params@{update\-\_\-pf\-\_\-params}!Calculating Partition Functions and Pair Probabilities@{Calculating Partition Functions and Pair Probabilities}}
217 \subsubsection[{update\-\_\-pf\-\_\-params}]{\setlength{\rightskip}{0pt plus 5cm}void update\-\_\-pf\-\_\-params (
218 \begin{DoxyParamCaption}
220 \end{DoxyParamCaption}
221 )}}\label{group__pf__fold_ga384e927890f9c034ff09fa66da102d28}
224 Recalculate energy parameters.
226 Call this function to recalculate the pair matrix and energy parameters after a change in folding parameters like \hyperlink{fold__vars_8h_ab4b11c8d9c758430960896bc3fe82ead}{temperature} \hypertarget{group__pf__fold_ga6d463707d5f64bdc4d21515b7dd9b115}{\index{Calculating Partition Functions and Pair Probabilities@{Calculating Partition Functions and Pair Probabilities}!export\-\_\-bppm@{export\-\_\-bppm}}
227 \index{export\-\_\-bppm@{export\-\_\-bppm}!Calculating Partition Functions and Pair Probabilities@{Calculating Partition Functions and Pair Probabilities}}
228 \subsubsection[{export\-\_\-bppm}]{\setlength{\rightskip}{0pt plus 5cm}double$\ast$ export\-\_\-bppm (
229 \begin{DoxyParamCaption}
231 \end{DoxyParamCaption}
232 )}}\label{group__pf__fold_ga6d463707d5f64bdc4d21515b7dd9b115}
235 Get a pointer to the base pair probability array
237 Accessing the base pair probabilities for a pair (i,j) is achieved by.
241 FLT\_OR\_DBL *pr = \hyperlink{group__pf__fold_ga6d463707d5f64bdc4d21515b7dd9b115}{export\_bppm}();
242 pr\_ij = pr[iindx[i]-j];
246 \begin{DoxyPrecond}{Precondition}
247 Call \hyperlink{group__pf__fold_ga1839c61275760944b3a007c41d5c0823}{pf\-\_\-fold\-\_\-par()}, \hyperlink{group__pf__fold_gadc3db3d98742427e7001a7fd36ef28c2}{pf\-\_\-fold()} or \hyperlink{group__pf__fold_ga819ce5fca8984004ac81c4a3b04cb735}{pf\-\_\-circ\-\_\-fold()} first to fill the base pair probability array
249 \begin{DoxySeeAlso}{See Also}
250 \hyperlink{group__pf__fold_gadc3db3d98742427e7001a7fd36ef28c2}{pf\-\_\-fold()}, \hyperlink{group__pf__fold_ga819ce5fca8984004ac81c4a3b04cb735}{pf\-\_\-circ\-\_\-fold()}, \hyperlink{utils_8h_a55c0f6b3b07b6adf2ee235ba901fe397}{get\-\_\-iindx()}
252 \begin{DoxyReturn}{Returns}
253 A pointer to the base pair probability array
255 \hypertarget{group__pf__fold_ga03e15e831a31b1154855ab47edbdb019}{\index{Calculating Partition Functions and Pair Probabilities@{Calculating Partition Functions and Pair Probabilities}!assign\-\_\-plist\-\_\-from\-\_\-pr@{assign\-\_\-plist\-\_\-from\-\_\-pr}}
256 \index{assign\-\_\-plist\-\_\-from\-\_\-pr@{assign\-\_\-plist\-\_\-from\-\_\-pr}!Calculating Partition Functions and Pair Probabilities@{Calculating Partition Functions and Pair Probabilities}}
257 \subsubsection[{assign\-\_\-plist\-\_\-from\-\_\-pr}]{\setlength{\rightskip}{0pt plus 5cm}void assign\-\_\-plist\-\_\-from\-\_\-pr (
258 \begin{DoxyParamCaption}
259 \item[{{\bf plist} $\ast$$\ast$}]{pl, }
260 \item[{double $\ast$}]{probs, }
261 \item[{int}]{length, }
262 \item[{double}]{cutoff}
263 \end{DoxyParamCaption}
264 )}}\label{group__pf__fold_ga03e15e831a31b1154855ab47edbdb019}
267 Create a plist from a probability matrix.
269 The probability matrix given is parsed and all pair probabilities above the given threshold are used to create an entry in the plist
271 The end of the plist is marked by sequence positions i as well as j equal to 0. This condition should be used to stop looping over its entries
273 \begin{DoxyNote}{Note}
274 This function is threadsafe
277 \begin{DoxyParams}[1]{Parameters}
278 \mbox{\tt out} & {\em pl} & A pointer to the plist that is to be created \\
280 \mbox{\tt in} & {\em probs} & The probability matrix used for creting the plist \\
282 \mbox{\tt in} & {\em length} & The length of the R\-N\-A sequence \\
284 \mbox{\tt in} & {\em cutoff} & The cutoff value \\
287 \hypertarget{group__pf__fold_ga18607e79e106cad827f482eedd2f632e}{\index{Calculating Partition Functions and Pair Probabilities@{Calculating Partition Functions and Pair Probabilities}!get\-\_\-pf\-\_\-arrays@{get\-\_\-pf\-\_\-arrays}}
288 \index{get\-\_\-pf\-\_\-arrays@{get\-\_\-pf\-\_\-arrays}!Calculating Partition Functions and Pair Probabilities@{Calculating Partition Functions and Pair Probabilities}}
289 \subsubsection[{get\-\_\-pf\-\_\-arrays}]{\setlength{\rightskip}{0pt plus 5cm}int get\-\_\-pf\-\_\-arrays (
290 \begin{DoxyParamCaption}
291 \item[{short $\ast$$\ast$}]{S\-\_\-p, }
292 \item[{short $\ast$$\ast$}]{S1\-\_\-p, }
293 \item[{char $\ast$$\ast$}]{ptype\-\_\-p, }
294 \item[{double $\ast$$\ast$}]{qb\-\_\-p, }
295 \item[{double $\ast$$\ast$}]{qm\-\_\-p, }
296 \item[{double $\ast$$\ast$}]{q1k\-\_\-p, }
297 \item[{double $\ast$$\ast$}]{qln\-\_\-p}
298 \end{DoxyParamCaption}
299 )}}\label{group__pf__fold_ga18607e79e106cad827f482eedd2f632e}
302 Get the pointers to (almost) all relavant computation arrays used in partition function computation.
304 \begin{DoxyPrecond}{Precondition}
305 In order to assign meaningful pointers, you have to call \hyperlink{group__pf__fold_ga1839c61275760944b3a007c41d5c0823}{pf\-\_\-fold\-\_\-par()} or \hyperlink{group__pf__fold_gadc3db3d98742427e7001a7fd36ef28c2}{pf\-\_\-fold()} first!
307 \begin{DoxySeeAlso}{See Also}
308 \hyperlink{group__pf__fold_ga1839c61275760944b3a007c41d5c0823}{pf\-\_\-fold\-\_\-par()}, \hyperlink{group__pf__fold_gadc3db3d98742427e7001a7fd36ef28c2}{pf\-\_\-fold()}, \hyperlink{group__pf__fold_ga819ce5fca8984004ac81c4a3b04cb735}{pf\-\_\-circ\-\_\-fold()}
311 \begin{DoxyParams}[1]{Parameters}
312 \mbox{\tt out} & {\em S\-\_\-p} & A pointer to the 'S' array (integer representation of nucleotides) \\
314 \mbox{\tt out} & {\em S1\-\_\-p} & A pointer to the 'S1' array (2nd integer representation of nucleotides) \\
316 \mbox{\tt out} & {\em ptype\-\_\-p} & A pointer to the pair type matrix \\
318 \mbox{\tt out} & {\em qb\-\_\-p} & A pointer to the Q$^{\mbox{B}}$ matrix \\
320 \mbox{\tt out} & {\em qm\-\_\-p} & A pointer to the Q$^{\mbox{M}}$ matrix \\
322 \mbox{\tt out} & {\em q1k\-\_\-p} & A pointer to the 5' slice of the Q matrix ( $q1k(k) = Q(1, k)$) \\
324 \mbox{\tt out} & {\em qln\-\_\-p} & A pointer to the 3' slice of the Q matrix ( $qln(l) = Q(l, n)$) \\
327 \begin{DoxyReturn}{Returns}
328 Non Zero if everything went fine, 0 otherwise
330 \hypertarget{group__pf__fold_ga79cbc375af65f11609feb6b055269e7d}{\index{Calculating Partition Functions and Pair Probabilities@{Calculating Partition Functions and Pair Probabilities}!mean\-\_\-bp\-\_\-distance@{mean\-\_\-bp\-\_\-distance}}
331 \index{mean\-\_\-bp\-\_\-distance@{mean\-\_\-bp\-\_\-distance}!Calculating Partition Functions and Pair Probabilities@{Calculating Partition Functions and Pair Probabilities}}
332 \subsubsection[{mean\-\_\-bp\-\_\-distance}]{\setlength{\rightskip}{0pt plus 5cm}double mean\-\_\-bp\-\_\-distance (
333 \begin{DoxyParamCaption}
335 \end{DoxyParamCaption}
336 )}}\label{group__pf__fold_ga79cbc375af65f11609feb6b055269e7d}
339 Get the mean base pair distance of the last partition function computation.
341 \begin{DoxyNote}{Note}
342 To ensure thread-\/safety, use the function \hyperlink{group__pf__fold_ga72d84525f0afd3a9d60d830a2f501fa5}{mean\-\_\-bp\-\_\-distance\-\_\-pr()} instead!
344 \begin{DoxySeeAlso}{See Also}
345 \hyperlink{group__pf__fold_ga72d84525f0afd3a9d60d830a2f501fa5}{mean\-\_\-bp\-\_\-distance\-\_\-pr()}
348 \begin{DoxyParams}{Parameters}
352 \begin{DoxyReturn}{Returns}
353 mean base pair distance in thermodynamic ensemble
355 \hypertarget{group__pf__fold_ga72d84525f0afd3a9d60d830a2f501fa5}{\index{Calculating Partition Functions and Pair Probabilities@{Calculating Partition Functions and Pair Probabilities}!mean\-\_\-bp\-\_\-distance\-\_\-pr@{mean\-\_\-bp\-\_\-distance\-\_\-pr}}
356 \index{mean\-\_\-bp\-\_\-distance\-\_\-pr@{mean\-\_\-bp\-\_\-distance\-\_\-pr}!Calculating Partition Functions and Pair Probabilities@{Calculating Partition Functions and Pair Probabilities}}
357 \subsubsection[{mean\-\_\-bp\-\_\-distance\-\_\-pr}]{\setlength{\rightskip}{0pt plus 5cm}double mean\-\_\-bp\-\_\-distance\-\_\-pr (
358 \begin{DoxyParamCaption}
359 \item[{int}]{length, }
360 \item[{double $\ast$}]{pr}
361 \end{DoxyParamCaption}
362 )}}\label{group__pf__fold_ga72d84525f0afd3a9d60d830a2f501fa5}
365 Get the mean base pair distance in the thermodynamic ensemble.
367 This is a threadsafe implementation of \hyperlink{part__func_8h_ae9556ba7ded44fe2321b6f67c3fc02a3}{mean\-\_\-bp\-\_\-dist()} !
369 $<d> = \sum_{a,b} p_a p_b d(S_a,S_b)$\par
370 this can be computed from the pair probs $p_ij$ as\par
371 $<d> = \sum_{ij} p_{ij}(1-p_{ij})$
373 \begin{DoxyNote}{Note}
374 This function is threadsafe
377 \begin{DoxyParams}{Parameters}
378 {\em length} & The length of the sequence \\
380 {\em pr} & The matrix containing the base pair probabilities \\
383 \begin{DoxyReturn}{Returns}
384 The mean pair distance of the structure ensemble