1 #ifndef VIENNA_RNA_PACKAGE_PLOT_NAVIEW_H
2 #define VIENNA_RNA_PACKAGE_PLOT_NAVIEW_H
3 
4 #ifdef VRNA_WARN_DEPRECATED
5 # if defined(__clang__)
6 #  define DEPRECATED(func, msg) func __attribute__ ((deprecated("", msg)))
7 # elif defined(__GNUC__)
8 #  define DEPRECATED(func, msg) func __attribute__ ((deprecated(msg)))
9 # else
10 #  define DEPRECATED(func, msg) func
11 # endif
12 #else
13 # define DEPRECATED(func, msg) func
14 #endif
15 
16 /**
17  *  @file ViennaRNA/plotting/naview.h
18  *  @ingroup  plotting_utils
19  *  @brief    Implementation of the Naview RNA secondary structure layout algorithm @cite bruccoleri:1988
20  *
21  */
22 
23 /**
24  *  @addtogroup   plot_layout_utils
25  *  @{
26  */
27 
28 
29 /**
30  *  @brief Compute nucleotide coordinates for secondary structure plot using the <i>Naview</i> algorithm @cite bruccoleri:1988
31  *
32  *  This function basically is a wrapper to vrna_plot_coords() that passes the @p plot_type #VRNA_PLOT_TYPE_NAVIEW.
33  *
34  *  Here is a simple example how to use this function, assuming variable @p structure contains
35  *  a valid dot-bracket string:
36  *  @code{.c}
37  *  float *x, *y;
38  *
39  *  if (vrna_plot_coords_naview(structure, &x, &y)) {
40  *    printf("all fine");
41  *  } else {
42  *    printf("some failure occured!");
43  *  }
44  *
45  *  free(x);
46  *  free(y);
47  *  @endcode
48  *
49  *  @note On success, this function allocates memory for X and Y coordinates and assigns
50  *  the pointers at addressess @p x and @p y to the corresponding memory locations. It's
51  *  the users responsibility to cleanup this memory after usage!
52  *
53  *  @see  vrna_plot_coords(), vrna_plot_coords_simple_pt(), vrna_plot_coords_circular(),
54  *        vrna_plot_coords_simple(), vrna_plot_coords_turtle(), vrna_plot_coords_puzzler()
55  *
56  *  @param        structure   The secondary structure in dot-bracket notation
57  *  @param[inout] x           The address of a pointer of X coordinates (pointer will point to memory, or NULL on failure)
58  *  @param[inout] y           The address of a pointer of Y coordinates (pointer will point to memory, or NULL on failure)
59  *  @return                   The length of the structure on success, 0 otherwise
60  */
61 int
62 vrna_plot_coords_naview(const char  *structure,
63                         float       **x,
64                         float       **y);
65 
66 
67 /**
68  *  @brief Compute nucleotide coordinates for secondary structure plot using the <i>Naview</i> algorithm @cite bruccoleri:1988
69  *
70  *  Same as vrna_plot_coords_naview() but takes a pair table with the structure
71  *  information as input.
72  *
73  *  @note On success, this function allocates memory for X and Y coordinates and assigns
74  *  the pointers at addressess @p x and @p y to the corresponding memory locations. It's
75  *  the users responsibility to cleanup this memory after usage!
76  *
77  *  @see  vrna_plot_coords_pt(), vrna_plot_coords_naview(), vrna_plot_coords_circular_pt(),
78  *        vrna_plot_coords_simple_pt(), vrna_plot_coords_turtle_pt(), vrna_plot_coords_puzzler_pt()
79  *
80  *  @param        pt          The pair table that holds the secondary structure
81  *  @param[inout] x           The address of a pointer of X coordinates (pointer will point to memory, or NULL on failure)
82  *  @param[inout] y           The address of a pointer of Y coordinates (pointer will point to memory, or NULL on failure)
83  *  @return                   The length of the structure on success, 0 otherwise
84  */
85 int
86 vrna_plot_coords_naview_pt(const short  *pt,
87                            float        **x,
88                            float        **y);
89 
90 
91 /**
92  * @}
93  */
94 
95 
96 #ifndef VRNA_DISABLE_BACKWARD_COMPATIBILITY
97 
98 /**
99  *  @addtogroup   plotting_utils_deprecated
100  *  @{
101  */
102 
103 /**
104  *  @deprecated   Consider using vrna_plot_coords_naview_pt() instead!
105  */
106 DEPRECATED(int
107            naview_xy_coordinates(short  *pair_table,
108                                  float  *X,
109                                  float  *Y),
110            "Use vrna_plot_coords_naview_pt() instead!");
111 
112 #endif
113 
114 /**
115  * @}
116  */
117 
118 
119 #endif
120