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">
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);
16 <link href="doxygen.css" rel="stylesheet" type="text/css" />
19 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
21 <table cellspacing="0" cellpadding="0">
23 <tr style="height: 56px;">
24 <td style="padding-left: 0.5em;">
25 <div id="projectname">RNAlib-2.1.2
32 <!-- end header part -->
33 <!-- Generated by Doxygen 1.8.1.1 -->
34 <div id="navrow1" class="tabs">
36 <li><a href="index.html"><span>Main Page</span></a></li>
37 <li class="current"><a href="pages.html"><span>Related Pages</span></a></li>
38 <li><a href="modules.html"><span>Modules</span></a></li>
39 <li><a href="annotated.html"><span>Data Structures</span></a></li>
40 <li><a href="files.html"><span>Files</span></a></li>
44 <div id="side-nav" class="ui-resizable side-nav-resizable">
46 <div id="nav-tree-contents">
49 <div id="splitbar" style="-moz-user-select:none;"
50 class="ui-resizable-handle">
53 <script type="text/javascript">
54 $(document).ready(function(){initNavTree('mp_utils.html','');});
56 <div id="doc-content">
58 <div class="headertitle">
59 <div class="title">Utilities - Odds and Ends </div> </div>
61 <div class="contents">
62 <div class="textblock"><p><a class="anchor" id="toc"></a> </p>
63 <h3>Table of Contents</h3>
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>
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,
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 (
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,
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,
95 </pre><p> Produce a secondary structure graph in SStructView format. </p>
96 <pre class="fragment">int svg_rna_plot (char *string,
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,
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,
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,
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>
117 <a href="#toc">Table of Contents</a>
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,
124 </pre> <pre class="fragment">int PS_color_dot_plot_turn (char *seq,
128 </pre> <pre class="fragment">int PS_dot_plot_list (char *seq,
133 </pre><p> Produce a postscript dot-plot from two pair lists. </p>
134 <pre class="fragment">int PS_dot_plot_turn (char *seq,
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,
148 <a href="#toc">Table of Contents</a>
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,
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>
165 <a href="#toc">Table of Contents</a>
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>
179 <a href="#toc">Table of Contents</a>
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,
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(
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,
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>
231 <a href="#toc">Table of Contents</a>
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! -->
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>