1 \hypertarget{gquad_8h}{\section{gquad.\-h}
2 \label{gquad_8h}\index{/home/asherstnev/\-Projects/\-Java.\-projects/jabaws/secure-\/git/develop/binaries/src/\-Vienna\-R\-N\-A/\-H/gquad.\-h@{/home/asherstnev/\-Projects/\-Java.\-projects/jabaws/secure-\/git/develop/binaries/src/\-Vienna\-R\-N\-A/\-H/gquad.\-h}}
6 00001 \textcolor{preprocessor}{#ifndef \_\_VIENNA\_RNA\_PACKAGE\_GQUAD\_H\_\_}
7 00002 \textcolor{preprocessor}{}\textcolor{preprocessor}{#define \_\_VIENNA\_RNA\_PACKAGE\_GQUAD\_H\_\_}
8 00003 \textcolor{preprocessor}{}
9 00004 \textcolor{preprocessor}{#include "\hyperlink{data__structures_8h}{data\_structures.h}"}
11 00006 \textcolor{preprocessor}{#ifndef INLINE}
12 00007 \textcolor{preprocessor}{}\textcolor{preprocessor}{#ifdef \_\_GNUC\_\_}
13 00008 \textcolor{preprocessor}{}\textcolor{preprocessor}{# define INLINE inline}
14 00009 \textcolor{preprocessor}{}\textcolor{preprocessor}{#else}
15 00010 \textcolor{preprocessor}{}\textcolor{preprocessor}{# define INLINE}
16 00011 \textcolor{preprocessor}{}\textcolor{preprocessor}{#endif}
17 00012 \textcolor{preprocessor}{}\textcolor{preprocessor}{#endif}
18 00013 \textcolor{preprocessor}{}
19 00020 \textcolor{keywordtype}{int} E\_gquad(\textcolor{keywordtype}{int} L,
20 00021 \textcolor{keywordtype}{int} l[3],
21 00022 \hyperlink{structparamT}{paramT} *P);
23 00024 FLT\_OR\_DBL exp\_E\_gquad( \textcolor{keywordtype}{int} L,
24 00025 \textcolor{keywordtype}{int} l[3],
25 00026 \hyperlink{structpf__paramT}{pf\_paramT} *pf);
27 00028 \textcolor{keywordtype}{int} E\_gquad\_ali(\textcolor{keywordtype}{int} i,
28 00029 \textcolor{keywordtype}{int} L,
29 00030 \textcolor{keywordtype}{int} l[3],
30 00031 \textcolor{keyword}{const} \textcolor{keywordtype}{short} **S,
31 00032 \textcolor{keywordtype}{int} n\_seq,
32 00033 \hyperlink{structparamT}{paramT} *P);
35 00036 \textcolor{keywordtype}{void} E\_gquad\_ali\_en( \textcolor{keywordtype}{int} i,
36 00037 \textcolor{keywordtype}{int} L,
37 00038 \textcolor{keywordtype}{int} l[3],
38 00039 \textcolor{keyword}{const} \textcolor{keywordtype}{short} **S,
39 00040 \textcolor{keywordtype}{int} n\_seq,
40 00041 \textcolor{keywordtype}{int} en[2],
41 00042 \hyperlink{structparamT}{paramT} *P);
43 00060 \textcolor{keywordtype}{int} *\hyperlink{gquad_8h_a8b0784c14fa1208d0aebbebdc1318b7a}{get\_gquad\_matrix}(\textcolor{keywordtype}{short} *S, \hyperlink{structparamT}{paramT} *P);
45 00062 \textcolor{keywordtype}{int} *get\_gquad\_ali\_matrix(\textcolor{keywordtype}{short} *S\_cons,
46 00063 \textcolor{keywordtype}{short} **S,
47 00064 \textcolor{keywordtype}{int} n\_seq,
48 00065 \hyperlink{structparamT}{paramT} *P);
50 00067 FLT\_OR\_DBL *get\_gquad\_pf\_matrix( \textcolor{keywordtype}{short} *S,
51 00068 FLT\_OR\_DBL *scale,
52 00069 \hyperlink{structpf__paramT}{pf\_paramT} *pf);
54 00071 \textcolor{keywordtype}{int} **get\_gquad\_L\_matrix( \textcolor{keywordtype}{short} *S,
55 00072 \textcolor{keywordtype}{int} start,
56 00073 \textcolor{keywordtype}{int} maxdist,
57 00074 \textcolor{keywordtype}{int} **g,
58 00075 \hyperlink{structparamT}{paramT} *P);
60 00077 \textcolor{keywordtype}{void} get\_gquad\_pattern\_mfe(\textcolor{keywordtype}{short} *S,
61 00078 \textcolor{keywordtype}{int} i,
62 00079 \textcolor{keywordtype}{int} j,
63 00080 \hyperlink{structparamT}{paramT} *P,
64 00081 \textcolor{keywordtype}{int} *L,
65 00082 \textcolor{keywordtype}{int} l[3]);
67 00084 \textcolor{keywordtype}{void} get\_gquad\_pattern\_pf( \textcolor{keywordtype}{short} *S,
68 00085 \textcolor{keywordtype}{int} i,
69 00086 \textcolor{keywordtype}{int} j,
70 00087 \hyperlink{structpf__paramT}{pf\_paramT} *pf,
71 00088 \textcolor{keywordtype}{int} *L,
72 00089 \textcolor{keywordtype}{int} l[3]);
74 00091 \hyperlink{structplist}{plist} *get\_plist\_gquad\_from\_pr( \textcolor{keywordtype}{short} *S,
75 00092 \textcolor{keywordtype}{int} gi,
76 00093 \textcolor{keywordtype}{int} gj,
77 00094 FLT\_OR\_DBL *G,
78 00095 FLT\_OR\_DBL *probs,
79 00096 FLT\_OR\_DBL *scale,
80 00097 \hyperlink{structpf__paramT}{pf\_paramT} *pf);
81 00098 \hyperlink{structplist}{plist} *get\_plist\_gquad\_from\_pr\_max(\textcolor{keywordtype}{short} *S,
82 00099 \textcolor{keywordtype}{int} gi,
83 00100 \textcolor{keywordtype}{int} gj,
84 00101 FLT\_OR\_DBL *G,
85 00102 FLT\_OR\_DBL *probs,
86 00103 FLT\_OR\_DBL *scale,
87 00104 \textcolor{keywordtype}{int} *L,
88 00105 \textcolor{keywordtype}{int} l[3],
89 00106 \hyperlink{structpf__paramT}{pf\_paramT} *pf);
91 00108 \hyperlink{structplist}{plist} *get\_plist\_gquad\_from\_db( \textcolor{keyword}{const} \textcolor{keywordtype}{char} *structure,
92 00109 \textcolor{keywordtype}{float} pr);
94 00121 \textcolor{keywordtype}{int} \hyperlink{gquad_8h_ae41763215b9c64d2a7b67f0df8a28078}{parse\_gquad}(\textcolor{keyword}{const} \textcolor{keywordtype}{char} *struc, \textcolor{keywordtype}{int} *L, \textcolor{keywordtype}{int} l[3]);
98 \hypertarget{gquad_8h_source_l00142}{}\hyperlink{gquad_8h_a54475a8eb898fa1e8af8ab5f5375f3be}{00142} INLINE PRIVATE \textcolor{keywordtype}{int} \hyperlink{gquad_8h_a54475a8eb898fa1e8af8ab5f5375f3be}{backtrack\_GQuad\_IntLoop}(\textcolor{keywordtype}{int} c,
99 00143 \textcolor{keywordtype}{int} i,
100 00144 \textcolor{keywordtype}{int} j,
101 00145 \textcolor{keywordtype}{int} type,
102 00146 \textcolor{keywordtype}{short} *S,
103 00147 \textcolor{keywordtype}{int} *ggg,
104 00148 \textcolor{keywordtype}{int} *index,
105 00149 \textcolor{keywordtype}{int} *p,
106 00150 \textcolor{keywordtype}{int} *q,
107 00151 \hyperlink{structparamT}{paramT} *P)\{
109 00153 \textcolor{keywordtype}{int} energy, \hyperlink{fold__vars_8h_a72b511ed1201f7e23ec437e468790d74}{dangles}, k, l, maxl, minl, c0, l1;
110 00154 \textcolor{keywordtype}{short} si, sj;
112 00156 dangles = P->\hyperlink{structparamT_aeb912822ef912705bc202b14f9d71ad9}{model\_details}.\hyperlink{structmodel__detailsT_a89f9df217a4a7f4351a642655976376b}{dangles};
117 00161 \textcolor{keywordflow}{if}(dangles == 2)
118 00162 energy += P->mismatchI[type][si][sj];
120 00164 \textcolor{keywordflow}{if}(type > 2)
121 00165 energy += P->TerminalAU;
124 00168 \textcolor{keywordflow}{if}(S[k] == 3)\{
125 00169 \textcolor{keywordflow}{if}(k < j - VRNA\_GQUAD\_MIN\_BOX\_SIZE)\{
126 00170 minl = j - i + k - \hyperlink{energy__const_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP} - 2;
127 00171 c0 = k + VRNA\_GQUAD\_MIN\_BOX\_SIZE - 1;
128 00172 minl = \hyperlink{utils_8h_a33297b3679c713b0c4d897cd0fe3b122}{MAX2}(c0, minl);
130 00174 maxl = k + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;
131 00175 maxl = \hyperlink{utils_8h_ae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}(c0, maxl);
132 00176 \textcolor{keywordflow}{for}(l = minl; l < maxl; l++)\{
133 00177 \textcolor{keywordflow}{if}(S[l] != 3) \textcolor{keywordflow}{continue};
134 00178 \textcolor{keywordflow}{if}(c == energy + ggg[index[l] + k] + P->internal\_loop[j - l - 1])\{
135 00179 *p = k; *q = l;
136 00180 \textcolor{keywordflow}{return} 1;
142 00186 \textcolor{keywordflow}{for}(k = i + 2;
143 00187 k < j - VRNA\_GQUAD\_MIN\_BOX\_SIZE;
145 00189 l1 = k - i - 1;
146 00190 \textcolor{keywordflow}{if}(l1>\hyperlink{energy__const_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}) \textcolor{keywordflow}{break};
147 00191 \textcolor{keywordflow}{if}(S[k] != 3) \textcolor{keywordflow}{continue};
148 00192 minl = j - i + k - \hyperlink{energy__const_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP} - 2;
149 00193 c0 = k + VRNA\_GQUAD\_MIN\_BOX\_SIZE - 1;
150 00194 minl = \hyperlink{utils_8h_a33297b3679c713b0c4d897cd0fe3b122}{MAX2}(c0, minl);
152 00196 maxl = k + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;
153 00197 maxl = \hyperlink{utils_8h_ae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}(c0, maxl);
154 00198 \textcolor{keywordflow}{for}(l = minl; l < maxl; l++)\{
155 00199 \textcolor{keywordflow}{if}(S[l] != 3) \textcolor{keywordflow}{continue};
156 00200 \textcolor{keywordflow}{if}(c == energy + ggg[index[l] + k] + P->internal\_loop[l1 + j - l - 1])\{
157 00201 *p = k; *q = l;
158 00202 \textcolor{keywordflow}{return} 1;
164 00208 \textcolor{keywordflow}{if}(S[l] == 3)
165 00209 \textcolor{keywordflow}{for}(k = i + 4;
166 00210 k < j - VRNA\_GQUAD\_MIN\_BOX\_SIZE;
168 00212 l1 = k - i - 1;
169 00213 \textcolor{keywordflow}{if}(l1>\hyperlink{energy__const_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}) \textcolor{keywordflow}{break};
170 00214 \textcolor{keywordflow}{if}(S[k] != 3) \textcolor{keywordflow}{continue};
171 00215 \textcolor{keywordflow}{if}(c == energy + ggg[index[l] + k] + P->internal\_loop[l1])\{
172 00216 *p = k; *q = l;
173 00217 \textcolor{keywordflow}{return} 1;
177 00221 \textcolor{keywordflow}{return} 0;
180 \hypertarget{gquad_8h_source_l00240}{}\hyperlink{gquad_8h_a118ec7289f1936bd810be7fe50b98212}{00240} INLINE PRIVATE \textcolor{keywordtype}{int} \hyperlink{gquad_8h_a118ec7289f1936bd810be7fe50b98212}{backtrack\_GQuad\_IntLoop\_L}(\textcolor{keywordtype}{int} c,
181 00241 \textcolor{keywordtype}{int} i,
182 00242 \textcolor{keywordtype}{int} j,
183 00243 \textcolor{keywordtype}{int} type,
184 00244 \textcolor{keywordtype}{short} *S,
185 00245 \textcolor{keywordtype}{int} **ggg,
186 00246 \textcolor{keywordtype}{int} maxdist,
187 00247 \textcolor{keywordtype}{int} *p,
188 00248 \textcolor{keywordtype}{int} *q,
189 00249 \hyperlink{structparamT}{paramT} *P)\{
191 00251 \textcolor{keywordtype}{int} energy, \hyperlink{fold__vars_8h_a72b511ed1201f7e23ec437e468790d74}{dangles}, k, l, maxl, minl, c0, l1;
192 00252 \textcolor{keywordtype}{short} si, sj;
194 00254 dangles = P->\hyperlink{structparamT_aeb912822ef912705bc202b14f9d71ad9}{model\_details}.\hyperlink{structmodel__detailsT_a89f9df217a4a7f4351a642655976376b}{dangles};
199 00259 \textcolor{keywordflow}{if}(dangles == 2)
200 00260 energy += P->mismatchI[type][si][sj];
202 00262 \textcolor{keywordflow}{if}(type > 2)
203 00263 energy += P->TerminalAU;
206 00266 \textcolor{keywordflow}{if}(S[k] == 3)\{
207 00267 \textcolor{keywordflow}{if}(k < j - VRNA\_GQUAD\_MIN\_BOX\_SIZE)\{
208 00268 minl = j - i + k - \hyperlink{energy__const_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP} - 2;
209 00269 c0 = k + VRNA\_GQUAD\_MIN\_BOX\_SIZE - 1;
210 00270 minl = \hyperlink{utils_8h_a33297b3679c713b0c4d897cd0fe3b122}{MAX2}(c0, minl);
212 00272 maxl = k + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;
213 00273 maxl = \hyperlink{utils_8h_ae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}(c0, maxl);
214 00274 \textcolor{keywordflow}{for}(l = minl; l < maxl; l++)\{
215 00275 \textcolor{keywordflow}{if}(S[l] != 3) \textcolor{keywordflow}{continue};
216 00276 \textcolor{keywordflow}{if}(c == energy + ggg[k][l - k] + P->internal\_loop[j - l - 1])\{
217 00277 *p = k; *q = l;
218 00278 \textcolor{keywordflow}{return} 1;
224 00284 \textcolor{keywordflow}{for}(k = i + 2;
225 00285 k < j - VRNA\_GQUAD\_MIN\_BOX\_SIZE;
227 00287 l1 = k - i - 1;
228 00288 \textcolor{keywordflow}{if}(l1>\hyperlink{energy__const_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}) \textcolor{keywordflow}{break};
229 00289 \textcolor{keywordflow}{if}(S[k] != 3) \textcolor{keywordflow}{continue};
230 00290 minl = j - i + k - \hyperlink{energy__const_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP} - 2;
231 00291 c0 = k + VRNA\_GQUAD\_MIN\_BOX\_SIZE - 1;
232 00292 minl = \hyperlink{utils_8h_a33297b3679c713b0c4d897cd0fe3b122}{MAX2}(c0, minl);
234 00294 maxl = k + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;
235 00295 maxl = \hyperlink{utils_8h_ae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}(c0, maxl);
236 00296 \textcolor{keywordflow}{for}(l = minl; l < maxl; l++)\{
237 00297 \textcolor{keywordflow}{if}(S[l] != 3) \textcolor{keywordflow}{continue};
238 00298 \textcolor{keywordflow}{if}(c == energy + ggg[k][l - k] + P->internal\_loop[l1 + j - l - 1])\{
239 00299 *p = k; *q = l;
240 00300 \textcolor{keywordflow}{return} 1;
246 00306 \textcolor{keywordflow}{if}(S[l] == 3)
247 00307 \textcolor{keywordflow}{for}(k = i + 4;
248 00308 k < j - VRNA\_GQUAD\_MIN\_BOX\_SIZE;
250 00310 l1 = k - i - 1;
251 00311 \textcolor{keywordflow}{if}(l1>\hyperlink{energy__const_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP}) \textcolor{keywordflow}{break};
252 00312 \textcolor{keywordflow}{if}(S[k] != 3) \textcolor{keywordflow}{continue};
253 00313 \textcolor{keywordflow}{if}(c == energy + ggg[k][l - k] + P->internal\_loop[l1])\{
254 00314 *p = k; *q = l;
255 00315 \textcolor{keywordflow}{return} 1;
259 00319 \textcolor{keywordflow}{return} 0;
263 00323 \textcolor{keywordtype}{int}
264 00324 E\_GQuad\_IntLoop(\textcolor{keywordtype}{int} i,
265 00325 \textcolor{keywordtype}{int} j,
266 00326 \textcolor{keywordtype}{int} type,
267 00327 \textcolor{keywordtype}{short} *S,
268 00328 \textcolor{keywordtype}{int} *ggg,
269 00329 \textcolor{keywordtype}{int} *index,
270 00330 \hyperlink{structparamT}{paramT} *P)\{
272 00332 \textcolor{keywordtype}{int} energy, ge, en1, en2, \hyperlink{fold__vars_8h_a72b511ed1201f7e23ec437e468790d74}{dangles}, p, q, l1, minq, maxq;
273 00333 \textcolor{keywordtype}{int} c0, c1, c2, c3, up, d53, d5, d3;
274 00334 \textcolor{keywordtype}{short} si, sj;
276 00336 dangles = P->\hyperlink{structparamT_aeb912822ef912705bc202b14f9d71ad9}{model\_details}.\hyperlink{structmodel__detailsT_a89f9df217a4a7f4351a642655976376b}{dangles};
281 00341 \textcolor{keywordflow}{if}(dangles == 2)
282 00342 energy += P->mismatchI[type][si][sj];
284 00344 \textcolor{keywordflow}{if}(type > 2)
285 00345 energy += P->TerminalAU;
287 00347 ge = \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF};
290 00350 \textcolor{keywordflow}{if}(S[p] == 3)\{
291 00351 \textcolor{keywordflow}{if}(p < j - VRNA\_GQUAD\_MIN\_BOX\_SIZE)\{
292 00352 minq = j - i + p - \hyperlink{energy__const_8h_ad1bd6eabac419670ddd3c9ed82145988}{MAXLOOP} - 2;
293 00353 c0 = p + VRNA\_GQUAD\_MIN\_BOX\_SIZE - 1;
294 00354 minq = \hyperlink{utils_8h_a33297b3679c713b0c4d897cd0fe3b122}{MAX2}(c0, minq);
296 00356 maxq = p + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;
297 00357 maxq = \hyperlink{utils_8h_ae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}(c0, maxq);
298 00358 \textcolor{keywordflow}{for}(q = minq; q < maxq; q++)\{
299 00359 \textcolor{keywordflow}{if}(S[q] != 3) \textcolor{keywordflow}{continue};
300 00360 c0 = energy + ggg[index[q] + p] + P->internal\_loop[j - q - 1];
301 00361 ge = \hyperlink{utils_8h_ae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}(ge, c0);
306 00366 \textcolor{keywordflow}{for}(p = i + 2;
307 00367 p < j - VRNA\_GQUAD\_MIN\_BOX\_SIZE;
309 00369 l1 = p - i - 1;
310 00370 \textcolor{keywordflow}{if}(l1>MAXLOOP) \textcolor{keywordflow}{break};
311 00371 \textcolor{keywordflow}{if}(S[p] != 3) \textcolor{keywordflow}{continue};
312 00372 minq = j - i + p - MAXLOOP - 2;
313 00373 c0 = p + VRNA\_GQUAD\_MIN\_BOX\_SIZE - 1;
314 00374 minq = \hyperlink{utils_8h_a33297b3679c713b0c4d897cd0fe3b122}{MAX2}(c0, minq);
316 00376 maxq = p + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;
317 00377 maxq = \hyperlink{utils_8h_ae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}(c0, maxq);
318 00378 \textcolor{keywordflow}{for}(q = minq; q < maxq; q++)\{
319 00379 \textcolor{keywordflow}{if}(S[q] != 3) \textcolor{keywordflow}{continue};
320 00380 c0 = energy + ggg[index[q] + p] + P->internal\_loop[l1 + j - q - 1];
321 00381 ge = \hyperlink{utils_8h_ae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}(ge, c0);
326 00386 \textcolor{keywordflow}{if}(S[q] == 3)
327 00387 \textcolor{keywordflow}{for}(p = i + 4;
328 00388 p < j - VRNA\_GQUAD\_MIN\_BOX\_SIZE;
330 00390 l1 = p - i - 1;
331 00391 \textcolor{keywordflow}{if}(l1>MAXLOOP) \textcolor{keywordflow}{break};
332 00392 \textcolor{keywordflow}{if}(S[p] != 3) \textcolor{keywordflow}{continue};
333 00393 c0 = energy + ggg[index[q] + p] + P->internal\_loop[l1];
334 00394 ge = \hyperlink{utils_8h_ae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}(ge, c0);
337 00397 \textcolor{preprocessor}{#if 0}
338 00398 \textcolor{preprocessor}{} \textcolor{comment}{/* here comes the additional stuff for the odd dangle models */}
339 00399 \textcolor{keywordflow}{if}(dangles % 1)\{
340 00400 en1 = energy + P->dangle5[type][si];
341 00401 en2 = energy + P->dangle5[type][sj];
342 00402 en3 = energy + P->mismatchI[type][si][sj];
344 00404 \textcolor{comment}{/* first case with 5' dangle (i.e. j-1) onto enclosing pair */}
346 00406 \textcolor{keywordflow}{if}(S[p] == 3)\{
347 00407 \textcolor{keywordflow}{if}(p < j - VRNA\_GQUAD\_MIN\_BOX\_SIZE)\{
348 00408 minq = j - i + p - MAXLOOP - 2;
349 00409 c0 = p + VRNA\_GQUAD\_MIN\_BOX\_SIZE - 1;
350 00410 minq = \hyperlink{utils_8h_a33297b3679c713b0c4d897cd0fe3b122}{MAX2}(c0, minq);
352 00412 maxq = p + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;
353 00413 maxq = \hyperlink{utils_8h_ae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}(c0, maxq);
354 00414 \textcolor{keywordflow}{for}(q = minq; q < maxq; q++)\{
355 00415 \textcolor{keywordflow}{if}(S[q] != 3) \textcolor{keywordflow}{continue};
356 00416 c0 = en1 + ggg[index[q] + p] + P->internal\_loop[j - q - 1];
357 00417 ge = \hyperlink{utils_8h_ae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}(ge, c0);
362 00422 \textcolor{keywordflow}{for}(p = i + 2; p < j - VRNA\_GQUAD\_MIN\_BOX\_SIZE; p++)\{
363 00423 l1 = p - i - 1;
364 00424 \textcolor{keywordflow}{if}(l1>MAXLOOP) \textcolor{keywordflow}{break};
365 00425 \textcolor{keywordflow}{if}(S[p] != 3) \textcolor{keywordflow}{continue};
366 00426 minq = j - i + p - MAXLOOP - 2;
367 00427 c0 = p + VRNA\_GQUAD\_MIN\_BOX\_SIZE - 1;
368 00428 minq = \hyperlink{utils_8h_a33297b3679c713b0c4d897cd0fe3b122}{MAX2}(c0, minq);
370 00430 maxq = p + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;
371 00431 maxq = \hyperlink{utils_8h_ae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}(c0, maxq);
372 00432 \textcolor{keywordflow}{for}(q = minq; q < maxq; q++)\{
373 00433 \textcolor{keywordflow}{if}(S[q] != 3) \textcolor{keywordflow}{continue};
374 00434 c0 = en1 + ggg[index[q] + p] + P->internal\_loop[l1 + j - q - 1];
375 00435 ge = \hyperlink{utils_8h_ae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}(ge, c0);
380 00440 \textcolor{keywordflow}{if}(S[q] == 3)
381 00441 \textcolor{keywordflow}{for}(p = i + 4; p < j - VRNA\_GQUAD\_MIN\_BOX\_SIZE; p++)\{
382 00442 l1 = p - i - 1;
383 00443 \textcolor{keywordflow}{if}(l1>MAXLOOP) \textcolor{keywordflow}{break};
384 00444 \textcolor{keywordflow}{if}(S[p] != 3) \textcolor{keywordflow}{continue};
385 00445 c0 = en1 + ggg[index[q] + p] + P->internal\_loop[l1 + 1];
386 00446 ge = \hyperlink{utils_8h_ae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}(ge, c0);
389 00449 \textcolor{comment}{/* second case with 3' dangle (i.e. i+1) onto enclosing pair */}
392 00452 \textcolor{preprocessor}{#endif}
393 00453 \textcolor{preprocessor}{} \textcolor{keywordflow}{return} ge;
397 00457 \textcolor{keywordtype}{int}
398 00458 E\_GQuad\_IntLoop\_L(\textcolor{keywordtype}{int} i,
399 00459 \textcolor{keywordtype}{int} j,
400 00460 \textcolor{keywordtype}{int} type,
401 00461 \textcolor{keywordtype}{short} *S,
402 00462 \textcolor{keywordtype}{int} **ggg,
403 00463 \textcolor{keywordtype}{int} maxdist,
404 00464 \hyperlink{structparamT}{paramT} *P)\{
406 00466 \textcolor{keywordtype}{int} energy, ge, en1, en2, dangles, p, q, l1, minq, maxq;
407 00467 \textcolor{keywordtype}{int} c0, c1, c2, c3, up, d53, d5, d3;
408 00468 \textcolor{keywordtype}{short} si, sj;
410 00470 dangles = P->\hyperlink{structparamT_aeb912822ef912705bc202b14f9d71ad9}{model\_details}.\hyperlink{structmodel__detailsT_a89f9df217a4a7f4351a642655976376b}{dangles};
415 00475 \textcolor{keywordflow}{if}(dangles == 2)
416 00476 energy += P->mismatchI[type][si][sj];
418 00478 \textcolor{keywordflow}{if}(type > 2)
419 00479 energy += P->TerminalAU;
421 00481 ge = \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF};
424 00484 \textcolor{keywordflow}{if}(S[p] == 3)\{
425 00485 \textcolor{keywordflow}{if}(p < j - VRNA\_GQUAD\_MIN\_BOX\_SIZE)\{
426 00486 minq = j - i + p - MAXLOOP - 2;
427 00487 c0 = p + VRNA\_GQUAD\_MIN\_BOX\_SIZE - 1;
428 00488 minq = \hyperlink{utils_8h_a33297b3679c713b0c4d897cd0fe3b122}{MAX2}(c0, minq);
430 00490 maxq = p + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;
431 00491 maxq = \hyperlink{utils_8h_ae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}(c0, maxq);
432 00492 \textcolor{keywordflow}{for}(q = minq; q < maxq; q++)\{
433 00493 \textcolor{keywordflow}{if}(S[q] != 3) \textcolor{keywordflow}{continue};
434 00494 c0 = energy + ggg[p][q-p] + P->internal\_loop[j - q - 1];
435 00495 ge = \hyperlink{utils_8h_ae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}(ge, c0);
440 00500 \textcolor{keywordflow}{for}(p = i + 2;
441 00501 p < j - VRNA\_GQUAD\_MIN\_BOX\_SIZE;
443 00503 l1 = p - i - 1;
444 00504 \textcolor{keywordflow}{if}(l1>MAXLOOP) \textcolor{keywordflow}{break};
445 00505 \textcolor{keywordflow}{if}(S[p] != 3) \textcolor{keywordflow}{continue};
446 00506 minq = j - i + p - MAXLOOP - 2;
447 00507 c0 = p + VRNA\_GQUAD\_MIN\_BOX\_SIZE - 1;
448 00508 minq = \hyperlink{utils_8h_a33297b3679c713b0c4d897cd0fe3b122}{MAX2}(c0, minq);
450 00510 maxq = p + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;
451 00511 maxq = \hyperlink{utils_8h_ae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}(c0, maxq);
452 00512 \textcolor{keywordflow}{for}(q = minq; q < maxq; q++)\{
453 00513 \textcolor{keywordflow}{if}(S[q] != 3) \textcolor{keywordflow}{continue};
454 00514 c0 = energy + ggg[p][q - p] + P->internal\_loop[l1 + j - q - 1];
455 00515 ge = \hyperlink{utils_8h_ae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}(ge, c0);
460 00520 \textcolor{keywordflow}{if}(S[q] == 3)
461 00521 \textcolor{keywordflow}{for}(p = i + 4;
462 00522 p < j - VRNA\_GQUAD\_MIN\_BOX\_SIZE;
464 00524 l1 = p - i - 1;
465 00525 \textcolor{keywordflow}{if}(l1>MAXLOOP) \textcolor{keywordflow}{break};
466 00526 \textcolor{keywordflow}{if}(S[p] != 3) \textcolor{keywordflow}{continue};
467 00527 c0 = energy + ggg[p][q - p] + P->internal\_loop[l1];
468 00528 ge = \hyperlink{utils_8h_ae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}(ge, c0);
471 00531 \textcolor{keywordflow}{return} ge;
476 00536 exp\_E\_GQuad\_IntLoop(\textcolor{keywordtype}{int} i,
477 00537 \textcolor{keywordtype}{int} j,
478 00538 \textcolor{keywordtype}{int} type,
479 00539 \textcolor{keywordtype}{short} *S,
480 00540 FLT\_OR\_DBL *G,
481 00541 \textcolor{keywordtype}{int} *index,
482 00542 \hyperlink{structpf__paramT}{pf\_paramT} *pf)\{
484 00544 \textcolor{keywordtype}{int} k, l, minl, maxl, u, r;
485 00545 FLT\_OR\_DBL q, qe, *expintern;
486 00546 \textcolor{keywordtype}{short} si, sj;
491 00551 qe = pf->expmismatchI[type][si][sj];
492 00552 expintern = pf->expinternal;
494 00554 \textcolor{keywordflow}{if}(type > 2)
495 00555 qe *= pf->expTermAU;
498 00558 \textcolor{keywordflow}{if}(S[k] == 3)\{
499 00559 \textcolor{keywordflow}{if}(k < j - VRNA\_GQUAD\_MIN\_BOX\_SIZE)\{
500 00560 minl = j - i + k - MAXLOOP - 2;
501 00561 u = k + VRNA\_GQUAD\_MIN\_BOX\_SIZE - 1;
502 00562 minl = \hyperlink{utils_8h_a33297b3679c713b0c4d897cd0fe3b122}{MAX2}(u, minl);
504 00564 maxl = k + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;
505 00565 maxl = \hyperlink{utils_8h_ae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}(u, maxl);
506 00566 \textcolor{keywordflow}{for}(l = minl; l < maxl; l++)\{
507 00567 \textcolor{keywordflow}{if}(S[l] != 3) \textcolor{keywordflow}{continue};
508 00568 q += qe * G[index[k]-l] * expintern[j - l - 1];
514 00574 \textcolor{keywordflow}{for}(k = i + 2;
515 00575 k <= j - VRNA\_GQUAD\_MIN\_BOX\_SIZE;
518 00578 \textcolor{keywordflow}{if}(u > MAXLOOP) \textcolor{keywordflow}{break};
519 00579 \textcolor{keywordflow}{if}(S[k] != 3) \textcolor{keywordflow}{continue};
520 00580 minl = j - i + k - MAXLOOP - 2;
521 00581 r = k + VRNA\_GQUAD\_MIN\_BOX\_SIZE - 1;
522 00582 minl = \hyperlink{utils_8h_a33297b3679c713b0c4d897cd0fe3b122}{MAX2}(r, minl);
523 00583 maxl = k + VRNA\_GQUAD\_MAX\_BOX\_SIZE + 1;
525 00585 maxl = \hyperlink{utils_8h_ae0b9cd0ce090bd69b951aa73e8fa4f7d}{MIN2}(r, maxl);
526 00586 \textcolor{keywordflow}{for}(l = minl; l < maxl; l++)\{
527 00587 \textcolor{keywordflow}{if}(S[l] != 3) \textcolor{keywordflow}{continue};
528 00588 q += qe * G[index[k]-l] * expintern[u + j - l - 1];
533 00593 \textcolor{keywordflow}{if}(S[l] == 3)
534 00594 \textcolor{keywordflow}{for}(k = i + 4; k < j - VRNA\_GQUAD\_MIN\_BOX\_SIZE; k++)\{
536 00596 \textcolor{keywordflow}{if}(u>MAXLOOP) \textcolor{keywordflow}{break};
537 00597 \textcolor{keywordflow}{if}(S[k] != 3) \textcolor{keywordflow}{continue};
538 00598 q += qe * G[index[k]-l] * expintern[u];
541 00601 \textcolor{keywordflow}{return} q;
544 00604 \textcolor{preprocessor}{#endif}