Functions for Creating RNA Secondary Structures Plots, Dot-Plots, and More
Utilities
Collaboration diagram for Functions for Creating RNA Secondary Structures Plots, Dot-Plots, and More:

## Files

file | naview.h
file | plot_aln.h
| Various functions for plotting Sequence / Structure Alignments.
file | plot_layouts.h
| Secondary structure plot layout algorithms.
file | plot_structure.h
| Various functions for plotting RNA secondary structures.
file | PS_dot.h
| Various functions for plotting RNA secondary structures, dot-plots and other visualizations.

## Data Structures

struct | COORDINATE
| this is a workarround for the SWIG Perl Wrapper RNA plot function that returns an array of type COORDINATE More...

## Macros

#define | VRNA_PLOT_TYPE_SIMPLE 0
| Definition of Plot type simple More...
#define | VRNA_PLOT_TYPE_NAVIEW 1
| Definition of Plot type Naview More...
#define | VRNA_PLOT_TYPE_CIRCULAR 2
| Definition of Plot type Circular More...

## Functions

int | PS_color_aln (const char *structure, const char *filename, const char *seqs[], const char *names[])
| Produce PostScript sequence alignment color-annotated by consensus structure.
int | aliPS_color_aln (const char *structure, const char *filename, const char *seqs[], const char *names[])
int | simple_xy_coordinates (short *pair_table, float *X, float *Y)
| Calculate nucleotide coordinates for secondary structure plot the Simple way More...
int | simple_circplot_coordinates (short *pair_table, float *x, float *y)
| Calculate nucleotide coordinates for Circular Plot More...
int | vrna_file_PS_rnaplot (const char *seq, const char *structure, const char *file, vrna_md_t *md_p)
| Produce a secondary structure graph in PostScript and write it to 'filename'. More...
int | vrna_file_PS_rnaplot_a (const char *seq, const char *structure, const char *file, const char *pre, const char *post, vrna_md_t *md_p)
| Produce a secondary structure graph in PostScript including additional annotation macros and write it to 'filename'. More...
int | gmlRNA (char *string, char *structure, char *ssfile, char option)
| Produce a secondary structure graph in Graph Meta Language (gml) and write it to a file. More...
int | ssv_rna_plot (char *string, char *structure, char *ssfile)
| Produce a secondary structure graph in SStructView format. More...
int | svg_rna_plot (char *string, char *structure, char *ssfile)
| Produce a secondary structure plot in SVG format and write it to a file. More...
int | xrna_plot (char *string, char *structure, char *ssfile)
| Produce a secondary structure plot for further editing in XRNA. More...
int | PS_rna_plot (char *string, char *structure, char *file)
| Produce a secondary structure graph in PostScript and write it to 'filename'. More...
int | PS_rna_plot_a (char *string, char *structure, char *file, char *pre, char *post)
| Produce a secondary structure graph in PostScript including additional annotation macros and write it to 'filename'. More...
int | PS_rna_plot_a_gquad (char *string, char *structure, char *ssfile, char *pre, char *post)
| Produce a secondary structure graph in PostScript including additional annotation macros and write it to 'filename' (detect and draw g-quadruplexes) More...
int | PS_dot_plot_list (char *seq, char *filename, plist *pl, plist *mf, char *comment)
| Produce a postscript dot-plot from two pair lists. More...
int | PS_dot_plot (char *string, char *file)
| Produce postscript dot-plot. More...

## Variables

int | rna_plot_type
| Switch for changing the secondary structure layout algorithm. More...

## Detailed Description

## Data Structure Documentation

struct COORDINATE

this is a workarround for the SWIG Perl Wrapper RNA plot function that returns an array of type COORDINATE

## Macro Definition Documentation

#define VRNA_PLOT_TYPE_SIMPLE 0

`#include <ViennaRNA/plot_layouts.h>`

Definition of Plot type simple

This is the plot type definition for several RNA structure plotting functions telling them to use Simple plotting algorithm

See also
  rna_plot_type, vrna_file_PS_rnaplot_a(), vrna_file_PS_rnaplot(), svg_rna_plot(), gmlRNA(), ssv_rna_plot(), xrna_plot()

#define VRNA_PLOT_TYPE_NAVIEW 1

`#include <ViennaRNA/plot_layouts.h>`

Definition of Plot type Naview

This is the plot type definition for several RNA structure plotting functions telling them to use Naview plotting algorithm

See also
  rna_plot_type, vrna_file_PS_rnaplot_a(), vrna_file_PS_rnaplot(), svg_rna_plot(), gmlRNA(), ssv_rna_plot(), xrna_plot()

#define VRNA_PLOT_TYPE_CIRCULAR 2

`#include <ViennaRNA/plot_layouts.h>`

Definition of Plot type Circular

