Replace Progs/RNAalifold with x64 binary and add all other programs
[jabaws.git] / binaries / src / ViennaRNA / H / plot_layouts.h
1 /**
2  * \file plot_layouts.h
3  *
4  * \brief Secondary structure plot layout algorithms
5  *
6  *  c Ronny Lorenz
7  *    The ViennaRNA Package
8  */
9 #ifndef __VIENNA_RNA_PACKAGE_PLOT_LAYOUTS_H__
10 #define __VIENNA_RNA_PACKAGE_PLOT_LAYOUTS_H__
11
12 #include "data_structures.h"
13 #include "naview.h"
14
15 #ifndef PI
16 #define  PI       3.141592654
17 #endif
18 #define  PIHALF       PI/2.
19
20
21 /**
22  *  \brief Definition of Plot type <i>simple</i>
23  *
24  *  This is the plot type definition for several RNA structure plotting functions telling
25  *  them to use <b>Simple</b> plotting algorithm
26  *
27  *  \see rna_plot_type, PS_rna_plot_a(), PS_rna_plot(), svg_rna_plot(), gmlRNA(), ssv_rna_plot(), xrna_plot()
28  */
29 #define VRNA_PLOT_TYPE_SIMPLE     0
30
31 /**
32  *  \brief Definition of Plot type <i>Naview</i>
33  *
34  *  This is the plot type definition for several RNA structure plotting functions telling
35  *  them to use <b>Naview</b> plotting algorithm
36  *
37  *  \see rna_plot_type, PS_rna_plot_a(), PS_rna_plot(), svg_rna_plot(), gmlRNA(), ssv_rna_plot(), xrna_plot()
38  */
39 #define VRNA_PLOT_TYPE_NAVIEW     1
40
41 /**
42  *  \brief Definition of Plot type <i>Circular</i>
43  *
44  *  This is the plot type definition for several RNA structure plotting functions telling
45  *  them to produce a <b>Circular plot</b>
46  *
47  *  \see rna_plot_type, PS_rna_plot_a(), PS_rna_plot(), svg_rna_plot(), gmlRNA(), ssv_rna_plot(), xrna_plot()
48  */
49 #define VRNA_PLOT_TYPE_CIRCULAR   2
50
51
52 /**
53  *  \brief Switch for changing the secondary structure layout algorithm
54  *
55  *  Current possibility are 0 for a simple radial drawing or 1 for the modified
56  *  radial drawing taken from the \e naview program of \ref bruccoleri_88 "Bruccoleri & Heinrich (1988)".
57  *
58  *  \note To provide thread safety please do not rely on this global variable in future implementations
59  *  but pass a plot type flag directly to the function that decides which layout algorithm it may use!
60  *
61  *  \see #VRNA_PLOT_TYPE_SIMPLE, #VRNA_PLOT_TYPE_NAVIEW, #VRNA_PLOT_TYPE_CIRCULAR
62  *
63  */
64 extern int rna_plot_type;
65
66 /**
67  *  \brief Calculate nucleotide coordinates for secondary structure plot the <i>Simple way</i>
68  *
69  *  \see make_pair_table(), rna_plot_type, simple_circplot_coordinates(), naview_xy_coordinates(), PS_rna_plot_a(),
70  *  PS_rna_plot, svg_rna_plot()
71  *
72  *  \param  pair_table  The pair table of the secondary structure
73  *  \param  X           a pointer to an array with enough allocated space to hold the x coordinates
74  *  \param  Y           a pointer to an array with enough allocated space to hold the y coordinates
75  *  \return             length of sequence on success, 0 otherwise
76  */
77 int simple_xy_coordinates(short *pair_table,
78                           float *X,
79                           float *Y);
80
81 /**
82  *  \brief Calculate nucleotide coordinates for <i>Circular Plot</i>
83  *
84  *  This function calculates the coordinates of nucleotides mapped in equal distancies onto a unit circle.
85  *
86  *  \note In order to draw nice arcs using quadratic bezier curves that connect base pairs one may calculate
87  *  a second tangential point \f$P^t\f$ in addition to the actual R<sup>2</sup> coordinates.
88  *  the simplest way to do so may be to compute a radius scaling factor \f$rs\f$ in the interval \f$[0,1]\f$ that
89  *  weights the proportion of base pair span to the actual length of the sequence. This scaling factor
90  *  can then be used to calculate the coordinates for \f$P^t\f$, i.e. \f$ P^{t}_x[i] = X[i] * rs\f$
91  *  and \f$P^{t}_y[i] = Y[i] * rs\f$.
92  *
93  *  \see make_pair_table(), rna_plot_type, simple_xy_coordinates(), naview_xy_coordinates(), PS_rna_plot_a(),
94  *  PS_rna_plot, svg_rna_plot()
95  *
96  *  \param  pair_table  The pair table of the secondary structure
97  *  \param  x           a pointer to an array with enough allocated space to hold the x coordinates
98  *  \param  y           a pointer to an array with enough allocated space to hold the y coordinates
99  *  \return             length of sequence on success, 0 otherwise
100  */
101 int simple_circplot_coordinates(short *pair_table,
102                                 float *x,
103                                 float *y);
104
105
106 #endif