1e265c3eeb0f524cbd1c0acbc809857d9b5f5b5d
[jabaws.git] / binaries / src / ViennaRNA / doc / html / mp_utils.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5 <meta http-equiv="X-UA-Compatible" content="IE=9"/>
6 <title>RNAlib-2.1.2: Utilities - Odds and Ends</title>
7 <link href="tabs.css" rel="stylesheet" type="text/css"/>
8 <script type="text/javascript" src="jquery.js"></script>
9 <script type="text/javascript" src="dynsections.js"></script>
10 <link href="navtree.css" rel="stylesheet" type="text/css"/>
11 <script type="text/javascript" src="resize.js"></script>
12 <script type="text/javascript" src="navtree.js"></script>
13 <script type="text/javascript">
14   $(document).ready(initResizable);
15 </script>
16 <link href="doxygen.css" rel="stylesheet" type="text/css" />
17 </head>
18 <body>
19 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
20 <div id="titlearea">
21 <table cellspacing="0" cellpadding="0">
22  <tbody>
23  <tr style="height: 56px;">
24   <td style="padding-left: 0.5em;">
25    <div id="projectname">RNAlib-2.1.2
26    </div>
27   </td>
28  </tr>
29  </tbody>
30 </table>
31 </div>
32 <!-- end header part -->
33 <!-- Generated by Doxygen 1.8.1.1 -->
34   <div id="navrow1" class="tabs">
35     <ul class="tablist">
36       <li><a href="index.html"><span>Main&#160;Page</span></a></li>
37       <li class="current"><a href="pages.html"><span>Related&#160;Pages</span></a></li>
38       <li><a href="modules.html"><span>Modules</span></a></li>
39       <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
40       <li><a href="files.html"><span>Files</span></a></li>
41     </ul>
42   </div>
43 </div><!-- top -->
44 <div id="side-nav" class="ui-resizable side-nav-resizable">
45   <div id="nav-tree">
46     <div id="nav-tree-contents">
47     </div>
48   </div>
49   <div id="splitbar" style="-moz-user-select:none;" 
50        class="ui-resizable-handle">
51   </div>
52 </div>
53 <script type="text/javascript">
54 $(document).ready(function(){initNavTree('mp_utils.html','');});
55 </script>
56 <div id="doc-content">
57 <div class="header">
58   <div class="headertitle">
59 <div class="title">Utilities - Odds and Ends </div>  </div>
60 </div><!--header-->
61 <div class="contents">
62 <div class="textblock"><p><a class="anchor" id="toc"></a> </p>
63 <h3>Table of Contents</h3>
64 <hr/>
65 <ul>
66 <li><a class="el" href="mp_utils.html#utils_ss">Producing secondary structure graphs</a> </li>
67 <li><a class="el" href="mp_utils.html#utils_dot">Producing (colored) dot plots for base pair probabilities</a> </li>
68 <li><a class="el" href="mp_utils.html#utils_aln">Producing (colored) alignments</a> </li>
69 <li><a class="el" href="mp_utils.html#utils_seq">RNA sequence related utilities</a> </li>
70 <li><a class="el" href="mp_utils.html#utils_struc">RNA secondary structure related utilities</a> </li>
71 <li><a class="el" href="mp_utils.html#utils_misc">Miscellaneous Utilities</a></li>
72 </ul>
73 <hr/>
74 <h1><a class="anchor" id="utils_ss"></a>
75 Producing secondary structure graphs</h1>
76 <pre class="fragment">int PS_rna_plot ( char *string,
77                   char *structure,
78                   char *file)
79 </pre><p> Produce a secondary structure graph in PostScript and write it to 'filename'. </p>
80 <pre class="fragment">int PS_rna_plot_a (
81             char *string,
82             char *structure,
83             char *file,
84             char *pre,
85             char *post)
86 </pre><p> Produce a secondary structure graph in PostScript including additional annotation macros and write it to 'filename'. </p>
87 <pre class="fragment">int gmlRNA (char *string,
88             char *structure,
89             char *ssfile,
90             char option)
91 </pre><p> Produce a secondary structure graph in Graph Meta Language (gml) and write it to a file. </p>
92 <pre class="fragment">int ssv_rna_plot (char *string,
93                   char *structure,
94                   char *ssfile)
95 </pre><p> Produce a secondary structure graph in SStructView format. </p>
96 <pre class="fragment">int svg_rna_plot (char *string,
97                   char *structure,
98                   char *ssfile)
99 </pre><p> Produce a secondary structure plot in SVG format and write it to a file. </p>
100 <pre class="fragment">int xrna_plot ( char *string,
101                 char *structure,
102                 char *ssfile)
103 </pre><p> Produce a secondary structure plot for further editing in XRNA. </p>
104 <pre class="fragment">int rna_plot_type
105 </pre><p> Switch for changing the secondary structure layout algorithm. </p>
106 <p>Two low-level functions provide direct access to the graph lauyouting algorithms:</p>
107 <pre class="fragment">int simple_xy_coordinates ( short *pair_table,
108                             float *X,
109                             float *Y)
110 </pre><p> Calculate nucleotide coordinates for secondary structure plot the <em>Simple way</em> </p>
111 <pre class="fragment">int naview_xy_coordinates ( short *pair_table,
112                             float *X,
113                             float *Y)
114 </pre> <dl class="section see"><dt>See also:</dt><dd><a class="el" href="PS__dot_8h.html" title="Various functions for plotting RNA secondary structures, dot-plots and other visualizations.">PS_dot.h</a> and <a class="el" href="naview_8h.html">naview.h</a> for more detailed descriptions.</dd></dl>
115  
116 <hr>
117 <a href="#toc">Table of Contents</a>
118 <hr>
119 <h1><a class="anchor" id="utils_dot"></a>
120 Producing (colored) dot plots for base pair probabilities</h1>
121 <pre class="fragment">int PS_color_dot_plot ( char *string,
122                         cpair *pi,
123                         char *filename)
124 </pre> <pre class="fragment">int PS_color_dot_plot_turn (char *seq,
125                             cpair *pi,
126                             char *filename,
127                             int winSize)
128 </pre> <pre class="fragment">int PS_dot_plot_list (char *seq,
129                       char *filename,
130                       plist *pl,
131                       plist *mf,
132                       char *comment)
133 </pre><p> Produce a postscript dot-plot from two pair lists. </p>
134 <pre class="fragment">int PS_dot_plot_turn (char *seq,
135                       struct plist *pl,
136                       char *filename,
137                       int winSize)
138 </pre> <dl class="section see"><dt>See also:</dt><dd><a class="el" href="PS__dot_8h.html" title="Various functions for plotting RNA secondary structures, dot-plots and other visualizations.">PS_dot.h</a> for more detailed descriptions.</dd></dl>
139 <h1><a class="anchor" id="utils_aln"></a>
140 Producing (colored) alignments</h1>
141 <pre class="fragment">int PS_color_aln (
142             const char *structure,
143             const char *filename,
144             const char *seqs[],
145             const char *names[])
146 </pre>  
147 <hr>
148 <a href="#toc">Table of Contents</a>
149 <hr>
150 <h1><a class="anchor" id="utils_seq"></a>
151 RNA sequence related utilities</h1>
152 <p>Several functions provide useful applications to RNA sequences</p>
153 <pre class="fragment">char  *random_string (int l,
154                       const char symbols[])
155 </pre><p> Create a random string using characters from a specified symbol set. </p>
156 <pre class="fragment">int   hamming ( const char *s1,
157                 const char *s2)
158 </pre><p> Calculate hamming distance between two sequences. </p>
159 <pre class="fragment">void str_DNA2RNA(char *sequence);
160 </pre><p> Convert a DNA input sequence to RNA alphabet. </p>
161 <pre class="fragment">void str_uppercase(char *sequence);
162 </pre><p> Convert an input sequence to uppercase. </p>
163  
164 <hr>
165 <a href="#toc">Table of Contents</a>
166 <hr>
167 <h1><a class="anchor" id="utils_struc"></a>
168 RNA secondary structure related utilities</h1>
169 <pre class="fragment">char *pack_structure (const char *struc)
170 </pre><p> Pack secondary secondary structure, 5:1 compression using base 3 encoding. </p>
171 <pre class="fragment">char *unpack_structure (const char *packed)
172 </pre><p> Unpack secondary structure previously packed with <a class="el" href="utils_8h.html#ac6dfa5e22928c087c6e09ff0054a7ced" title="Pack secondary secondary structure, 5:1 compression using base 3 encoding.">pack_structure()</a> </p>
173 <pre class="fragment">short *make_pair_table (const char *structure)
174 </pre><p> Create a pair table of a secondary structure. </p>
175 <pre class="fragment">short *copy_pair_table (const short *pt)
176 </pre><p> Get an exact copy of a pair table. </p>
177  
178 <hr>
179 <a href="#toc">Table of Contents</a>
180 <hr>
181 <h1><a class="anchor" id="utils_misc"></a>
182 Miscellaneous Utilities</h1>
183 <pre class="fragment">void print_tty_input_seq (void)
184 </pre><p> Print a line to <em>stdout</em> that asks for an input sequence. </p>
185 <pre class="fragment">void print_tty_constraint_full (void)
186 </pre><p> Print structure constraint characters to stdout (full constraint support) </p>
187 <pre class="fragment">void print_tty_constraint (unsigned int option)
188 </pre><p> Print structure constraint characters to stdout. (constraint support is specified by option parameter) </p>
189 <pre class="fragment">int   *get_iindx (unsigned int length)
190 </pre><p> Get an index mapper array (iindx) for accessing the energy matrices, e.g. in partition function related functions. </p>
191 <pre class="fragment">int   *get_indx (unsigned int length)
192 </pre><p> Get an index mapper array (indx) for accessing the energy matrices, e.g. in MFE related functions. </p>
193 <pre class="fragment">void constrain_ptypes (
194                 const char *constraint,
195                 unsigned int length,
196                 char *ptype,
197                 int *BP,
198                 int min_loop_size,
199                 unsigned int idx_type)
200 </pre><p> Insert constraining pair types according to constraint structure string. </p>
201 <pre class="fragment">char  *get_line(FILE *fp);
202 </pre><p> Read a line of arbitrary length from a stream. </p>
203 <pre class="fragment">unsigned int read_record(
204                 char **header,
205                 char **sequence,
206                 char ***rest,
207                 unsigned int options);
208 </pre><p> Get a data record from stdin. </p>
209 <pre class="fragment">char  *time_stamp (void)
210 </pre><p> Get a timestamp. </p>
211 <pre class="fragment">void warn_user (const char message[])
212 </pre><p> Print a warning message. </p>
213 <pre class="fragment">void nrerror (const char message[])
214 </pre><p> Die with an error message. </p>
215 <pre class="fragment">void   init_rand (void)
216 </pre><p> Make random number seeds. </p>
217 <pre class="fragment">unsigned short xsubi[3];
218 </pre><p> Current 48 bit random number. </p>
219 <pre class="fragment">double urn (void)
220 </pre><p> get a random number from [0..1] </p>
221 <pre class="fragment">int    int_urn (int from, int to)
222 </pre><p> Generates a pseudo random integer in a specified range. </p>
223 <pre class="fragment">void  *space (unsigned size)
224 </pre><p> Allocate space safely. </p>
225 <pre class="fragment">void  *xrealloc ( void *p,
226                   unsigned size)
227 </pre><p> Reallocate space safely. </p>
228 <dl class="section see"><dt>See also:</dt><dd><a class="el" href="utils_8h.html" title="Various utility- and helper-functions used throughout the Vienna RNA package.">utils.h</a> for a complete overview and detailed description of the utility functions</dd></dl>
229  
230 <hr>
231 <a href="#toc">Table of Contents</a>
232 <hr>
233 <p><a class="el" href="mp_example.html">Next Page: Examples</a> </p>
234 </div></div><!-- contents -->
235 </div><!-- doc-content -->
236 <!-- start footer part -->
237 <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
238   <ul>
239     <li class="footer">Generated on Wed Jul 24 2013 13:38:59 for RNAlib-2.1.2 by
240     <a href="http://www.doxygen.org/index.html">
241     <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.1.1 </li>
242   </ul>
243 </div>
244 </body>
245 </html>