This is the plot type definition for several RNA structure plotting functions telling them to produce a Circular plot

See also
  rna_plot_type, vrna_file_PS_rnaplot_a(), vrna_file_PS_rnaplot(), svg_rna_plot(), gmlRNA(), ssv_rna_plot(), xrna_plot()

## Function Documentation

int aliPS_color_aln | ( | const char * | structure,
|  | const char * | filename,
|  | const char * | seqs[],
|  | const char * | names[]
| ) |  |

`#include <ViennaRNA/plot_aln.h>`

PS_color_aln for duplexes

int simple_xy_coordinates | ( | short * | pair_table,
|  | float * | X,
|  | float * | Y
| ) |  |

`#include <ViennaRNA/plot_layouts.h>`

Calculate nucleotide coordinates for secondary structure plot the Simple way

See also
  make_pair_table(), rna_plot_type, simple_circplot_coordinates(), naview_xy_coordinates(), vrna_file_PS_rnaplot_a(), vrna_file_PS_rnaplot, svg_rna_plot()

Parameters

  pair_table | The pair table of the secondary structure
  X | a pointer to an array with enough allocated space to hold the x coordinates
  Y | a pointer to an array with enough allocated space to hold the y coordinates

Returns
  length of sequence on success, 0 otherwise

int simple_circplot_coordinates | ( | short * | pair_table,
|  | float * | x,
|  | float * | y
| ) |  |

`#include <ViennaRNA/plot_layouts.h>`

Calculate nucleotide coordinates for Circular Plot

This function calculates the coordinates of nucleotides mapped in equal distancies onto a unit circle.

Note
  In order to draw nice arcs using quadratic bezier curves that connect base pairs one may calculate a second tangential point in addition to the actual R2 coordinates. the simplest way to do so may be to compute a radius scaling factor in the interval that weights the proportion of base pair span to the actual length of the sequence. This scaling factor can then be used to calculate the coordinates for , i.e. and .

See also
  make_pair_table(), rna_plot_type, simple_xy_coordinates(), naview_xy_coordinates(), vrna_file_PS_rnaplot_a(), vrna_file_PS_rnaplot, svg_rna_plot()

Parameters

  pair_table | The pair table of the secondary structure
  x | a pointer to an array with enough allocated space to hold the x coordinates
  y | a pointer to an array with enough allocated space to hold the y coordinates

Returns
  length of sequence on success, 0 otherwise

int vrna_file_PS_rnaplot | ( | const char * | seq,
|  | const char * | structure,
|  | const char * | file,
|  | vrna_md_t * | md_p
| ) |  |

`#include <ViennaRNA/plot_structure.h>`

Produce a secondary structure graph in PostScript and write it to 'filename'.

Note that this function has changed from previous versions and now expects the structure to be plotted in dot-bracket notation as an argument. It does not make use of the global base_pair array anymore.

Parameters

  seq | The RNA sequence
  structure | The secondary structure in dot-bracket notation
  file | The filename of the postscript output
  md_p | Model parameters used to generate a commandline option string in the output (Maybe NULL)

Returns
  1 on success, 0 otherwise

int vrna_file_PS_rnaplot_a | ( | const char * | seq,
|  | const char * | structure,
|  | const char * | file,
|  | const char * | pre,
|  | const char * | post,
|  | vrna_md_t * | md_p
| ) |  |

`#include <ViennaRNA/plot_structure.h>`

Produce a secondary structure graph in PostScript including additional annotation macros and write it to 'filename'.

Same as vrna_file_PS_rnaplot() but adds extra PostScript macros for various annotations (see generated PS code). The 'pre' and 'post' variables contain PostScript code that is verbatim copied in the resulting PS file just before and after the structure plot. If both arguments ('pre' and 'post') are NULL, no additional macros will be printed into the PostScript.

Parameters

  seq | The RNA sequence
  structure | The secondary structure in dot-bracket notation
  file | The filename of the postscript output
  pre | PostScript code to appear before the secondary structure plot
  post | PostScript code to appear after the secondary structure plot
  md_p | Model parameters used to generate a commandline option string in the output (Maybe NULL)

Returns
  1 on success, 0 otherwise

int gmlRNA | ( | char * | string,
|  | char * | structure,
|  | char * | ssfile,
|  | char | option
| ) |  |

`#include <ViennaRNA/plot_structure.h>`

Produce a secondary structure graph in Graph Meta Language (gml) and write it to a file.

If 'option' is an uppercase letter the RNA sequence is used to label nodes, if 'option' equals 'X' or 'x' the resulting file will coordinates for an initial layout of the graph.

Parameters

  string | The RNA sequence
  structure | The secondary structure in dot-bracket notation
  ssfile | The filename of the gml output
  option | The option flag

