1 \hypertarget{loop__energies_8h}{\section{/home/asherstnev/\-Projects/\-Java.projects/jabaws/secure-\/git/develop/binaries/src/\-Vienna\-R\-N\-A/\-H/loop\-\_\-energies.h File Reference}
2 \label{loop__energies_8h}\index{/home/asherstnev/\-Projects/\-Java.\-projects/jabaws/secure-\/git/develop/binaries/src/\-Vienna\-R\-N\-A/\-H/loop\-\_\-energies.\-h@{/home/asherstnev/\-Projects/\-Java.\-projects/jabaws/secure-\/git/develop/binaries/src/\-Vienna\-R\-N\-A/\-H/loop\-\_\-energies.\-h}}
6 Energy evaluation for M\-F\-E and partition function calculations.
9 Include dependency graph for loop\-\_\-energies.\-h\-:
14 \includegraphics[width=350pt]{loop__energies_8h__incl}
17 \subsection*{Functions}
18 \begin{DoxyCompactItemize}
20 P\-R\-I\-V\-A\-T\-E int \hyperlink{loop__energies_8h_a3e5ad89f451254b1fe366d77aa8ff7bd}{E\-\_\-\-Int\-Loop} (int n1, int n2, int type, int type\-\_\-2, int si1, int sj1, int sp1, int sq1, \hyperlink{structparamT}{param\-T} $\ast$P)
22 P\-R\-I\-V\-A\-T\-E int \hyperlink{loop__energies_8h_aa362183cf6db89a10cdb0f5c4bd180c6}{E\-\_\-\-Hairpin} (int size, int type, int si1, int sj1, const char $\ast$string, \hyperlink{structparamT}{param\-T} $\ast$P)
24 P\-R\-I\-V\-A\-T\-E int \hyperlink{loop__energies_8h_af5a6594eba9b2622cb47076650c69819}{E\-\_\-\-Stem} (int type, int si1, int sj1, int ext\-Loop, \hyperlink{structparamT}{param\-T} $\ast$P)
26 P\-R\-I\-V\-A\-T\-E double \hyperlink{loop__energies_8h_a76cc24ec96199e04beddad13e7891e21}{exp\-\_\-\-E\-\_\-\-Stem} (int type, int si1, int sj1, int ext\-Loop, \hyperlink{structpf__paramT}{pf\-\_\-param\-T} $\ast$P)
28 P\-R\-I\-V\-A\-T\-E double \hyperlink{loop__energies_8h_a0e128184bb097dc2da33706f33b555a6}{exp\-\_\-\-E\-\_\-\-Hairpin} (int u, int type, short si1, short sj1, const char $\ast$string, \hyperlink{structpf__paramT}{pf\-\_\-param\-T} $\ast$P)
30 P\-R\-I\-V\-A\-T\-E double \hyperlink{loop__energies_8h_aa5e98e524e2a41e290b942b09544bc9e}{exp\-\_\-\-E\-\_\-\-Int\-Loop} (int u1, int u2, int type, int type2, short si1, short sj1, short sp1, short sq1, \hyperlink{structpf__paramT}{pf\-\_\-param\-T} $\ast$P)
31 \end{DoxyCompactItemize}
34 \subsection{Detailed Description}
35 Energy evaluation for M\-F\-E and partition function calculations. This file contains functions for the calculation of the free energy $\Delta G$ of a hairpin-\/ \mbox{[} \hyperlink{loop__energies_8h_aa362183cf6db89a10cdb0f5c4bd180c6}{E\-\_\-\-Hairpin()} \mbox{]} or interior-\/loop \mbox{[} \hyperlink{loop__energies_8h_a3e5ad89f451254b1fe366d77aa8ff7bd}{E\-\_\-\-Int\-Loop()}\mbox{]} .\par
36 The unit of the free energy returned is $10^{-2} * \mathrm{kcal}/\mathrm{mol}$
38 In case of computing the partition function, this file also supplies functions which return the Boltzmann weights $e^{-\Delta G/kT} $ for a hairpin-\/ \mbox{[} \hyperlink{loop__energies_8h_a0e128184bb097dc2da33706f33b555a6}{exp\-\_\-\-E\-\_\-\-Hairpin()} \mbox{]} or interior-\/loop \mbox{[} \hyperlink{loop__energies_8h_aa5e98e524e2a41e290b942b09544bc9e}{exp\-\_\-\-E\-\_\-\-Int\-Loop()} \mbox{]}.
40 \subsection{Function Documentation}
41 \hypertarget{loop__energies_8h_a3e5ad89f451254b1fe366d77aa8ff7bd}{\index{loop\-\_\-energies.\-h@{loop\-\_\-energies.\-h}!E\-\_\-\-Int\-Loop@{E\-\_\-\-Int\-Loop}}
42 \index{E\-\_\-\-Int\-Loop@{E\-\_\-\-Int\-Loop}!loop_energies.h@{loop\-\_\-energies.\-h}}
43 \subsubsection[{E\-\_\-\-Int\-Loop}]{\setlength{\rightskip}{0pt plus 5cm}P\-R\-I\-V\-A\-T\-E int E\-\_\-\-Int\-Loop (
44 \begin{DoxyParamCaption}
48 \item[{int}]{type\-\_\-2, }
53 \item[{{\bf param\-T} $\ast$}]{P}
54 \end{DoxyParamCaption}
55 )}}\label{loop__energies_8h_a3e5ad89f451254b1fe366d77aa8ff7bd}
56 \subsubsection*{Compute the Energy of an interior-\/loop}
58 This function computes the free energy $\Delta G$ of an interior-\/loop with the following structure\-: \par
73 This general structure depicts an interior-\/loop that is closed by the base pair (X,Y). The enclosed base pair is (V,U) which leaves the unpaired bases a\-\_\-1-\/a\-\_\-n and b\-\_\-1-\/b\-\_\-n that constitute the loop. In this example, the length of the interior-\/loop is $(n+m)$ where n or m may be 0 resulting in a bulge-\/loop or base pair stack. The mismatching nucleotides for the closing pair (X,Y) are\-:\par
74 5'-\/mismatch\-: a\-\_\-1\par
75 3'-\/mismatch\-: b\-\_\-m\par
76 and for the enclosed base pair (V,U)\-:\par
77 5'-\/mismatch\-: b\-\_\-1\par
78 3'-\/mismatch\-: a\-\_\-n\par
79 \begin{DoxyNote}{Note}
80 Base pairs are always denoted in 5'-\/$>$3' direction. Thus the enclosed base pair must be 'turned arround' when evaluating the free energy of the interior-\/loop
82 \begin{DoxySeeAlso}{See Also}
83 \hyperlink{group__energy__parameters_ga527ef619cd8210b84d5d53be1e0e29b6}{scale\-\_\-parameters()}
85 \hyperlink{structparamT}{param\-T}
87 \begin{DoxyNote}{Note}
88 This function is threadsafe
91 \begin{DoxyParams}{Parameters}
92 {\em n1} & The size of the 'left'-\/loop (number of unpaired nucleotides) \\
94 {\em n2} & The size of the 'right'-\/loop (number of unpaired nucleotides) \\
96 {\em type} & The pair type of the base pair closing the interior loop \\
98 {\em type\-\_\-2} & The pair type of the enclosed base pair \\
100 {\em si1} & The 5'-\/mismatching nucleotide of the closing pair \\
102 {\em sj1} & The 3'-\/mismatching nucleotide of the closing pair \\
104 {\em sp1} & The 3'-\/mismatching nucleotide of the enclosed pair \\
106 {\em sq1} & The 5'-\/mismatching nucleotide of the enclosed pair \\
108 {\em P} & The datastructure containing scaled energy parameters \\
111 \begin{DoxyReturn}{Returns}
112 The Free energy of the Interior-\/loop in dcal/mol
114 \hypertarget{loop__energies_8h_aa362183cf6db89a10cdb0f5c4bd180c6}{\index{loop\-\_\-energies.\-h@{loop\-\_\-energies.\-h}!E\-\_\-\-Hairpin@{E\-\_\-\-Hairpin}}
115 \index{E\-\_\-\-Hairpin@{E\-\_\-\-Hairpin}!loop_energies.h@{loop\-\_\-energies.\-h}}
116 \subsubsection[{E\-\_\-\-Hairpin}]{\setlength{\rightskip}{0pt plus 5cm}P\-R\-I\-V\-A\-T\-E int E\-\_\-\-Hairpin (
117 \begin{DoxyParamCaption}
122 \item[{const char $\ast$}]{string, }
123 \item[{{\bf param\-T} $\ast$}]{P}
124 \end{DoxyParamCaption}
125 )}}\label{loop__energies_8h_aa362183cf6db89a10cdb0f5c4bd180c6}
126 \subsubsection*{Compute the Energy of a hairpin-\/loop}
128 To evaluate the free energy of a hairpin-\/loop, several parameters have to be known. A general hairpin-\/loop has this structure\-:\par
138 where X-\/\-Y marks the closing pair \mbox{[}e.\-g. a {\bfseries (G,C)} pair\mbox{]}. The length of this loop is 6 as there are six unpaired nucleotides (a1-\/a6) enclosed by (X,Y). The 5' mismatching nucleotide is a1 while the 3' mismatch is a6. The nucleotide sequence of this loop is "a1.\-a2.\-a3.\-a4.\-a5.\-a6" \par
139 \begin{DoxyNote}{Note}
140 The parameter sequence should contain the sequence of the loop in capital letters of the nucleic acid alphabet if the loop size is below 7. This is useful for unusually stable tri-\/, tetra-\/ and hexa-\/loops which are treated differently (based on experimental data) if they are tabulated.
142 \begin{DoxySeeAlso}{See Also}
143 \hyperlink{group__energy__parameters_ga527ef619cd8210b84d5d53be1e0e29b6}{scale\-\_\-parameters()}
145 \hyperlink{structparamT}{param\-T}
147 \begin{DoxyWarning}{Warning}
148 Not (really) thread safe! A threadsafe implementation will replace this function in a future release!\par
149 Energy evaluation may change due to updates in global variable \char`\"{}tetra\-\_\-loop\char`\"{}
152 \begin{DoxyParams}{Parameters}
153 {\em size} & The size of the loop (number of unpaired nucleotides) \\
155 {\em type} & The pair type of the base pair closing the hairpin \\
157 {\em si1} & The 5'-\/mismatching nucleotide \\
159 {\em sj1} & The 3'-\/mismatching nucleotide \\
161 {\em string} & The sequence of the loop \\
163 {\em P} & The datastructure containing scaled energy parameters \\
166 \begin{DoxyReturn}{Returns}
167 The Free energy of the Hairpin-\/loop in dcal/mol
169 \hypertarget{loop__energies_8h_af5a6594eba9b2622cb47076650c69819}{\index{loop\-\_\-energies.\-h@{loop\-\_\-energies.\-h}!E\-\_\-\-Stem@{E\-\_\-\-Stem}}
170 \index{E\-\_\-\-Stem@{E\-\_\-\-Stem}!loop_energies.h@{loop\-\_\-energies.\-h}}
171 \subsubsection[{E\-\_\-\-Stem}]{\setlength{\rightskip}{0pt plus 5cm}P\-R\-I\-V\-A\-T\-E int E\-\_\-\-Stem (
172 \begin{DoxyParamCaption}
176 \item[{int}]{ext\-Loop, }
177 \item[{{\bf param\-T} $\ast$}]{P}
178 \end{DoxyParamCaption}
179 )}}\label{loop__energies_8h_af5a6594eba9b2622cb47076650c69819}
180 \subsubsection*{Compute the energy contribution of a stem branching off a loop-\/region}
182 This function computes the energy contribution of a stem that branches off a loop region. This can be the case in multiloops, when a stem branching off increases the degree of the loop but also {\itshape immediately interior base pairs} of an exterior loop contribute free energy. To switch the bahavior of the function according to the evaluation of a multiloop-\/ or exterior-\/loop-\/stem, you pass the flag 'ext\-Loop'. The returned energy contribution consists of a Terminal\-A\-U penalty if the pair type is greater than 2, dangling end contributions of mismatching nucleotides adjacent to the stem if only one of the si1, sj1 parameters is greater than 0 and mismatch energies if both mismatching nucleotides are positive values. Thus, to avoid incooperating dangling end or mismatch energies just pass a negative number, e.\-g. -\/1 to the mismatch argument.
184 This is an illustration of how the energy contribution is assembled\-:
193 Here, (X,Y) is the base pair that closes the stem that branches off a loop region. The nucleotides si1 and sj1 are the 5'-\/ and 3'-\/ mismatches, respectively. If the base pair type of (X,Y) is greater than 2 (i.\-e. an A-\/\-U or G-\/\-U pair, the Terminal\-A\-U penalty will be included in the energy contribution returned. If si1 and sj1 are both nonnegative numbers, mismatch energies will also be included. If one of sij or sj1 is a negtive value, only 5' or 3' dangling end contributions are taken into account. To prohibit any of these mismatch contributions to be incoorporated, just pass a negative number to both, si1 and sj1. In case the argument ext\-Loop is 0, the returned energy contribution also includes the {\itshape internal-\/loop-\/penalty} of a multiloop stem with closing pair type.
195 \begin{DoxySeeAlso}{See Also}
200 \begin{DoxyNote}{Note}
201 This function is threadsafe
204 \begin{DoxyParams}{Parameters}
205 {\em type} & The pair type of the first base pair un the stem \\
207 {\em si1} & The 5'-\/mismatching nucleotide \\
209 {\em sj1} & The 3'-\/mismatching nucleotide \\
211 {\em ext\-Loop} & A flag that indicates whether the contribution reflects the one of an exterior loop or not \\
213 {\em P} & The datastructure containing scaled energy parameters \\
216 \begin{DoxyReturn}{Returns}
217 The Free energy of the branch off the loop in dcal/mol
219 \hypertarget{loop__energies_8h_a76cc24ec96199e04beddad13e7891e21}{\index{loop\-\_\-energies.\-h@{loop\-\_\-energies.\-h}!exp\-\_\-\-E\-\_\-\-Stem@{exp\-\_\-\-E\-\_\-\-Stem}}
220 \index{exp\-\_\-\-E\-\_\-\-Stem@{exp\-\_\-\-E\-\_\-\-Stem}!loop_energies.h@{loop\-\_\-energies.\-h}}
221 \subsubsection[{exp\-\_\-\-E\-\_\-\-Stem}]{\setlength{\rightskip}{0pt plus 5cm}P\-R\-I\-V\-A\-T\-E double exp\-\_\-\-E\-\_\-\-Stem (
222 \begin{DoxyParamCaption}
226 \item[{int}]{ext\-Loop, }
227 \item[{{\bf pf\-\_\-param\-T} $\ast$}]{P}
228 \end{DoxyParamCaption}
229 )}}\label{loop__energies_8h_a76cc24ec96199e04beddad13e7891e21}
230 \subsubsection*{Compute the Boltzmann weighted energy contribution of a stem branching off a loop-\/region}
232 This is the partition function variant of \hyperlink{loop__energies_8h_af5a6594eba9b2622cb47076650c69819}{E\-\_\-\-Stem()} \begin{DoxySeeAlso}{See Also}
233 \hyperlink{loop__energies_8h_af5a6594eba9b2622cb47076650c69819}{E\-\_\-\-Stem()}
235 \begin{DoxyNote}{Note}
236 This function is threadsafe
238 \begin{DoxyReturn}{Returns}
239 The Boltzmann weighted energy contribution of the branch off the loop
241 \hypertarget{loop__energies_8h_a0e128184bb097dc2da33706f33b555a6}{\index{loop\-\_\-energies.\-h@{loop\-\_\-energies.\-h}!exp\-\_\-\-E\-\_\-\-Hairpin@{exp\-\_\-\-E\-\_\-\-Hairpin}}
242 \index{exp\-\_\-\-E\-\_\-\-Hairpin@{exp\-\_\-\-E\-\_\-\-Hairpin}!loop_energies.h@{loop\-\_\-energies.\-h}}
243 \subsubsection[{exp\-\_\-\-E\-\_\-\-Hairpin}]{\setlength{\rightskip}{0pt plus 5cm}P\-R\-I\-V\-A\-T\-E double exp\-\_\-\-E\-\_\-\-Hairpin (
244 \begin{DoxyParamCaption}
247 \item[{short}]{si1, }
248 \item[{short}]{sj1, }
249 \item[{const char $\ast$}]{string, }
250 \item[{{\bf pf\-\_\-param\-T} $\ast$}]{P}
251 \end{DoxyParamCaption}
252 )}}\label{loop__energies_8h_a0e128184bb097dc2da33706f33b555a6}
253 \subsubsection*{Compute Boltzmann weight $e^{-\Delta G/kT} $ of a hairpin loop}
255 multiply by scale\mbox{[}u+2\mbox{]} \begin{DoxySeeAlso}{See Also}
256 \hyperlink{group__energy__parameters_gab85f6b6da051f380371deb0d8921bdba}{get\-\_\-scaled\-\_\-pf\-\_\-parameters()}
258 \hyperlink{structpf__paramT}{pf\-\_\-param\-T}
260 \hyperlink{loop__energies_8h_aa362183cf6db89a10cdb0f5c4bd180c6}{E\-\_\-\-Hairpin()}
262 \begin{DoxyWarning}{Warning}
263 Not (really) thread safe! A threadsafe implementation will replace this function in a future release!\par
264 Energy evaluation may change due to updates in global variable \char`\"{}tetra\-\_\-loop\char`\"{}
267 \begin{DoxyParams}{Parameters}
268 {\em u} & The size of the loop (number of unpaired nucleotides) \\
270 {\em type} & The pair type of the base pair closing the hairpin \\
272 {\em si1} & The 5'-\/mismatching nucleotide \\
274 {\em sj1} & The 3'-\/mismatching nucleotide \\
276 {\em string} & The sequence of the loop \\
278 {\em P} & The datastructure containing scaled Boltzmann weights of the energy parameters \\
281 \begin{DoxyReturn}{Returns}
282 The Boltzmann weight of the Hairpin-\/loop
284 \hypertarget{loop__energies_8h_aa5e98e524e2a41e290b942b09544bc9e}{\index{loop\-\_\-energies.\-h@{loop\-\_\-energies.\-h}!exp\-\_\-\-E\-\_\-\-Int\-Loop@{exp\-\_\-\-E\-\_\-\-Int\-Loop}}
285 \index{exp\-\_\-\-E\-\_\-\-Int\-Loop@{exp\-\_\-\-E\-\_\-\-Int\-Loop}!loop_energies.h@{loop\-\_\-energies.\-h}}
286 \subsubsection[{exp\-\_\-\-E\-\_\-\-Int\-Loop}]{\setlength{\rightskip}{0pt plus 5cm}P\-R\-I\-V\-A\-T\-E double exp\-\_\-\-E\-\_\-\-Int\-Loop (
287 \begin{DoxyParamCaption}
291 \item[{int}]{type2, }
292 \item[{short}]{si1, }
293 \item[{short}]{sj1, }
294 \item[{short}]{sp1, }
295 \item[{short}]{sq1, }
296 \item[{{\bf pf\-\_\-param\-T} $\ast$}]{P}
297 \end{DoxyParamCaption}
298 )}}\label{loop__energies_8h_aa5e98e524e2a41e290b942b09544bc9e}
299 \subsubsection*{Compute Boltzmann weight $e^{-\Delta G/kT} $ of interior loop}
301 multiply by scale\mbox{[}u1+u2+2\mbox{]} for scaling \begin{DoxySeeAlso}{See Also}
302 \hyperlink{group__energy__parameters_gab85f6b6da051f380371deb0d8921bdba}{get\-\_\-scaled\-\_\-pf\-\_\-parameters()}
304 \hyperlink{structpf__paramT}{pf\-\_\-param\-T}
306 \hyperlink{loop__energies_8h_a3e5ad89f451254b1fe366d77aa8ff7bd}{E\-\_\-\-Int\-Loop()}
308 \begin{DoxyNote}{Note}
309 This function is threadsafe
312 \begin{DoxyParams}{Parameters}
313 {\em u1} & The size of the 'left'-\/loop (number of unpaired nucleotides) \\
315 {\em u2} & The size of the 'right'-\/loop (number of unpaired nucleotides) \\
317 {\em type} & The pair type of the base pair closing the interior loop \\
319 {\em type2} & The pair type of the enclosed base pair \\
321 {\em si1} & The 5'-\/mismatching nucleotide of the closing pair \\
323 {\em sj1} & The 3'-\/mismatching nucleotide of the closing pair \\
325 {\em sp1} & The 3'-\/mismatching nucleotide of the enclosed pair \\
327 {\em sq1} & The 5'-\/mismatching nucleotide of the enclosed pair \\
329 {\em P} & The datastructure containing scaled Boltzmann weights of the energy parameters \\
332 \begin{DoxyReturn}{Returns}
333 The Boltzmann weight of the Interior-\/loop