Replace Progs/RNAalifold with x64 binary and add all other programs
[jabaws.git] / binaries / src / ViennaRNA / H / PS_dot.h
1 #ifndef __VIENNA_RNA_PACKAGE_PS_DOT_H__
2 #define __VIENNA_RNA_PACKAGE_PS_DOT_H__
3
4 #include "data_structures.h"
5 #include "plot_layouts.h"
6
7 #ifdef __GNUC__
8 #define DEPRECATED(func) func __attribute__ ((deprecated))
9 #else
10 #define DEPRECATED(func) func
11 #endif
12
13 /**
14  *  \file PS_dot.h
15  *  \brief Various functions for plotting RNA secondary structures, dot-plots and other
16  *  visualizations
17  */
18
19 /* write PostScript drawing of structure to file with annotation */
20 int PS_rna_plot_snoop_a(char *string,
21                         char *structure,
22                         char *ssfile,
23                         int *relative_access,
24                         const char *seqs[]);
25
26 /**
27  *  \brief Produce a secondary structure graph in PostScript and write it to 'filename'.
28  *
29  *  Note that this function has changed from previous versions
30  *  and now expects the structure to be plotted in dot-bracket notation as an
31  *  argument. It does not make use of the global #base_pair array anymore.
32  *
33  *  \param string     The RNA sequence
34  *  \param structure  The secondary structure in dot-bracket notation
35  *  \param file       The filename of the postscript output
36  *  \return           1 on success, 0 otherwise
37  */
38 int PS_rna_plot(char *string,
39                 char *structure,
40                 char *file);
41
42 /**
43  *  \brief Produce a secondary structure graph in PostScript including additional
44  *  annotation macros and write it to 'filename'
45  *
46  *  Same as PS_rna_plot() but adds extra PostScript macros for various
47  *  annotations (see generated PS code). The 'pre' and 'post'
48  *  variables contain PostScript code that is verbatim copied in the
49  *  resulting PS file just before and after the structure plot.
50  *  If both arguments ('pre' and 'post') are NULL, no additional macros will
51  *  be printed into the PostScript.
52  *
53  *  \param string     The RNA sequence
54  *  \param structure  The secondary structure in dot-bracket notation
55  *  \param file       The filename of the postscript output
56  *  \param pre        PostScript code to appear before the secondary structure plot
57  *  \param post       PostScript code to appear after the secondary structure plot
58  *  \return           1 on success, 0 otherwise
59  */
60 int PS_rna_plot_a(char *string,
61                   char *structure,
62                   char *file,
63                   char *pre,
64                   char *post);
65
66 int PS_rna_plot_a_gquad(char *string,
67                         char *structure,
68                         char *ssfile,
69                         char *pre,
70                         char *post);
71
72 /**
73  *  \brief Produce a secondary structure graph in Graph Meta Language (gml) and write it to a file
74  *
75  *  If 'option' is an uppercase letter the RNA sequence is used to label nodes, if 'option' equals
76  *  \a 'X' or \a 'x' the resulting file will coordinates for an initial layout of the graph.
77  *
78  *  \param  string    The RNA sequence
79  *  \param  structure The secondary structure in dot-bracket notation
80  *  \param  ssfile    The filename of the gml output
81  *  \param  option    The option flag
82  *  \return           1 on success, 0 otherwise
83  */
84 int gmlRNA( char *string,
85             char *structure,
86             char *ssfile,
87             char option);
88
89 /**
90  *  \brief  Produce a secondary structure graph in SStructView format
91  *
92  *  Write coord file for SStructView
93  *
94  *  \param  string    The RNA sequence
95  *  \param  structure The secondary structure in dot-bracket notation
96  *  \param  ssfile    The filename of the ssv output
97  *  \return           1 on success, 0 otherwise
98  */
99 int ssv_rna_plot( char *string,
100                   char *structure,
101                   char *ssfile);
102
103 /**
104  *  \brief Produce a secondary structure plot in SVG format and write it to a file
105  *
106  *  \param string     The RNA sequence
107  *  \param structure  The secondary structure in dot-bracket notation
108  *  \param ssfile     The filename of the svg output
109  *  \return           1 on success, 0 otherwise
110  */
111 int svg_rna_plot( char *string,
112                   char *structure,
113                   char *ssfile);
114
115 /**
116  *  \brief Produce a secondary structure plot for further editing in XRNA
117  *
118  *  \param string     The RNA sequence
119  *  \param structure  The secondary structure in dot-bracket notation
120  *  \param ssfile     The filename of the xrna output
121  *  \return           1 on success, 0 otherwise
122  */
123 int xrna_plot(char *string,
124               char *structure,
125               char *ssfile);
126
127 int PS_color_dot_plot(char *string,
128                       cpair *pi,
129                       char *filename);
130
131 int PS_color_dot_plot_turn( char *seq,
132                             cpair *pi,
133                             char *filename,
134                             int winSize);
135
136 /**
137  *  \brief Produce a postscript dot-plot from two pair lists
138  *
139  *  This function reads two plist structures (e.g. base pair probabilities and a secondary structure)
140  *  as produced by assign_plist_from_pr() and assign_plist_from_db() and produces a postscript
141  *  "dot plot" that is written to 'filename'.\n
142  *  Using base pair probabilities in the first and mfe structure in the second plist, the resulting
143  *  "dot plot" represents each base pairing probability by a square of corresponding area in a upper
144  *  triangle matrix. The lower part of the matrix contains the minimum free energy structure.
145  *
146  *  \see assign_plist_from_pr(), assign_plist_from_db()
147  *
148  *  \param seq      The RNA sequence
149  *  \param filename A filename for the postscript output
150  *  \param pl       The base pair probability pairlist
151  *  \param mf       The mfe secondary structure pairlist
152  *  \param comment  A comment
153  *  \return         1 if postscript was successfully written, 0 otherwise
154  */
155 int PS_dot_plot_list( char *seq,
156                       char *filename,
157                       plist *pl,
158                       plist *mf,
159                       char *comment);
160
161 int PS_dot_plot_turn( char *seq,
162                       struct plist *pl,
163                       char *filename,
164                       int winSize);
165
166 int PS_color_aln( const char *structure,
167                   const char *filename,
168                   const char *seqs[],
169                   const char *names[]);
170
171 /**
172  *      PS_color_aln for duplexes
173 */
174 int aliPS_color_aln(const char *structure,
175                     const char *filename, 
176                     const char *seqs[],
177                     const char *names[]); 
178
179
180 /**
181  *  Wrapper to PS_dot_plot_list
182  *
183  *  \brief Produce postscript dot-plot
184  *
185  *  Reads base pair probabilities produced by pf_fold() from the
186  *  global array #pr and the pair list #base_pair produced by
187  *  fold() and produces a postscript "dot plot" that is written to
188  *  'filename'. The "dot plot" represents each base pairing
189  *  probability by a square of corresponding area in a upper triangle
190  *  matrix. The lower part of the matrix contains the minimum free energy
191  *  \note DO NOT USE THIS FUNCTION ANYMORE SINCE IT IS NOT THREADSAFE
192  *
193  *  \deprecated This function is deprecated and will be removed soon! Use \ref PS_dot_plot_list() instead!
194  */
195 DEPRECATED(int PS_dot_plot( char *string,
196                             char *file));
197 #endif