Add missing doc files
[jabaws.git] / binaries / src / ViennaRNA / doc / latex / mainpage_8h_source.tex
1 \hypertarget{mainpage_8h_source}{\section{mainpage.\-h}
2 }
3
4 \begin{DoxyCode}
5 00001 \textcolor{comment}{/*}
6 00002 \textcolor{comment}{#############################################################}
7 00003 \textcolor{comment}{# The next comment is used to order the modules correctly   #}
8 00004 \textcolor{comment}{#############################################################}
9 00005 \textcolor{comment}{*/}
10 00006 
11 00108 \textcolor{comment}{/*}
12 00109 \textcolor{comment}{#############################################################}
13 00110 \textcolor{comment}{# Now the mainpage text is following                        #}
14 00111 \textcolor{comment}{#############################################################}
15 00112 \textcolor{comment}{*/}
16 00113 
17 00327    \{   0,   2,   2,   2,   2,   1,   1\},   \textcolor{comment}{/* Null replaced */}
18 00328    \{   2,   0,   2,   2,   2, \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF}, \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF}\},   \textcolor{comment}{/* H    replaced */}
19 00329    \{   2,   2,   0,   1,   2, \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF}, \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF}\},   \textcolor{comment}{/* B    replaced */}
20 00330    \{   2,   2,   1,   0,   2, \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF}, \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF}\},   \textcolor{comment}{/* I    replaced */}
21 00331    \{   2,   2,   2,   2,   0, \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF}, \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF}\},   \textcolor{comment}{/* M    replaced */}
22 00332    \{   1, \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF}, \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF}, \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF}, \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF},   0, INF\},   \textcolor{comment}{/* S    replaced */}
23 00333    \{   1, \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF}, \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF}, \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF}, \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF}, \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF},   0\},   \textcolor{comment}{/* E    replaced */}
24 00334 
25 00335 
26 00336 \textcolor{comment}{/* Null,   H,   B,   I,   M,   S,   E   */}
27 00337    \{   0, 100,   5,   5,  75,   5,   5\},   \textcolor{comment}{/* Null replaced */}
28 00338    \{ 100,   0,   8,   8,   8, \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF}, \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF}\},   \textcolor{comment}{/* H    replaced */}
29 00339    \{   5,   8,   0,   3,   8, \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF}, \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF}\},   \textcolor{comment}{/* B    replaced */}
30 00340    \{   5,   8,   3,   0,   8, \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF}, \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF}\},   \textcolor{comment}{/* I    replaced */}
31 00341    \{  75,   8,   8,   8,   0, \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF}, \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF}\},   \textcolor{comment}{/* M    replaced */}
32 00342    \{   5, \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF}, \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF}, \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF}, \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF},   0, INF\},   \textcolor{comment}{/* S    replaced */}
33 00343    \{   5, \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF}, \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF}, \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF}, \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF}, \hyperlink{energy__const_8h_a12c2040f25d8e3a7b9e1c2024c618cb6}{INF},   0\},   \textcolor{comment}{/* E    replaced */}
34 00344 \(\backslash\)endverbatim
35 00345 
36 00346 The lower matrix uses the costs given in \(\backslash\)cite shapiro:1990.
37 00347 All distance functions use the following global variables:
38 00348 
39 00349 \(\backslash\)verbatim
40 00350 \textcolor{keywordtype}{int}  \hyperlink{dist__vars_8h_ab65d8ff14c6937612212526a60f59b3c}{cost\_matrix};
41 00351 \(\backslash\)endverbatim
42 00352 \(\backslash\)copybrief cost\_matrix
43 00353 
44 00354 \(\backslash\)verbatim
45 00355 \textcolor{keywordtype}{int}   \hyperlink{dist__vars_8h_aa03194c513af6b860e7b33e370b82bdb}{edit\_backtrack};
46 00356 \(\backslash\)endverbatim
47 00357 \(\backslash\)copybrief edit\_backtrack
48 00358 
49 00359 \(\backslash\)verbatim
50 00360 \textcolor{keywordtype}{char} *\hyperlink{dist__vars_8h_ac1605fe3448ad0a0b809c4fb8f6a854a}{aligned\_line}[4];
51 00361 \(\backslash\)endverbatim
52 00362 \(\backslash\)copybrief aligned\_line
53 00363 
54 00364 \(\backslash\)see utils.h, dist\_vars.h and stringdist.h \textcolor{keywordflow}{for} more details
55 00365 
56 00366 <h3>Functions \textcolor{keywordflow}{for} \hyperlink{structTree}{Tree} Edit Distances</h3>
57 00367 
58 00368 \(\backslash\)verbatim
59 00369 \hyperlink{structTree}{Tree}   *\hyperlink{treedist_8h_a08fe4d5afd385dce593b86eaf010c6e3}{make\_tree} (\textcolor{keywordtype}{char} *struc)
60 00370 \(\backslash\)endverbatim
61 00371 \(\backslash\)copybrief \hyperlink{treedist_8h_a08fe4d5afd385dce593b86eaf010c6e3}{make\_tree}()
62 00372 
63 00373 \(\backslash\)verbatim
64 00374 \textcolor{keywordtype}{float}   \hyperlink{treedist_8h_a3b21f1925f7071f46d93431a835217bb}{tree\_edit\_distance} (\hyperlink{structTree}{Tree} *T1,
65 00375                             \hyperlink{structTree}{Tree} *T2) 
66 00376 \(\backslash\)endverbatim
67 00377 \(\backslash\)copybrief \hyperlink{treedist_8h_a3b21f1925f7071f46d93431a835217bb}{tree\_edit\_distance}()
68 00378 
69 00379 \(\backslash\)verbatim
70 00380 \textcolor{keywordtype}{void}    \hyperlink{treedist_8h_acbc1cb9bce582ea945e4a467c76a57aa}{free\_tree}(\hyperlink{structTree}{Tree} *t)
71 00381 \(\backslash\)endverbatim
72 00382 \(\backslash\)copybrief \hyperlink{treedist_8h_acbc1cb9bce582ea945e4a467c76a57aa}{free\_tree}()
73 00383 
74 00384 \(\backslash\)see dist\_vars.h and treedist.h \textcolor{keywordflow}{for} prototypes and more detailed descriptions
75 00385 
76 00386 <h3>Functions \textcolor{keywordflow}{for} String Alignment</h3>
77 00387 
78 00388 \(\backslash\)verbatim
79 00389 \hyperlink{structswString}{swString} *\hyperlink{stringdist_8h_a3125991b3a403b3f89230474deb3f22e}{Make\_swString} (\textcolor{keywordtype}{char} *\textcolor{keywordtype}{string})
80 00390 \(\backslash\)endverbatim
81 00391 \(\backslash\)copybrief \hyperlink{stringdist_8h_a3125991b3a403b3f89230474deb3f22e}{Make\_swString}()
82 00392 
83 00393 \(\backslash\)verbatim
84 00394 \textcolor{keywordtype}{float}     \hyperlink{stringdist_8h_a89e3c335ef17780576d7c0e713830db9}{string\_edit\_distance} (\hyperlink{structswString}{swString} *T1,
85 00395                                 \hyperlink{structswString}{swString} *T2)
86 00396 \(\backslash\)endverbatim
87 00397 \(\backslash\)copybrief \hyperlink{stringdist_8h_a89e3c335ef17780576d7c0e713830db9}{string\_edit\_distance}()
88 00398 
89 00399 \(\backslash\)see dist\_vars.h and stringdist.h \textcolor{keywordflow}{for} prototypes and more detailed descriptions
90 00400 
91 00401 <h3>Functions \textcolor{keywordflow}{for} Comparison of Base Pair Probabilities</h3>
92 00402 
93 00403 For comparison of base pair probability matrices, the matrices are first
94 00404 condensed into probability profiles which are the compared by alignment.
95 00405 
96 00406 \(\backslash\)verbatim
97 00407 \textcolor{keywordtype}{float} *\hyperlink{profiledist_8h_a8822fd5268be115c6e6cdc92009436cc}{Make\_bp\_profile\_bppm} ( \textcolor{keywordtype}{double} *bppm,
98 00408                               \textcolor{keywordtype}{int} length)
99 00409 \(\backslash\)endverbatim
100 00410 \(\backslash\)copybrief \hyperlink{profiledist_8h_a8822fd5268be115c6e6cdc92009436cc}{Make\_bp\_profile\_bppm}()
101 00411 
102 00412 \(\backslash\)verbatim
103 00413 \textcolor{keywordtype}{float} \hyperlink{profiledist_8h_abe75e90e00a1e5dd8862944ed53dad5d}{profile\_edit\_distance} ( \textcolor{keyword}{const} \textcolor{keywordtype}{float} *T1,
104 00414                               \textcolor{keyword}{const} \textcolor{keywordtype}{float} *T2)
105 00415 \(\backslash\)endverbatim
106 00416 \(\backslash\)copybrief \hyperlink{profiledist_8h_abe75e90e00a1e5dd8862944ed53dad5d}{profile\_edit\_distance}()
107 00417 
108 00418 \(\backslash\)see ProfileDist.h \textcolor{keywordflow}{for} prototypes and more details of the above functions
109 00419 
110 00420 \(\backslash\)ref mp\_utils \textcolor{stringliteral}{"Next Page: Utilities"}
111 00421 
112 00422 \(\backslash\)page  mp\_utils     Utilities - Odds and Ends
113 00423 
114 00424 \(\backslash\)anchor toc
115 00425 
116 00426 <h3>Table of Contents</h3>
117 00427 <hr>
118 00428 
119 00429 \(\backslash\)li \(\backslash\)ref  utils\_ss
120 00430 \(\backslash\)li \(\backslash\)ref  utils\_dot
121 00431 \(\backslash\)li \(\backslash\)ref  utils\_aln
122 00432 \(\backslash\)li \(\backslash\)ref  utils\_seq
123 00433 \(\backslash\)li \(\backslash\)ref  utils\_struc
124 00434 \(\backslash\)li \(\backslash\)ref  utils\_misc
125 00435 
126 00436 <hr>
127 00437 
128 00438 \(\backslash\)section utils\_ss Producing secondary structure graphs
129 00439 
130 00440 \(\backslash\)verbatim
131 00441 \textcolor{keywordtype}{int} \hyperlink{PS__dot_8h_a0873c7cc4cd7a11c9a2cea19dde7e9c9}{PS\_rna\_plot} ( \textcolor{keywordtype}{char} *\textcolor{keywordtype}{string},
132 00442                   \textcolor{keywordtype}{char} *structure,
133 00443                   \textcolor{keywordtype}{char} *file)
134 00444 \(\backslash\)endverbatim
135 00445 \(\backslash\)copybrief \hyperlink{PS__dot_8h_a0873c7cc4cd7a11c9a2cea19dde7e9c9}{PS\_rna\_plot}()
136 00446 
137 00447 \(\backslash\)verbatim
138 00448 \textcolor{keywordtype}{int} \hyperlink{PS__dot_8h_a47856b2504b566588785597b6ebb8271}{PS\_rna\_plot\_a} (
139 00449             \textcolor{keywordtype}{char} *\textcolor{keywordtype}{string},
140 00450             \textcolor{keywordtype}{char} *structure,
141 00451             \textcolor{keywordtype}{char} *file,
142 00452             \textcolor{keywordtype}{char} *pre,
143 00453             \textcolor{keywordtype}{char} *post)
144 00454 \(\backslash\)endverbatim
145 00455 \(\backslash\)copybrief \hyperlink{PS__dot_8h_a47856b2504b566588785597b6ebb8271}{PS\_rna\_plot\_a}()
146 00456 
147 00457 \(\backslash\)verbatim
148 00458 \textcolor{keywordtype}{int} \hyperlink{PS__dot_8h_a70834bc8c0aad4fe6824ff76ccb8f329}{gmlRNA} (\textcolor{keywordtype}{char} *\textcolor{keywordtype}{string},
149 00459             \textcolor{keywordtype}{char} *structure,
150 00460             \textcolor{keywordtype}{char} *ssfile,
151 00461             \textcolor{keywordtype}{char} option)
152 00462 \(\backslash\)endverbatim
153 00463 \(\backslash\)copybrief \hyperlink{PS__dot_8h_a70834bc8c0aad4fe6824ff76ccb8f329}{gmlRNA}()
154 00464 
155 00465 \(\backslash\)verbatim
156 00466 \textcolor{keywordtype}{int} \hyperlink{PS__dot_8h_add368528755f9a830727b680243541df}{ssv\_rna\_plot} (\textcolor{keywordtype}{char} *\textcolor{keywordtype}{string},
157 00467                   \textcolor{keywordtype}{char} *structure,
158 00468                   \textcolor{keywordtype}{char} *ssfile)
159 00469 \(\backslash\)endverbatim
160 00470 \(\backslash\)copybrief \hyperlink{PS__dot_8h_add368528755f9a830727b680243541df}{ssv\_rna\_plot}()
161 00471 
162 00472 \(\backslash\)verbatim
163 00473 \textcolor{keywordtype}{int} \hyperlink{PS__dot_8h_ae7853539b5df98f294b4af434e979304}{svg\_rna\_plot} (\textcolor{keywordtype}{char} *\textcolor{keywordtype}{string},
164 00474                   \textcolor{keywordtype}{char} *structure,
165 00475                   \textcolor{keywordtype}{char} *ssfile)
166 00476 \(\backslash\)endverbatim
167 00477 \(\backslash\)copybrief \hyperlink{PS__dot_8h_ae7853539b5df98f294b4af434e979304}{svg\_rna\_plot}()
168 00478 
169 00479 \(\backslash\)verbatim
170 00480 \textcolor{keywordtype}{int} \hyperlink{PS__dot_8h_a2f6d5953e6a323df898896b8d6614483}{xrna\_plot} ( \textcolor{keywordtype}{char} *\textcolor{keywordtype}{string},
171 00481                 \textcolor{keywordtype}{char} *structure,
172 00482                 \textcolor{keywordtype}{char} *ssfile)
173 00483 \(\backslash\)endverbatim
174 00484 \(\backslash\)copybrief \hyperlink{PS__dot_8h_a2f6d5953e6a323df898896b8d6614483}{xrna\_plot}()
175 00485 
176 00486 \(\backslash\)verbatim
177 00487 \textcolor{keywordtype}{int} rna\_plot\_type
178 00488 \(\backslash\)endverbatim
179 00489 \(\backslash\)copybrief \hyperlink{plot__layouts_8h_a5964c4581431b098b80027d6e14dcdd4}{rna\_plot\_type}
180 00490 
181 00491 Two low-level functions provide direct access to the graph lauyouting
182 00492 algorithms:
183 00493 
184 00494 \(\backslash\)verbatim
185 00495 \textcolor{keywordtype}{int} \hyperlink{plot__layouts_8h_af4b9173e7d3fd361c3c85e6def194123}{simple\_xy\_coordinates} ( \textcolor{keywordtype}{short} *pair\_table,
186 00496                             \textcolor{keywordtype}{float} *X,
187 00497                             \textcolor{keywordtype}{float} *Y)
188 00498 \(\backslash\)endverbatim
189 00499 \(\backslash\)copybrief \hyperlink{plot__layouts_8h_af4b9173e7d3fd361c3c85e6def194123}{simple\_xy\_coordinates}()
190 00500 
191 00501 \(\backslash\)verbatim
192 00502 \textcolor{keywordtype}{int} naview\_xy\_coordinates ( \textcolor{keywordtype}{short} *pair\_table,
193 00503                             \textcolor{keywordtype}{float} *X,
194 00504                             \textcolor{keywordtype}{float} *Y)
195 00505 \(\backslash\)endverbatim
196 00506 \(\backslash\)copybrief naview\_xy\_coordinates()
197 00507 
198 00508 \(\backslash\)see PS\_dot.h and naview.h \textcolor{keywordflow}{for} more detailed descriptions.
199 00509 
200 00510 \(\backslash\)htmlonly
201 00511 <hr>
202 00512 <a href=\textcolor{stringliteral}{"#toc"}>Table of Contents</a>
203 00513 <hr>
204 00514 \(\backslash\)endhtmlonly
205 00515 
206 00516 \(\backslash\)section utils\_dot Producing (colored) dot plots for base pair probabilities
207 00517 
208 00518 \(\backslash\)verbatim
209 00519 \textcolor{keywordtype}{int} PS\_color\_dot\_plot ( \textcolor{keywordtype}{char} *\textcolor{keywordtype}{string},
210 00520                         \hyperlink{structcpair}{cpair} *pi,
211 00521                         \textcolor{keywordtype}{char} *filename)
212 00522 \(\backslash\)endverbatim
213 00523 \(\backslash\)copybrief PS\_color\_dot\_plot()
214 00524 
215 00525 \(\backslash\)verbatim
216 00526 \textcolor{keywordtype}{int} PS\_color\_dot\_plot\_turn (\textcolor{keywordtype}{char} *seq,
217 00527                             \hyperlink{structcpair}{cpair} *pi,
218 00528                             \textcolor{keywordtype}{char} *filename,
219 00529                             \textcolor{keywordtype}{int} winSize)
220 00530 \(\backslash\)endverbatim
221 00531 \(\backslash\)copybrief PS\_color\_dot\_plot\_turn()
222 00532 
223 00533 \(\backslash\)verbatim
224 00534 \textcolor{keywordtype}{int} \hyperlink{PS__dot_8h_a00ea223b5cf02eb2faae5ff29f0d5e12}{PS\_dot\_plot\_list} (\textcolor{keywordtype}{char} *seq,
225 00535                       \textcolor{keywordtype}{char} *filename,
226 00536                       \hyperlink{structplist}{plist} *pl,
227 00537                       \hyperlink{structplist}{plist} *mf,
228 00538                       \textcolor{keywordtype}{char} *comment)
229 00539 \(\backslash\)endverbatim
230 00540 \(\backslash\)copybrief \hyperlink{PS__dot_8h_a00ea223b5cf02eb2faae5ff29f0d5e12}{PS\_dot\_plot\_list}()
231 00541 
232 00542 \(\backslash\)verbatim
233 00543 \textcolor{keywordtype}{int} PS\_dot\_plot\_turn (\textcolor{keywordtype}{char} *seq,
234 00544                       struct \hyperlink{structplist}{plist} *pl,
235 00545                       \textcolor{keywordtype}{char} *filename,
236 00546                       \textcolor{keywordtype}{int} winSize)
237 00547 \(\backslash\)endverbatim
238 00548 \(\backslash\)copybrief PS\_dot\_plot\_turn()
239 00549 
240 00550 \(\backslash\)see PS\_dot.h for more detailed descriptions.
241 00551 
242 00552 \(\backslash\)section utils\_aln Producing (colored) alignments
243 00553 
244 00554 \(\backslash\)verbatim
245 00555 \textcolor{keywordtype}{int} PS\_color\_aln (
246 00556             const \textcolor{keywordtype}{char} *structure,
247 00557             const \textcolor{keywordtype}{char} *filename,
248 00558             const \textcolor{keywordtype}{char} *seqs[],
249 00559             const \textcolor{keywordtype}{char} *names[])
250 00560 \(\backslash\)endverbatim
251 00561 \(\backslash\)copybrief PS\_color\_aln()
252 00562 
253 00563 \(\backslash\)htmlonly
254 00564 <hr>
255 00565 <a href="\textcolor{preprocessor}{#toc">Table of Contents</a>}
256 00566 \textcolor{preprocessor}{}<hr>
257 00567 \(\backslash\)endhtmlonly
258 00568 
259 00569 \(\backslash\)section  utils\_seq   RNA sequence related utilities
260 00570 
261 00571 Several functions provide useful applications to RNA sequences
262 00572 
263 00573 \(\backslash\)verbatim
264 00574 \textcolor{keywordtype}{char}  *\hyperlink{utils_8h_a1b95eac365a021572e1c37e5993a89be}{random\_string} (\textcolor{keywordtype}{int} l,
265 00575                       \textcolor{keyword}{const} \textcolor{keywordtype}{char} symbols[])
266 00576 \(\backslash\)endverbatim
267 00577 \(\backslash\)copybrief \hyperlink{utils_8h_a1b95eac365a021572e1c37e5993a89be}{random\_string}()
268 00578 
269 00579 \(\backslash\)verbatim
270 00580 \textcolor{keywordtype}{int}   \hyperlink{utils_8h_ad9dc7bfc9aa664dc6698f17ce07fc7e7}{hamming} ( \textcolor{keyword}{const} \textcolor{keywordtype}{char} *s1,
271 00581                 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *s2)
272 00582 \(\backslash\)endverbatim
273 00583 \(\backslash\)copybrief \hyperlink{utils_8h_ad9dc7bfc9aa664dc6698f17ce07fc7e7}{hamming}()
274 00584 
275 00585 \(\backslash\)verbatim
276 00586 \textcolor{keywordtype}{void} \hyperlink{utils_8h_ad3f18dd83f958f18b2f26ecb99305208}{str\_DNA2RNA}(\textcolor{keywordtype}{char} *sequence);
277 00587 \(\backslash\)endverbatim
278 00588 \(\backslash\)copybrief \hyperlink{utils_8h_ad3f18dd83f958f18b2f26ecb99305208}{str\_DNA2RNA}()
279 00589 
280 00590 \(\backslash\)verbatim
281 00591 \textcolor{keywordtype}{void} \hyperlink{utils_8h_a17b796b806f96b70382077fb5bc519bb}{str\_uppercase}(\textcolor{keywordtype}{char} *sequence);
282 00592 \(\backslash\)endverbatim
283 00593 \(\backslash\)copybrief \hyperlink{utils_8h_a17b796b806f96b70382077fb5bc519bb}{str\_uppercase}()
284 00594 
285 00595 \(\backslash\)htmlonly
286 00596 <hr>
287 00597 <a href=\textcolor{stringliteral}{"#toc"}>Table of Contents</a>
288 00598 <hr>
289 00599 \(\backslash\)endhtmlonly
290 00600 
291 00601 \(\backslash\)section utils\_struc  RNA secondary structure related utilities
292 00602 
293 00603 \(\backslash\)verbatim
294 00604 \textcolor{keywordtype}{char} *\hyperlink{utils_8h_ac6dfa5e22928c087c6e09ff0054a7ced}{pack\_structure} (\textcolor{keyword}{const} \textcolor{keywordtype}{char} *struc)
295 00605 \(\backslash\)endverbatim
296 00606 \(\backslash\)copybrief \hyperlink{utils_8h_ac6dfa5e22928c087c6e09ff0054a7ced}{pack\_structure}()
297 00607 
298 00608 \(\backslash\)verbatim
299 00609 \textcolor{keywordtype}{char} *\hyperlink{utils_8h_a071c6921efe1eb974f115ee6fefa3c39}{unpack\_structure} (\textcolor{keyword}{const} \textcolor{keywordtype}{char} *packed)
300 00610 \(\backslash\)endverbatim
301 00611 \(\backslash\)copybrief \hyperlink{utils_8h_a071c6921efe1eb974f115ee6fefa3c39}{unpack\_structure}()
302 00612 
303 00613 \(\backslash\)verbatim
304 00614 \textcolor{keywordtype}{short} *\hyperlink{utils_8h_a89c32307ee50a0026f4a3131fac0845a}{make\_pair\_table} (\textcolor{keyword}{const} \textcolor{keywordtype}{char} *structure)
305 00615 \(\backslash\)endverbatim
306 00616 \(\backslash\)copybrief \hyperlink{utils_8h_a89c32307ee50a0026f4a3131fac0845a}{make\_pair\_table}()
307 00617 
308 00618 \(\backslash\)verbatim
309 00619 \textcolor{keywordtype}{short} *\hyperlink{utils_8h_afeaa6d68eef3a99d0a7aa08aa91c6601}{copy\_pair\_table} (\textcolor{keyword}{const} \textcolor{keywordtype}{short} *pt)
310 00620 \(\backslash\)endverbatim
311 00621 \(\backslash\)copybrief \hyperlink{utils_8h_afeaa6d68eef3a99d0a7aa08aa91c6601}{copy\_pair\_table}()
312 00622 
313 00623 \(\backslash\)htmlonly
314 00624 <hr>
315 00625 <a href=\textcolor{stringliteral}{"#toc"}>Table of Contents</a>
316 00626 <hr>
317 00627 \(\backslash\)endhtmlonly
318 00628 
319 00629 \(\backslash\)section  utils\_misc  Miscellaneous Utilities
320 00630 
321 00631 \(\backslash\)verbatim
322 00632 \textcolor{keywordtype}{void} \hyperlink{utils_8h_a6bf778117d31b7fd90db435323f4ef74}{print\_tty\_input\_seq} (\textcolor{keywordtype}{void})
323 00633 \(\backslash\)endverbatim
324 00634 \(\backslash\)copybrief \hyperlink{utils_8h_a6bf778117d31b7fd90db435323f4ef74}{print\_tty\_input\_seq}()
325 00635 
326 00636 \(\backslash\)verbatim
327 00637 \textcolor{keywordtype}{void} \hyperlink{utils_8h_ae8ae8a34962b9959be3f6c40f0a80ac1}{print\_tty\_constraint\_full} (\textcolor{keywordtype}{void})
328 00638 \(\backslash\)endverbatim
329 00639 \(\backslash\)copybrief \hyperlink{utils_8h_ae8ae8a34962b9959be3f6c40f0a80ac1}{print\_tty\_constraint\_full}()
330 00640 
331 00641 \(\backslash\)verbatim
332 00642 \textcolor{keywordtype}{void} \hyperlink{utils_8h_a4d167deb70bb51723e44374dc981deb2}{print\_tty\_constraint} (\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} option)
333 00643 \(\backslash\)endverbatim
334 00644 \(\backslash\)copybrief \hyperlink{utils_8h_a4d167deb70bb51723e44374dc981deb2}{print\_tty\_constraint}()
335 00645 
336 00646 \(\backslash\)verbatim
337 00647 \textcolor{keywordtype}{int}   *\hyperlink{utils_8h_a55c0f6b3b07b6adf2ee235ba901fe397}{get\_iindx} (\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} length)
338 00648 \(\backslash\)endverbatim
339 00649 \(\backslash\)copybrief \hyperlink{utils_8h_a55c0f6b3b07b6adf2ee235ba901fe397}{get\_iindx}()
340 00650 
341 00651 \(\backslash\)verbatim
342 00652 \textcolor{keywordtype}{int}   *\hyperlink{utils_8h_a4d9ee1572c1bfcd02d3d3f2db8a6530f}{get\_indx} (\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} length)
343 00653 \(\backslash\)endverbatim
344 00654 \(\backslash\)copybrief \hyperlink{utils_8h_a4d9ee1572c1bfcd02d3d3f2db8a6530f}{get\_indx}()
345 00655 
346 00656 \(\backslash\)verbatim
347 00657 \textcolor{keywordtype}{void} \hyperlink{utils_8h_a36c3a6c3218b041f992052767bc74549}{constrain\_ptypes} (
348 00658                 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *constraint,
349 00659                 \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} length,
350 00660                 \textcolor{keywordtype}{char} *ptype,
351 00661                 \textcolor{keywordtype}{int} *BP,
352 00662                 \textcolor{keywordtype}{int} min\_loop\_size,
353 00663                 \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} idx\_type)
354 00664 \(\backslash\)endverbatim
355 00665 \(\backslash\)copybrief \hyperlink{utils_8h_a36c3a6c3218b041f992052767bc74549}{constrain\_ptypes}()
356 00666 
357 00667 \(\backslash\)verbatim
358 00668 \textcolor{keywordtype}{char}  *\hyperlink{utils_8h_abe51806d14cff0789a8c1df7dbc45b71}{get\_line}(FILE *fp);
359 00669 \(\backslash\)endverbatim
360 00670 \(\backslash\)copybrief \hyperlink{utils_8h_abe51806d14cff0789a8c1df7dbc45b71}{get\_line}()
361 00671 
362 00672 \(\backslash\)verbatim
363 00673 \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} \hyperlink{utils_8h_afd194a69af9d92b5b0412a7627ac1595}{read\_record}(
364 00674                 \textcolor{keywordtype}{char} **header,
365 00675                 \textcolor{keywordtype}{char} **sequence,
366 00676                 \textcolor{keywordtype}{char} ***rest,
367 00677                 \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} options);
368 00678 \(\backslash\)endverbatim
369 00679 \(\backslash\)copybrief \hyperlink{utils_8h_afd194a69af9d92b5b0412a7627ac1595}{read\_record}()
370 00680 
371 00681 \(\backslash\)verbatim
372 00682 \textcolor{keywordtype}{char}  *\hyperlink{utils_8h_a7afeb906cb36e9d77379eabc6907ac46}{time\_stamp} (\textcolor{keywordtype}{void})
373 00683 \(\backslash\)endverbatim
374 00684 \(\backslash\)copybrief \hyperlink{utils_8h_a7afeb906cb36e9d77379eabc6907ac46}{time\_stamp}()
375 00685 
376 00686 \(\backslash\)verbatim
377 00687 \textcolor{keywordtype}{void} \hyperlink{utils_8h_af2355fa8746f2f30fbe71db65dea3d51}{warn\_user} (\textcolor{keyword}{const} \textcolor{keywordtype}{char} message[])
378 00688 \(\backslash\)endverbatim
379 00689 \(\backslash\)copybrief \hyperlink{utils_8h_af2355fa8746f2f30fbe71db65dea3d51}{warn\_user}()
380 00690 
381 00691 \(\backslash\)verbatim
382 00692 \textcolor{keywordtype}{void} \hyperlink{utils_8h_a127ce946e56b5a5773781cabe68e38c5}{nrerror} (\textcolor{keyword}{const} \textcolor{keywordtype}{char} message[])
383 00693 \(\backslash\)endverbatim
384 00694 \(\backslash\)copybrief \hyperlink{utils_8h_a127ce946e56b5a5773781cabe68e38c5}{nrerror}()
385 00695 
386 00696 \(\backslash\)verbatim
387 00697 \textcolor{keywordtype}{void}   \hyperlink{utils_8h_a8aaa6d9be6f803f496d9b97375c371f3}{init\_rand} (\textcolor{keywordtype}{void})
388 00698 \(\backslash\)endverbatim
389 00699 \(\backslash\)copybrief \hyperlink{utils_8h_a8aaa6d9be6f803f496d9b97375c371f3}{init\_rand}()
390 00700 
391 00701 \(\backslash\)verbatim
392 00702 \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} \hyperlink{utils_8h_af9a866c8417afda7368bbac939ab3c47}{xsubi}[3];
393 00703 \(\backslash\)endverbatim
394 00704 \(\backslash\)copybrief xsubi
395 00705 
396 00706 \(\backslash\)verbatim
397 00707 \textcolor{keywordtype}{double} \hyperlink{utils_8h_aaa328491c84996e445d027fde9800f2e}{urn} (\textcolor{keywordtype}{void})
398 00708 \(\backslash\)endverbatim
399 00709 \(\backslash\)copybrief \hyperlink{utils_8h_aaa328491c84996e445d027fde9800f2e}{urn}()
400 00710 
401 00711 \(\backslash\)verbatim
402 00712 \textcolor{keywordtype}{int}    \hyperlink{utils_8h_a68ff0849d44f62fe491800378a5ffcb4}{int\_urn} (\textcolor{keywordtype}{int} from, \textcolor{keywordtype}{int} to)
403 00713 \(\backslash\)endverbatim
404 00714 \(\backslash\)copybrief \hyperlink{utils_8h_a68ff0849d44f62fe491800378a5ffcb4}{int\_urn}()
405 00715 
406 00716 \(\backslash\)verbatim
407 00717 \textcolor{keywordtype}{void}  *\hyperlink{utils_8h_ad7e1e137b3bf1f7108933d302a7f0177}{space} (\textcolor{keywordtype}{unsigned} size)
408 00718 \(\backslash\)endverbatim
409 00719 \(\backslash\)copybrief \hyperlink{utils_8h_ad7e1e137b3bf1f7108933d302a7f0177}{space}()
410 00720 
411 00721 \(\backslash\)verbatim
412 00722 \textcolor{keywordtype}{void}  *\hyperlink{utils_8h_a9037ada838835b1b9db41581a021b0c8}{xrealloc} ( \textcolor{keywordtype}{void} *p,
413 00723                   \textcolor{keywordtype}{unsigned} size)
414 00724 \(\backslash\)endverbatim
415 00725 \(\backslash\)copybrief \hyperlink{utils_8h_a9037ada838835b1b9db41581a021b0c8}{xrealloc}()
416 00726 
417 00727 \(\backslash\)see  utils.h \textcolor{keywordflow}{for} a complete overview and detailed description of the utility functions
418 00728 
419 00729 \(\backslash\)htmlonly
420 00730 <hr>
421 00731 <a href=\textcolor{stringliteral}{"#toc"}>Table of Contents</a>
422 00732 <hr>
423 00733 \(\backslash\)endhtmlonly
424 00734 
425 00735 \(\backslash\)ref mp\_example \textcolor{stringliteral}{"Next Page: Examples"}
426 00736 
427 00737 \(\backslash\)page  mp\_example   Example - A Small Example Program
428 00738 
429 00739 The following program exercises most commonly used functions of the library.
430 00740 The program folds two sequences \textcolor{keyword}{using} both the mfe and partition \textcolor{keyword}{function}
431 00741 algorithms and calculates the tree edit and profile distance of the
432 00742 resulting structures and base pairing probabilities.
433 00743 
434 00744 \(\backslash\)code\{.c\}
435 00745 \textcolor{preprocessor}{#include  <stdio.h>}
436 00746 \textcolor{preprocessor}{#include  <stdlib.h>}
437 00747 \textcolor{preprocessor}{#include  <math.h>}
438 00748 \textcolor{preprocessor}{#include  <string.h>}
439 00749 \textcolor{preprocessor}{#include  "\hyperlink{utils_8h}{utils.h}"}
440 00750 \textcolor{preprocessor}{#include  "\hyperlink{fold__vars_8h}{fold\_vars.h}"}
441 00751 \textcolor{preprocessor}{#include  "\hyperlink{fold_8h}{fold.h}"}
442 00752 \textcolor{preprocessor}{#include  "\hyperlink{part__func_8h}{part\_func.h}"}
443 00753 \textcolor{preprocessor}{#include  "\hyperlink{inverse_8h}{inverse.h}"}
444 00754 \textcolor{preprocessor}{#include  "\hyperlink{RNAstruct_8h}{RNAstruct.h}"}
445 00755 \textcolor{preprocessor}{#include  "\hyperlink{treedist_8h}{treedist.h}"}
446 00756 \textcolor{preprocessor}{#include  "\hyperlink{stringdist_8h}{stringdist.h}"}
447 00757 \textcolor{preprocessor}{#include  "\hyperlink{profiledist_8h}{profiledist.h}"}
448 00758 
449 00759 \textcolor{keywordtype}{void} main()
450 00760 \{
451 00761    \textcolor{keywordtype}{char} *seq1=\textcolor{stringliteral}{"CGCAGGGAUACCCGCG"}, *seq2=\textcolor{stringliteral}{"GCGCCCAUAGGGACGC"},
452 00762         *struct1,* struct2,* xstruc;
453 00763    \textcolor{keywordtype}{float} e1, e2, tree\_dist, string\_dist, profile\_dist, kT;
454 00764    \hyperlink{structTree}{Tree} *T1, *T2;
455 00765    \hyperlink{structswString}{swString} *S1, *S2;
456 00766    \textcolor{keywordtype}{float} *pf1, *pf2;
457 00767    FLT\_OR\_DBL *bppm;
458 00768    \textcolor{comment}{/* fold at 30C instead of the default 37C */}
459 00769    \hyperlink{fold__vars_8h_ab4b11c8d9c758430960896bc3fe82ead}{temperature} = 30.;      \textcolor{comment}{/* must be set *before* initializing  */}
460 00770 
461 00771    \textcolor{comment}{/* allocate memory for structure and fold */}
462 00772    struct1 = (\textcolor{keywordtype}{char}* ) \hyperlink{utils_8h_ad7e1e137b3bf1f7108933d302a7f0177}{space}(\textcolor{keyword}{sizeof}(\textcolor{keywordtype}{char})*(strlen(seq1)+1));
463 00773    e1 =  \hyperlink{group__mfe__fold_gaadafcb0f140795ae62e5ca027e335a9b}{fold}(seq1, struct1);
464 00774 
465 00775    struct2 = (\textcolor{keywordtype}{char}* ) \hyperlink{utils_8h_ad7e1e137b3bf1f7108933d302a7f0177}{space}(\textcolor{keyword}{sizeof}(\textcolor{keywordtype}{char})*(strlen(seq2)+1));
466 00776    e2 =  \hyperlink{group__mfe__fold_gaadafcb0f140795ae62e5ca027e335a9b}{fold}(seq2, struct2);
467 00777 
468 00778    \hyperlink{group__mfe__fold_ga107fdfe5fd641868156bfd849f6866c7}{free\_arrays}();     \textcolor{comment}{/* free arrays used in fold() */}
469 00779 
470 00780    \textcolor{comment}{/* produce tree and string representations for comparison */}
471 00781    xstruc = \hyperlink{RNAstruct_8h_a78d73cd54a068ef2812812771cdddc6f}{expand\_Full}(struct1);
472 00782    T1 = \hyperlink{treedist_8h_a08fe4d5afd385dce593b86eaf010c6e3}{make\_tree}(xstruc);
473 00783    S1 = \hyperlink{stringdist_8h_a3125991b3a403b3f89230474deb3f22e}{Make\_swString}(xstruc);
474 00784    free(xstruc);
475 00785 
476 00786    xstruc = \hyperlink{RNAstruct_8h_a78d73cd54a068ef2812812771cdddc6f}{expand\_Full}(struct2);
477 00787    T2 = \hyperlink{treedist_8h_a08fe4d5afd385dce593b86eaf010c6e3}{make\_tree}(xstruc);
478 00788    S2 = \hyperlink{stringdist_8h_a3125991b3a403b3f89230474deb3f22e}{Make\_swString}(xstruc);
479 00789    free(xstruc);
480 00790 
481 00791    \textcolor{comment}{/* calculate tree edit distance and aligned structures with gaps */}
482 00792    \hyperlink{dist__vars_8h_aa03194c513af6b860e7b33e370b82bdb}{edit\_backtrack} = 1;
483 00793    tree\_dist = \hyperlink{treedist_8h_a3b21f1925f7071f46d93431a835217bb}{tree\_edit\_distance}(T1, T2);
484 00794    \hyperlink{treedist_8h_acbc1cb9bce582ea945e4a467c76a57aa}{free\_tree}(T1); \hyperlink{treedist_8h_acbc1cb9bce582ea945e4a467c76a57aa}{free\_tree}(T2);
485 00795    \hyperlink{RNAstruct_8h_a1054c4477d53b31d79d4cb132100e87a}{unexpand\_aligned\_F}(aligned\_line);
486 00796    printf(\textcolor{stringliteral}{"%s\(\backslash\)n%s  %3.2f\(\backslash\)n"}, aligned\_line[0], aligned\_line[1], tree\_dist);
487 00797 
488 00798    \textcolor{comment}{/* same thing using string edit (alignment) distance */}
489 00799    string\_dist = \hyperlink{stringdist_8h_a89e3c335ef17780576d7c0e713830db9}{string\_edit\_distance}(S1, S2);
490 00800    free(S1); free(S2);
491 00801    printf(\textcolor{stringliteral}{"%s  mfe=%5.2f\(\backslash\)n%s  mfe=%5.2f  dist=%3.2f\(\backslash\)n"},
492 00802           aligned\_line[0], e1, aligned\_line[1], e2, string\_dist);
493 00803 
494 00804    \textcolor{comment}{/* for longer sequences one should also set a scaling factor for}
495 00805 \textcolor{comment}{      partition function folding, e.g: */}
496 00806    kT = (\hyperlink{fold__vars_8h_ab4b11c8d9c758430960896bc3fe82ead}{temperature}+273.15)*1.98717/1000.;  \textcolor{comment}{/* kT in kcal/mol */}
497 00807    \hyperlink{fold__vars_8h_ad3b22044065acc6dee0af68931b52cfd}{pf\_scale} = exp(-e1/kT/strlen(seq1));
498 00808 
499 00809    \textcolor{comment}{/* calculate partition function and base pair probabilities */}
500 00810    e1 = \hyperlink{group__pf__fold_gadc3db3d98742427e7001a7fd36ef28c2}{pf\_fold}(seq1, struct1);
501 00811    \textcolor{comment}{/* get the base pair probability matrix for the previous run of pf\_fold() */}
502 00812    bppm = \hyperlink{group__pf__fold_ga6d463707d5f64bdc4d21515b7dd9b115}{export\_bppm}();
503 00813    pf1 = \hyperlink{profiledist_8h_a8822fd5268be115c6e6cdc92009436cc}{Make\_bp\_profile\_bppm}(bppm, strlen(seq1));
504 00814 
505 00815    e2 = \hyperlink{group__pf__fold_gadc3db3d98742427e7001a7fd36ef28c2}{pf\_fold}(seq2, struct2);
506 00816    \textcolor{comment}{/* get the base pair probability matrix for the previous run of pf\_fold() */}
507 00817    bppm = \hyperlink{group__pf__fold_ga6d463707d5f64bdc4d21515b7dd9b115}{export\_bppm}();
508 00818    pf2 = \hyperlink{profiledist_8h_a8822fd5268be115c6e6cdc92009436cc}{Make\_bp\_profile\_bppm}(bppm, strlen(seq2));
509 00819 
510 00820    \hyperlink{group__pf__fold_gae73db3f49a94f0f72e067ecd12681dbd}{free\_pf\_arrays}();  \textcolor{comment}{/* free space allocated for pf\_fold() */}
511 00821 
512 00822    profile\_dist = \hyperlink{profiledist_8h_abe75e90e00a1e5dd8862944ed53dad5d}{profile\_edit\_distance}(pf1, pf2);
513 00823    printf(\textcolor{stringliteral}{"%s  free energy=%5.2f\(\backslash\)n%s  free energy=%5.2f  dist=%3.2f\(\backslash\)n"},
514 00824           aligned\_line[0], e1, aligned\_line[1], e2, profile\_dist);
515 00825 
516 00826    \hyperlink{profiledist_8h_a9b0b84a5a45761bf42d7c835dcdb3b85}{free\_profile}(pf1); \hyperlink{profiledist_8h_a9b0b84a5a45761bf42d7c835dcdb3b85}{free\_profile}(pf2);
517 00827 \}
518 00828 \(\backslash\)endcode
519 00829 
520 00830 In a typical Unix environment you would compile \textcolor{keyword}{this} program \textcolor{keyword}{using}:
521 00831 \(\backslash\)verbatim
522 00832 cc $\{OPENMP\_CFLAGS\} -c example.c -I$\{hpath\}
523 00833 \(\backslash\)endverbatim
524 00834 and link using
525 00835 \(\backslash\)verbatim
526 00836 cc $\{OPENMP\_CFLAGS\} -o example -L$\{lpath\} -lRNA -lm
527 00837 \(\backslash\)endverbatim
528 00838 where \(\backslash\)e $\{hpath\} and \(\backslash\)e $\{lpath\} point to the location of the header
529 00839 files and library, respectively.
530 00840 \(\backslash\)note As \textcolor{keywordflow}{default}, the RNAlib is compiled with build-in \(\backslash\)e OpenMP multithreading
531 00841 support. Thus, when linking your own \textcolor{keywordtype}{object} files to the library you have to pass
532 00842 the compiler specific \(\backslash\)e $\{OPENMP\_CFLAGS\} (e.g. \textcolor{stringliteral}{'-fopenmp'} for \(\backslash\)b gcc) even \textcolor{keywordflow}{if} your code does not
533 00843 use openmp specific code. However, in that \textcolor{keywordflow}{case} the \(\backslash\)e OpenMP flags may be ommited when compiling
534 00844 example.c
535 00845 
536 00846 
537 00847 **/
538 00848 
539 \end{DoxyCode}