a522e9ed479666954a6c88cdf9e7b0835c3bea08
[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 <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"/>
8 </head>
9 <body>
10 <!-- Generated by Doxygen 1.6.1 -->
11 <script type="text/javascript">
12 <!--
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';
20   }else{
21     sectionDiv.style.display='none';
22     button.src='closed.gif';
23   }
24 }
25 function initDynSections(){
26   var divs=document.getElementsByTagName('div');
27   var sectionCounter=1;
28   for(var i=0;i<divs.length-1;i++){
29     if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){
30       var header=divs[i];
31       var section=divs[i+1];
32       var button=header.firstChild;
33       if (button!='IMG'){
34         divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild);
35         button=document.createElement('img');
36         divs[i].insertBefore(button,divs[i].firstChild);
37       }
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';
45       sectionCounter++;
46     }
47   }
48 }
49 window.onload = initDynSections;
50 -->
51 </script>
52 <div class="navigation" id="top">
53   <div class="tabs">
54     <ul>
55       <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
56       <li class="current"><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
57       <li><a href="modules.html"><span>Modules</span></a></li>
58       <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
59       <li><a href="files.html"><span>Files</span></a></li>
60     </ul>
61   </div>
62 </div>
63 <div class="contents">
64
65
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>
68 <hr/>
69 <ul>
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>
76 </ul>
77 <hr/>
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,
82                   char *structure,
83                   char *file)
84 </pre></div><p> Produce a secondary structure graph in PostScript and write it to 'filename'. </p>
85 <div class="fragment"><pre class="fragment">
86 int PS_rna_plot_a (
87             char *string,
88             char *structure,
89             char *file,
90             char *pre,
91             char *post)
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,
95             char *structure,
96             char *ssfile,
97             char option)
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,
101                   char *structure,
102                   char *ssfile)
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,
106                   char *structure,
107                   char *ssfile)
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,
111                 char *structure,
112                 char *ssfile)
113 </pre></div><p> Produce a secondary structure plot for further editing in XRNA. </p>
114 <div class="fragment"><pre class="fragment">
115 int rna_plot_type
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,
120                             float *X,
121                             float *Y)
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,
125                             float *X,
126                             float *Y)
127 </pre></div><p> </p>
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>
129  
130 <hr>
131 <a href="#toc">Table of Contents</a>
132 <hr>
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,
137                         cpair *pi,
138                         char *filename)
139 </pre></div><p> </p>
140 <div class="fragment"><pre class="fragment">
141 int PS_color_dot_plot_turn (char *seq,
142                             cpair *pi,
143                             char *filename,
144                             int winSize)
145 </pre></div><p> </p>
146 <div class="fragment"><pre class="fragment">
147 int PS_dot_plot_list (char *seq,
148                       char *filename,
149                       plist *pl,
150                       plist *mf,
151                       char *comment)
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,
155                       struct plist *pl,
156                       char *filename,
157                       int winSize)
158 </pre></div><p> </p>
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">
163 int PS_color_aln (
164             const char *structure,
165             const char *filename,
166             const char *seqs[],
167             const char *names[])
168 </pre></div><p> </p>
169  
170 <hr>
171 <a href="#toc">Table of Contents</a>
172 <hr>
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,
182                 const char *s2)
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>
190  
191 <hr>
192 <a href="#toc">Table of Contents</a>
193 <hr>
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>
208  
209 <hr>
210 <a href="#toc">Table of Contents</a>
211 <hr>
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,
232                 unsigned int length,
233                 char *ptype,
234                 int *BP,
235                 int min_loop_size,
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(
243                 char **header,
244                 char **sequence,
245                 char ***rest,
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">
264 double urn (void)
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,
274                   unsigned size)
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>
277  
278 <hr>
279 <a href="#toc">Table of Contents</a>
280 <hr>
281 <p><a class="el" href="mp_example.html">Next Page: Examples</a> </p>
282 </div>
283 <hr size="1"/><address style="text-align: right;"><small>Generated on 11 Apr 2017 for RNAlib-2.1.2 by&nbsp;
284 <a href="http://www.doxygen.org/index.html">
285 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
286 </body>
287 </html>