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 <title>RNAlib-2.1.2: Utilities - Odds and Ends</title>
6 <link href="tabs.css" rel="stylesheet" type="text/css"/>
7 <link href="doxygen.css" rel="stylesheet" type="text/css"/>
10 <!-- Generated by Doxygen 1.6.1 -->
11 <script type="text/javascript">
13 function changeDisplayState (e){
14 var num=this.id.replace(/[^[0-9]/g,'');
15 var button=this.firstChild;
16 var sectionDiv=document.getElementById('dynsection'+num);
17 if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){
18 sectionDiv.style.display='block';
19 button.src='open.gif';
21 sectionDiv.style.display='none';
22 button.src='closed.gif';
25 function initDynSections(){
26 var divs=document.getElementsByTagName('div');
28 for(var i=0;i<divs.length-1;i++){
29 if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){
31 var section=divs[i+1];
32 var button=header.firstChild;
34 divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild);
35 button=document.createElement('img');
36 divs[i].insertBefore(button,divs[i].firstChild);
38 header.style.cursor='pointer';
39 header.onclick=changeDisplayState;
40 header.id='dynheader'+sectionCounter;
41 button.src='closed.gif';
42 section.id='dynsection'+sectionCounter;
43 section.style.display='none';
44 section.style.marginLeft='14px';
49 window.onload = initDynSections;
52 <div class="navigation" id="top">
55 <li><a href="main.html"><span>Main Page</span></a></li>
56 <li class="current"><a href="pages.html"><span>Related Pages</span></a></li>
57 <li><a href="modules.html"><span>Modules</span></a></li>
58 <li><a href="annotated.html"><span>Data Structures</span></a></li>
59 <li><a href="files.html"><span>Files</span></a></li>
63 <div class="contents">
66 <h1><a class="anchor" id="mp_utils">Utilities - Odds and Ends </a></h1><p><a class="anchor" id="toc"></a></p>
67 <h3>Table of Contents</h3>
70 <li><a class="el" href="mp_utils.html#utils_ss">Producing secondary structure graphs</a> </li>
71 <li><a class="el" href="mp_utils.html#utils_dot">Producing (colored) dot plots for base pair probabilities</a> </li>
72 <li><a class="el" href="mp_utils.html#utils_aln">Producing (colored) alignments</a> </li>
73 <li><a class="el" href="mp_utils.html#utils_seq">RNA sequence related utilities</a> </li>
74 <li><a class="el" href="mp_utils.html#utils_struc">RNA secondary structure related utilities</a> </li>
75 <li><a class="el" href="mp_utils.html#utils_misc">Miscellaneous Utilities</a></li>
78 <h2><a class="anchor" id="utils_ss">
79 Producing secondary structure graphs</a></h2>
80 <div class="fragment"><pre class="fragment">
81 int PS_rna_plot ( char *string,
84 </pre></div><p> Produce a secondary structure graph in PostScript and write it to 'filename'. </p>
85 <div class="fragment"><pre class="fragment">
92 </pre></div><p> Produce a secondary structure graph in PostScript including additional annotation macros and write it to 'filename'. </p>
93 <div class="fragment"><pre class="fragment">
94 int gmlRNA (char *string,
98 </pre></div><p> Produce a secondary structure graph in Graph Meta Language (gml) and write it to a file. </p>
99 <div class="fragment"><pre class="fragment">
100 int ssv_rna_plot (char *string,
103 </pre></div><p> Produce a secondary structure graph in SStructView format. </p>
104 <div class="fragment"><pre class="fragment">
105 int svg_rna_plot (char *string,
108 </pre></div><p> Produce a secondary structure plot in SVG format and write it to a file. </p>
109 <div class="fragment"><pre class="fragment">
110 int xrna_plot ( char *string,
113 </pre></div><p> Produce a secondary structure plot for further editing in XRNA. </p>
114 <div class="fragment"><pre class="fragment">
116 </pre></div><p> Switch for changing the secondary structure layout algorithm. </p>
117 <p>Two low-level functions provide direct access to the graph lauyouting algorithms:</p>
118 <div class="fragment"><pre class="fragment">
119 int simple_xy_coordinates ( short *pair_table,
122 </pre></div><p> Calculate nucleotide coordinates for secondary structure plot the <em>Simple way</em>. </p>
123 <div class="fragment"><pre class="fragment">
124 int naview_xy_coordinates ( short *pair_table,
128 <dl class="see"><dt><b>See also:</b></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>
131 <a href="#toc">Table of Contents</a>
133 <h2><a class="anchor" id="utils_dot">
134 Producing (colored) dot plots for base pair probabilities</a></h2>
135 <div class="fragment"><pre class="fragment">
136 int PS_color_dot_plot ( char *string,
140 <div class="fragment"><pre class="fragment">
141 int PS_color_dot_plot_turn (char *seq,
146 <div class="fragment"><pre class="fragment">
147 int PS_dot_plot_list (char *seq,
152 </pre></div><p> Produce a postscript dot-plot from two pair lists. </p>
153 <div class="fragment"><pre class="fragment">
154 int PS_dot_plot_turn (char *seq,
159 <dl class="see"><dt><b>See also:</b></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>
160 <h2><a class="anchor" id="utils_aln">
161 Producing (colored) alignments</a></h2>
162 <div class="fragment"><pre class="fragment">
164 const char *structure,
165 const char *filename,
171 <a href="#toc">Table of Contents</a>
173 <h2><a class="anchor" id="utils_seq">
174 RNA sequence related utilities</a></h2>
175 <p>Several functions provide useful applications to RNA sequences</p>
176 <div class="fragment"><pre class="fragment">
177 char *random_string (int l,
178 const char symbols[])
179 </pre></div><p> Create a random string using characters from a specified symbol set. </p>
180 <div class="fragment"><pre class="fragment">
181 int hamming ( const char *s1,
183 </pre></div><p> Calculate hamming distance between two sequences. </p>
184 <div class="fragment"><pre class="fragment">
185 void str_DNA2RNA(char *sequence);
186 </pre></div><p> Convert a DNA input sequence to RNA alphabet. </p>
187 <div class="fragment"><pre class="fragment">
188 void str_uppercase(char *sequence);
189 </pre></div><p> Convert an input sequence to uppercase. </p>
192 <a href="#toc">Table of Contents</a>
194 <h2><a class="anchor" id="utils_struc">
195 RNA secondary structure related utilities</a></h2>
196 <div class="fragment"><pre class="fragment">
197 char *pack_structure (const char *struc)
198 </pre></div><p> Pack secondary secondary structure, 5:1 compression using base 3 encoding. </p>
199 <div class="fragment"><pre class="fragment">
200 char *unpack_structure (const char *packed)
201 </pre></div><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>
202 <div class="fragment"><pre class="fragment">
203 short *make_pair_table (const char *structure)
204 </pre></div><p> Create a pair table of a secondary structure. </p>
205 <div class="fragment"><pre class="fragment">
206 short *copy_pair_table (const short *pt)
207 </pre></div><p> Get an exact copy of a pair table. </p>
210 <a href="#toc">Table of Contents</a>
212 <h2><a class="anchor" id="utils_misc">
213 Miscellaneous Utilities</a></h2>
214 <div class="fragment"><pre class="fragment">
215 void print_tty_input_seq (void)
216 </pre></div><p> Print a line to <em>stdout</em> that asks for an input sequence. </p>
217 <div class="fragment"><pre class="fragment">
218 void print_tty_constraint_full (void)
219 </pre></div><p> Print structure constraint characters to stdout (full constraint support). </p>
220 <div class="fragment"><pre class="fragment">
221 void print_tty_constraint (unsigned int option)
222 </pre></div><p> Print structure constraint characters to stdout. (constraint support is specified by option parameter). </p>
223 <div class="fragment"><pre class="fragment">
224 int *get_iindx (unsigned int length)
225 </pre></div><p> Get an index mapper array (iindx) for accessing the energy matrices, e.g. in partition function related functions. </p>
226 <div class="fragment"><pre class="fragment">
227 int *get_indx (unsigned int length)
228 </pre></div><p> Get an index mapper array (indx) for accessing the energy matrices, e.g. in MFE related functions. </p>
229 <div class="fragment"><pre class="fragment">
230 void constrain_ptypes (
231 const char *constraint,
236 unsigned int idx_type)
237 </pre></div><p> Insert constraining pair types according to constraint structure string. </p>
238 <div class="fragment"><pre class="fragment">
239 char *get_line(FILE *fp);
240 </pre></div><p> Read a line of arbitrary length from a stream. </p>
241 <div class="fragment"><pre class="fragment">
242 unsigned int read_record(
246 unsigned int options);
247 </pre></div><p> Get a data record from stdin. </p>
248 <div class="fragment"><pre class="fragment">
249 char *time_stamp (void)
250 </pre></div><p> Get a timestamp. </p>
251 <div class="fragment"><pre class="fragment">
252 void warn_user (const char message[])
253 </pre></div><p> Print a warning message. </p>
254 <div class="fragment"><pre class="fragment">
255 void nrerror (const char message[])
256 </pre></div><p> Die with an error message. </p>
257 <div class="fragment"><pre class="fragment">
258 void init_rand (void)
259 </pre></div><p> Make random number seeds. </p>
260 <div class="fragment"><pre class="fragment">
261 unsigned short xsubi[3];
262 </pre></div><p> Current 48 bit random number. </p>
263 <div class="fragment"><pre class="fragment">
265 </pre></div><p> get a random number from [0..1] </p>
266 <div class="fragment"><pre class="fragment">
267 int int_urn (int from, int to)
268 </pre></div><p> Generates a pseudo random integer in a specified range. </p>
269 <div class="fragment"><pre class="fragment">
270 void *space (unsigned size)
271 </pre></div><p> Allocate space safely. </p>
272 <div class="fragment"><pre class="fragment">
273 void *xrealloc ( void *p,
275 </pre></div><p> Reallocate space safely. </p>
276 <dl class="see"><dt><b>See also:</b></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>
279 <a href="#toc">Table of Contents</a>
281 <p><a class="el" href="mp_example.html">Next Page: Examples</a> </p>
283 <hr size="1"/><address style="text-align: right;"><small>Generated on 11 Apr 2017 for RNAlib-2.1.2 by
284 <a href="http://www.doxygen.org/index.html">
285 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>