Returns
  1 on success, 0 otherwise

int ssv_rna_plot | ( | char * | string,
|  | char * | structure,
|  | char * | ssfile
| ) |  |

`#include <ViennaRNA/plot_structure.h>`

Produce a secondary structure graph in SStructView format.

Write coord file for SStructView

Parameters

  string | The RNA sequence
  structure | The secondary structure in dot-bracket notation
  ssfile | The filename of the ssv output

Returns
  1 on success, 0 otherwise

int svg_rna_plot | ( | char * | string,
|  | char * | structure,
|  | char * | ssfile
| ) |  |

`#include <ViennaRNA/plot_structure.h>`

Produce a secondary structure plot in SVG format and write it to a file.

Parameters

  string | The RNA sequence
  structure | The secondary structure in dot-bracket notation
  ssfile | The filename of the svg output

Returns
  1 on success, 0 otherwise

int xrna_plot | ( | char * | string,
|  | char * | structure,
|  | char * | ssfile
| ) |  |

`#include <ViennaRNA/plot_structure.h>`

Produce a secondary structure plot for further editing in XRNA.

Parameters

  string | The RNA sequence
  structure | The secondary structure in dot-bracket notation
  ssfile | The filename of the xrna output

Returns
  1 on success, 0 otherwise

int PS_rna_plot | ( | char * | string,
|  | char * | structure,
|  | char * | file
| ) |  |

`#include <ViennaRNA/plot_structure.h>`

Produce a secondary structure graph in PostScript and write it to 'filename'.

Deprecated:
  Use vrna_file_PS_rnaplot() instead!

int PS_rna_plot_a | ( | char * | string,
|  | char * | structure,
|  | char * | file,
|  | char * | pre,
|  | char * | post
| ) |  |

`#include <ViennaRNA/plot_structure.h>`

Produce a secondary structure graph in PostScript including additional annotation macros and write it to 'filename'.

Deprecated:
  Use vrna_file_PS_rnaplot_a() instead!

int PS_rna_plot_a_gquad | ( | char * | string,
|  | char * | structure,
|  | char * | ssfile,
|  | char * | pre,
|  | char * | post
| ) |  |

`#include <ViennaRNA/plot_structure.h>`

Produce a secondary structure graph in PostScript including additional annotation macros and write it to 'filename' (detect and draw g-quadruplexes)

Deprecated:
  Use vrna_file_PS_rnaplot_a() instead!

int PS_dot_plot_list | ( | char * | seq,
|  | char * | filename,
|  | plist * | pl,
|  | plist * | mf,
|  | char * | comment
| ) |  |

`#include <ViennaRNA/PS_dot.h>`

Produce a postscript dot-plot from two pair lists.

This function reads two plist structures (e.g. base pair probabilities and a secondary structure) as produced by assign_plist_from_pr() and assign_plist_from_db() and produces a postscript "dot plot" that is written to 'filename'.
Using base pair probabilities in the first and mfe structure in the second plist, the resulting "dot plot" represents each base pairing probability by a square of corresponding area in a upper triangle matrix. The lower part of the matrix contains the minimum free energy structure.

See also
  assign_plist_from_pr(), assign_plist_from_db()

Parameters

  seq | The RNA sequence
  filename | A filename for the postscript output
  pl | The base pair probability pairlist
  mf | The mfe secondary structure pairlist
  comment | A comment

Returns
  1 if postscript was successfully written, 0 otherwise

int PS_dot_plot | ( | char * | string,
|  | char * | file
| ) |  |

`#include <ViennaRNA/PS_dot.h>`

Produce postscript dot-plot.

Wrapper to PS_dot_plot_list

Reads base pair probabilities produced by pf_fold() from the global array pr and the pair list base_pair produced by fold() and produces a postscript "dot plot" that is written to 'filename'. The "dot plot" represents each base pairing probability by a square of corresponding area in a upper triangle matrix. The lower part of the matrix contains the minimum free energy

Note
  DO NOT USE THIS FUNCTION ANYMORE SINCE IT IS NOT THREADSAFE

Deprecated:
  This function is deprecated and will be removed soon! Use PS_dot_plot_list() instead!

## Variable Documentation

int rna_plot_type

`#include <ViennaRNA/plot_layouts.h>`

Switch for changing the secondary structure layout algorithm.

Current possibility are 0 for a simple radial drawing or 1 for the modified radial drawing taken from the naview program of Bruccoleri & Heinrich (1988).

Note
  To provide thread safety please do not rely on this global variable in future implementations but pass a plot type flag directly to the function that decides which layout algorithm it may use!

See also
  VRNA_PLOT_TYPE_SIMPLE, VRNA_PLOT_TYPE_NAVIEW, VRNA_PLOT_TYPE_CIRCULAR