Plotting#

Functions for Creating Secondary Structure Plots, Dot-Plots, and more.

Layouts and Coordinates#

Functions to compute coordinate layouts for secondary structure plots.

Defines

VRNA_PLOT_TYPE_SIMPLE#

Definition of Plot type simple.

#include <ViennaRNA/plotting/layouts.h>

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

VRNA_PLOT_TYPE_NAVIEW#

Definition of Plot type Naview.

#include <ViennaRNA/plotting/layouts.h>

This is the plot type definition for several RNA structure plotting functions telling them to use Naview plotting algorithm [Bruccoleri and Heinrich, 1988] .

VRNA_PLOT_TYPE_CIRCULAR#

Definition of Plot type Circular.

#include <ViennaRNA/plotting/layouts.h>

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

VRNA_PLOT_TYPE_TURTLE#

Definition of Plot type Turtle [Wiegreffe et al., 2019] .

#include <ViennaRNA/plotting/layouts.h>
VRNA_PLOT_TYPE_PUZZLER#

Definition of Plot type RNApuzzler [Wiegreffe et al., 2019] .

#include <ViennaRNA/plotting/layouts.h>
VRNA_PLOT_TYPE_DEFAULT#
#include <ViennaRNA/plotting/layouts.h>

Typedefs

typedef struct vrna_plot_layout_s vrna_plot_layout_t#

RNA secondary structure figure layout.

#include <ViennaRNA/plotting/layouts.h>

Functions

vrna_plot_layout_t *vrna_plot_layout(const char *structure, unsigned int plot_type)#

Create a layout (coordinates, etc.) for a secondary structure plot.

#include <ViennaRNA/plotting/layouts.h>

This function can be used to create a secondary structure nucleotide layout that is then further processed by an actual plotting function. The layout algorithm can be specified using the plot_type parameter, and the following algorithms are currently supported:

Passing an unsupported selection leads to the default algorithm VRNA_PLOT_TYPE_NAVIEW

Note

If only X-Y coordinates of the corresponding structure layout are required, consider using vrna_plot_coords() instead!

Parameters:
  • structure – The secondary structure in dot-bracket notation

  • plot_type – The layout algorithm to be used

Returns:

The layout data structure for the provided secondary structure

vrna_plot_layout_t *vrna_plot_layout_simple(const char *structure)#

Create a layout (coordinates, etc.) for a simple secondary structure plot.

#include <ViennaRNA/plotting/layouts.h>

This function basically is a wrapper to vrna_plot_layout() that passes the plot_type VRNA_PLOT_TYPE_SIMPLE.

Note

If only X-Y coordinates of the corresponding structure layout are required, consider using vrna_plot_coords_simple() instead!

Parameters:
  • structure – The secondary structure in dot-bracket notation

Returns:

The layout data structure for the provided secondary structure

vrna_plot_layout_t *vrna_plot_layout_circular(const char *structure)#

Create a layout (coordinates, etc.) for a circular secondary structure plot.

#include <ViennaRNA/plotting/layouts.h>

This function basically is a wrapper to vrna_plot_layout() that passes the plot_type VRNA_PLOT_TYPE_CIRCULAR.

Note

If only X-Y coordinates of the corresponding structure layout are required, consider using vrna_plot_coords_circular() instead!

Parameters:
  • structure – The secondary structure in dot-bracket notation

Returns:

The layout data structure for the provided secondary structure

vrna_plot_layout_t *vrna_plot_layout_turtle(const char *structure)#

Create a layout (coordinates, etc.) for a secondary structure plot using the Turtle Algorithm [Wiegreffe et al., 2019] .

#include <ViennaRNA/plotting/layouts.h>

This function basically is a wrapper to vrna_plot_layout() that passes the plot_type VRNA_PLOT_TYPE_TURTLE.

Note

If only X-Y coordinates of the corresponding structure layout are required, consider using vrna_plot_coords_turtle() instead!

Parameters:
  • structure – The secondary structure in dot-bracket notation

Returns:

The layout data structure for the provided secondary structure

vrna_plot_layout_t *vrna_plot_layout_puzzler(const char *structure, vrna_plot_options_puzzler_t *options)#

Create a layout (coordinates, etc.) for a secondary structure plot using the RNApuzzler Algorithm [Wiegreffe et al., 2019] .

#include <ViennaRNA/plotting/layouts.h>

This function basically is a wrapper to vrna_plot_layout() that passes the plot_type VRNA_PLOT_TYPE_PUZZLER.

Note

If only X-Y coordinates of the corresponding structure layout are required, consider using vrna_plot_coords_puzzler() instead!

Parameters:
  • structure – The secondary structure in dot-bracket notation

Returns:

The layout data structure for the provided secondary structure

void vrna_plot_layout_free(vrna_plot_layout_t *layout)#

Free memory occupied by a figure layout data structure.

#include <ViennaRNA/plotting/layouts.h>

Parameters:
  • layout – The layout data structure to free

int vrna_plot_coords(const char *structure, float **x, float **y, int plot_type)#

Compute nucleotide coordinates for secondary structure plot.

#include <ViennaRNA/plotting/layouts.h>

This function takes a secondary structure and computes X-Y coordinates for each nucleotide that then can be used to create a structure plot. The parameter plot_type is used to select the underlying layout algorithm. Currently, the following selections are provided:

Passing an unsupported selection leads to the default algorithm VRNA_PLOT_TYPE_NAVIEW

Here is a simple example how to use this function, assuming variable structure contains a valid dot-bracket string:

float *x, *y;

if (vrna_plot_coords(structure, &x, &y)) {
  printf("all fine");
} else {
  printf("some failure occured!");
}

free(x);
free(y);

Note

On success, this function allocates memory for X and Y coordinates and assigns the pointers at addressess x and y to the corresponding memory locations. It’s the users responsibility to cleanup this memory after usage!

Parameters:
  • structure – The secondary structure in dot-bracket notation

  • x – [inout] The address of a pointer of X coordinates (pointer will point to memory, or NULL on failure)

  • y – [inout] The address of a pointer of Y coordinates (pointer will point to memory, or NULL on failure)

  • plot_type – The layout algorithm to be used

Returns:

The length of the structure on success, 0 otherwise

int vrna_plot_coords_pt(const short *pt, float **x, float **y, int plot_type)#

Compute nucleotide coordinates for secondary structure plot.

#include <ViennaRNA/plotting/layouts.h>

Same as vrna_plot_coords() but takes a pair table with the structure information as input.

Note

On success, this function allocates memory for X and Y coordinates and assigns the pointers at addressess x and y to the corresponding memory locations. It’s the users responsibility to cleanup this memory after usage!

Parameters:
  • pt – The pair table that holds the secondary structure

  • x – [inout] The address of a pointer of X coordinates (pointer will point to memory, or NULL on failure)

  • y – [inout] The address of a pointer of Y coordinates (pointer will point to memory, or NULL on failure)

  • plot_type – The layout algorithm to be used

Returns:

The length of the structure on success, 0 otherwise

int vrna_plot_coords_simple(const char *structure, float **x, float **y)#

Compute nucleotide coordinates for secondary structure plot the Simple way.

#include <ViennaRNA/plotting/layouts.h>

This function basically is a wrapper to vrna_plot_coords() that passes the plot_type VRNA_PLOT_TYPE_SIMPLE.

Here is a simple example how to use this function, assuming variable structure contains a valid dot-bracket string:

float *x, *y;

if (vrna_plot_coords_simple(structure, &x, &y)) {
  printf("all fine");
} else {
  printf("some failure occured!");
}

free(x);
free(y);

Note

On success, this function allocates memory for X and Y coordinates and assigns the pointers at addressess x and y to the corresponding memory locations. It’s the users responsibility to cleanup this memory after usage!

Parameters:
  • structure – The secondary structure in dot-bracket notation

  • x – [inout] The address of a pointer of X coordinates (pointer will point to memory, or NULL on failure)

  • y – [inout] The address of a pointer of Y coordinates (pointer will point to memory, or NULL on failure)

Returns:

The length of the structure on success, 0 otherwise

int vrna_plot_coords_simple_pt(const short *pt, float **x, float **y)#

Compute nucleotide coordinates for secondary structure plot the Simple way.

#include <ViennaRNA/plotting/layouts.h>

Same as vrna_plot_coords_simple() but takes a pair table with the structure information as input.

Note

On success, this function allocates memory for X and Y coordinates and assigns the pointers at addressess x and y to the corresponding memory locations. It’s the users responsibility to cleanup this memory after usage!

Parameters:
  • pt – The pair table that holds the secondary structure

  • x – [inout] The address of a pointer of X coordinates (pointer will point to memory, or NULL on failure)

  • y – [inout] The address of a pointer of Y coordinates (pointer will point to memory, or NULL on failure)

Returns:

The length of the structure on success, 0 otherwise

int vrna_plot_coords_circular(const char *structure, float **x, float **y)#

Compute coordinates of nucleotides mapped in equal distancies onto a unit circle.

#include <ViennaRNA/plotting/layouts.h>

This function basically is a wrapper to vrna_plot_coords() that passes the plot_type VRNA_PLOT_TYPE_CIRCULAR.

In order to draw nice arcs using quadratic bezier curves that connect base pairs one may calculate a second tangential point \(P^t\) in addition to the actual R2 coordinates. the simplest way to do so may be to compute a radius scaling factor \(rs\) in the interval \([0,1]\) 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 \(P^t\), i.e.

\[ P^{t}_x[i] = X[i] * rs \]

and

\[ P^{t}_y[i] = Y[i] * rs \]
.

Note

On success, this function allocates memory for X and Y coordinates and assigns the pointers at addressess x and y to the corresponding memory locations. It’s the users responsibility to cleanup this memory after usage!

Parameters:
  • structure – The secondary structure in dot-bracket notation

  • x – [inout] The address of a pointer of X coordinates (pointer will point to memory, or NULL on failure)

  • y – [inout] The address of a pointer of Y coordinates (pointer will point to memory, or NULL on failure)

Returns:

The length of the structure on success, 0 otherwise

int vrna_plot_coords_circular_pt(const short *pt, float **x, float **y)#

Compute nucleotide coordinates for a Circular Plot.

#include <ViennaRNA/plotting/layouts.h>

Same as vrna_plot_coords_circular() but takes a pair table with the structure information as input.

Note

On success, this function allocates memory for X and Y coordinates and assigns the pointers at addressess x and y to the corresponding memory locations. It’s the users responsibility to cleanup this memory after usage!

Parameters:
  • pt – The pair table that holds the secondary structure

  • x – [inout] The address of a pointer of X coordinates (pointer will point to memory, or NULL on failure)

  • y – [inout] The address of a pointer of Y coordinates (pointer will point to memory, or NULL on failure)

Returns:

The length of the structure on success, 0 otherwise

int vrna_plot_coords_puzzler(const char *structure, float **x, float **y, double **arc_coords, vrna_plot_options_puzzler_t *options)#

Compute nucleotide coordinates for secondary structure plot using the RNApuzzler algorithm [Wiegreffe et al., 2019] .

#include <ViennaRNA/plotting/RNApuzzler/RNApuzzler.h>

This function basically is a wrapper to vrna_plot_coords() that passes the plot_type VRNA_PLOT_TYPE_PUZZLER.

Here is a simple example how to use this function, assuming variable structure contains a valid dot-bracket string and using the default options (options = NULL):

float  *x, *y;
double *arcs;

if (vrna_plot_coords_puzzler(structure, &x, &y, &arcs, NULL)) {
  printf("all fine");
} else {
  printf("some failure occured!");
}

free(x);
free(y);
free(arcs);

Note

On success, this function allocates memory for X, Y and arc coordinates and assigns the pointers at addressess x, y and arc_coords to the corresponding memory locations. It’s the users responsibility to cleanup this memory after usage!

Parameters:
  • structure – The secondary structure in dot-bracket notation

  • x – [inout] The address of a pointer of X coordinates (pointer will point to memory, or NULL on failure)

  • y – [inout] The address of a pointer of Y coordinates (pointer will point to memory, or NULL on failure)

  • arc_coords – [inout] The address of a pointer that will hold arc coordinates (pointer will point to memory, or NULL on failure)

  • options – The options for the RNApuzzler algorithm (or NULL)

Returns:

The length of the structure on success, 0 otherwise

int vrna_plot_coords_puzzler_pt(short const *const pt, float **x, float **y, double **arc_coords, vrna_plot_options_puzzler_t *options)#

Compute nucleotide coordinates for secondary structure plot using the RNApuzzler algorithm [Wiegreffe et al., 2019] .

#include <ViennaRNA/plotting/RNApuzzler/RNApuzzler.h>

Same as vrna_plot_coords_puzzler() but takes a pair table with the structure information as input.

Note

On success, this function allocates memory for X, Y and arc coordinates and assigns the pointers at addressess x, y and arc_coords to the corresponding memory locations. It’s the users responsibility to cleanup this memory after usage!

Parameters:
  • pt – The pair table that holds the secondary structure

  • x – [inout] The address of a pointer of X coordinates (pointer will point to memory, or NULL on failure)

  • y – [inout] The address of a pointer of Y coordinates (pointer will point to memory, or NULL on failure)

  • arc_coords – [inout] The address of a pointer that will hold arc coordinates (pointer will point to memory, or NULL on failure)

  • options – The options for the RNApuzzler algorithm (or NULL)

Returns:

The length of the structure on success, 0 otherwise

vrna_plot_options_puzzler_t *vrna_plot_options_puzzler(void)#

Create an RNApuzzler options data structure.

#include <ViennaRNA/plotting/RNApuzzler/RNApuzzler.h>

Returns:

An RNApuzzler options data structure with default settings

void vrna_plot_options_puzzler_free(vrna_plot_options_puzzler_t *options)#

Free memory occupied by an RNApuzzler options data structure.

#include <ViennaRNA/plotting/RNApuzzler/RNApuzzler.h>

Parameters:
  • options – A pointer to the options data structure to free

int vrna_plot_coords_turtle(const char *structure, float **x, float **y, double **arc_coords)#

Compute nucleotide coordinates for secondary structure plot using the RNAturtle algorithm [Wiegreffe et al., 2019] .

#include <ViennaRNA/plotting/RNApuzzler/RNAturtle.h>

This function basically is a wrapper to vrna_plot_coords() that passes the plot_type VRNA_PLOT_TYPE_TURTLE.

Here is a simple example how to use this function, assuming variable structure contains a valid dot-bracket string:

float  *x, *y;
double *arcs;

if (vrna_plot_coords_turtle(structure, &x, &y, &arcs)) {
  printf("all fine");
} else {
  printf("some failure occured!");
}

free(x);
free(y);
free(arcs);

Note

On success, this function allocates memory for X, Y and arc coordinates and assigns the pointers at addressess x, y and arc_coords to the corresponding memory locations. It’s the users responsibility to cleanup this memory after usage!

Parameters:
  • structure – The secondary structure in dot-bracket notation

  • x – [inout] The address of a pointer of X coordinates (pointer will point to memory, or NULL on failure)

  • y – [inout] The address of a pointer of Y coordinates (pointer will point to memory, or NULL on failure)

  • arc_coords – [inout] The address of a pointer that will hold arc coordinates (pointer will point to memory, or NULL on failure)

Returns:

The length of the structure on success, 0 otherwise

int vrna_plot_coords_turtle_pt(short const *const pt, float **x, float **y, double **arc_coords)#

Compute nucleotide coordinates for secondary structure plot using the RNAturtle algorithm [Wiegreffe et al., 2019] .

#include <ViennaRNA/plotting/RNApuzzler/RNAturtle.h>

Same as vrna_plot_coords_turtle() but takes a pair table with the structure information as input.

Note

On success, this function allocates memory for X, Y and arc coordinates and assigns the pointers at addressess x, y and arc_coords to the corresponding memory locations. It’s the users responsibility to cleanup this memory after usage!

Parameters:
  • pt – The pair table that holds the secondary structure

  • x – [inout] The address of a pointer of X coordinates (pointer will point to memory, or NULL on failure)

  • y – [inout] The address of a pointer of Y coordinates (pointer will point to memory, or NULL on failure)

  • arc_coords – [inout] The address of a pointer that will hold arc coordinates (pointer will point to memory, or NULL on failure)

Returns:

The length of the structure on success, 0 otherwise

struct vrna_plot_layout_s#

Public Members

unsigned int type#
#include <ViennaRNA/plotting/layouts.h>
unsigned int length#
#include <ViennaRNA/plotting/layouts.h>
float *x#
#include <ViennaRNA/plotting/layouts.h>
float *y#
#include <ViennaRNA/plotting/layouts.h>
double *arcs#
#include <ViennaRNA/plotting/layouts.h>
int bbox[4]#
#include <ViennaRNA/plotting/layouts.h>
struct vrna_plot_options_puzzler_t#
#include <ViennaRNA/plotting/RNApuzzler/RNApuzzler.h>

Options data structure for RNApuzzler algorithm implementation.

Public Members

short drawArcs#
#include <ViennaRNA/plotting/RNApuzzler/RNApuzzler.h>
double paired#
#include <ViennaRNA/plotting/RNApuzzler/RNApuzzler.h>
double unpaired#
#include <ViennaRNA/plotting/RNApuzzler/RNApuzzler.h>
short checkAncestorIntersections#
#include <ViennaRNA/plotting/RNApuzzler/RNApuzzler.h>
short checkSiblingIntersections#
#include <ViennaRNA/plotting/RNApuzzler/RNApuzzler.h>
short checkExteriorIntersections#
#include <ViennaRNA/plotting/RNApuzzler/RNApuzzler.h>
short allowFlipping#
#include <ViennaRNA/plotting/RNApuzzler/RNApuzzler.h>
short optimize#
#include <ViennaRNA/plotting/RNApuzzler/RNApuzzler.h>
int maximumNumberOfConfigChangesAllowed#
#include <ViennaRNA/plotting/RNApuzzler/RNApuzzler.h>
char *config#
#include <ViennaRNA/plotting/RNApuzzler/RNApuzzler.h>
const char *filename#
#include <ViennaRNA/plotting/RNApuzzler/RNApuzzler.h>
int numberOfChangesAppliedToConfig#
#include <ViennaRNA/plotting/RNApuzzler/RNApuzzler.h>
int psNumber#
#include <ViennaRNA/plotting/RNApuzzler/RNApuzzler.h>

Annotation#

Functions to generate annotations for secondary structure plots, dot-plots, and others.

Functions

char **vrna_annotate_covar_db(const char **alignment, const char *structure, vrna_md_t *md_p)#

Produce covariance annotation for an alignment given a secondary structure.

#include <ViennaRNA/plotting/utils.h>
char **vrna_annotate_covar_db_extended(const char **alignment, const char *structure, vrna_md_t *md_p, unsigned int options)#
#include <ViennaRNA/plotting/utils.h>
vrna_string_t *vrna_annotate_covar_pt(const char **alignment, const short int *pt, vrna_md_t *md_p, double threshold, double min_sat)#
#include <ViennaRNA/plotting/utils.h>
vrna_cpair_t *vrna_annotate_covar_pairs(const char **alignment, vrna_ep_t *pl, vrna_ep_t *mfel, double threshold, vrna_md_t *md)#

Produce covariance annotation for an alignment given a set of base pairs.

#include <ViennaRNA/plotting/utils.h>

Pair Probability Plots#

Functions related to plotting of probabilities, such as dot-plots.

Defines

VRNA_PLOT_PROBABILITIES_BP#

Option flag for base pair probabilities in probability plot output functions.

#include <ViennaRNA/plotting/probabilities.h>
VRNA_PLOT_PROBABILITIES_ACC#

Option flag for accessibilities in probability plot output functions.

#include <ViennaRNA/plotting/probabilities.h>
VRNA_PLOT_PROBABILITIES_UD#

Option flag for unstructured domain probabilities in probability plot output functions.

#include <ViennaRNA/plotting/probabilities.h>
VRNA_PLOT_PROBABILITIES_UD_LIN#

Option flag for unstructured domain probabilities (linear representation) in probability plot output functions.

#include <ViennaRNA/plotting/probabilities.h>
VRNA_PLOT_PROBABILITIES_SD#

Option flag for structured domain probabilities (such as G-quadruplexes) in probability plot output functions.

#include <ViennaRNA/plotting/probabilities.h>
VRNA_PLOT_PROBABILITIES_SC_MOTIF#

Option flag for soft-constraint motif probabilities in probability plot output functions.

#include <ViennaRNA/plotting/probabilities.h>
VRNA_PLOT_PROBABILITIES_SC_UP#
#include <ViennaRNA/plotting/probabilities.h>
VRNA_PLOT_PROBABILITIES_SC_BP#
#include <ViennaRNA/plotting/probabilities.h>
VRNA_PLOT_PROBABILITIES_DEFAULT#

Default option flag for probability plot output functions.

#include <ViennaRNA/plotting/probabilities.h>

Default output includes actual base pair probabilties (VRNA_PLOT_PROBABILITIES_BP), structured domain probabilities such as G-quadruplexes (VRNA_PLOT_PROBABILITIES_SD), probabilities obtained from soft-constraint motif implementation (VRNA_PLOT_PROBABILITIES_SC_MOTIF), and unstructured domain probabilities (VRNA_PLOT_PROBABILITIES_UD_LIN).

Functions

int vrna_plot_dp_EPS(const char *filename, const char *sequence, vrna_ep_t *upper, vrna_ep_t *lower, vrna_dotplot_auxdata_t *auxdata, unsigned int options)#

Produce an encapsulate PostScript (EPS) dot-plot from one or two lists of base pair probabilities.

#include <ViennaRNA/plotting/probabilities.h>

This function reads two vrna_ep_t lists upper and lower (e.g. base pair probabilities and a secondary structure) and produces an EPS “dot plot” with filename 'filename' where data from upper is placed in the upper-triangular and data from lower

is placed in the lower triangular part of the matrix.

For default output, provide the flag

VRNA_PLOT_PROBABILITIES_DEFAULT as options parameter.

SWIG Wrapper Notes:

This function is available as overloaded function plot_dp_EPS() where the last three parameters may be omitted. The default values for these parameters are lower = NULL, auxdata = NULL, options = VRNA_PLOT_PROBABILITIES_DEFAULT. See, e.g. RNA.plot_dp_EPS() in the The RNA Python module.

Parameters:
  • filename – A filename for the EPS output

  • sequence – The RNA sequence

  • upper – The base pair probabilities for the upper triangular part

  • lower – The base pair probabilities for the lower triangular part

  • options – Options indicating which of the input data should be included in the dot-plot

Returns:

1 if EPS file was successfully written, 0 otherwise

int vrna_plot_dp_PS_list(char *seq, int cp, char *filename, vrna_ep_t *pl, vrna_ep_t *mf, char *comment)#

Produce a postscript dot-plot from two pair lists.

#include <ViennaRNA/plotting/probabilities.h>

This function reads two plist structures (e.g. base pair probabilities and a secondary structure) as produced by vrna_plist_from_probs() and vrna_plist()

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.

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

struct vrna_dotplot_auxdata_t#

Public Members

char *comment#
#include <ViennaRNA/plotting/probabilities.h>
char *title#
#include <ViennaRNA/plotting/probabilities.h>
vrna_data_lin_t **top#
#include <ViennaRNA/plotting/probabilities.h>
char **top_title#
#include <ViennaRNA/plotting/probabilities.h>
vrna_data_lin_t **bottom#
#include <ViennaRNA/plotting/probabilities.h>
char **bottom_title#
#include <ViennaRNA/plotting/probabilities.h>
vrna_data_lin_t **left#
#include <ViennaRNA/plotting/probabilities.h>
char **left_title#
#include <ViennaRNA/plotting/probabilities.h>
vrna_data_lin_t **right#
#include <ViennaRNA/plotting/probabilities.h>
char **right_title#
#include <ViennaRNA/plotting/probabilities.h>

Alignment Plots#

Functions to generate Alignment plots with annotated consensus structure.

Functions

int vrna_file_PS_aln(const char *filename, const char **seqs, const char **names, const char *structure, unsigned int columns)#

Create an annotated PostScript alignment plot.

#include <ViennaRNA/plotting/alignments.h>

SWIG Wrapper Notes:

This function is available as overloaded function file_PS_aln() with three additional parameters start, end, and offset before the columns argument. Thus, it resembles the vrna_file_PS_aln_slice() function. The last four arguments may be omitted, indicating the default of start = 0, end = 0, offset = 0, and columns = 60. See, e.g. RNA.file_PS_aln() in the The RNA Python module.

Parameters:
  • filename – The output file name

  • seqs – The aligned sequences

  • names – The names of the sequences

  • structure – The consensus structure in dot-bracket notation

  • columns – The number of columns before the alignment is wrapped as a new block (a value of 0 indicates no wrapping)

int vrna_file_PS_aln_slice(const char *filename, const char **seqs, const char **names, const char *structure, unsigned int start, unsigned int end, int offset, unsigned int columns)#

Create an annotated PostScript alignment plot.

#include <ViennaRNA/plotting/alignments.h>

Similar to vrna_file_PS_aln() but allows the user to print a particular slice of the alignment by specifying a start and end position. The additional offset parameter allows for adjusting the alignment position ruler value.

SWIG Wrapper Notes:

This function is available as overloaded function file_PS_aln() where the last four parameter may be omitted, indicating start = 0, end = 0, offset = 0, and columns = 60. See, e.g. RNA.file_PS_aln() in the The RNA Python module.

Parameters:
  • filename – The output file name

  • seqs – The aligned sequences

  • names – The names of the sequences

  • structure – The consensus structure in dot-bracket notation

  • start – The start of the alignment slice (a value of 0 indicates the first position of the alignment, i.e. no slicing at 5’ side)

  • end – The end of the alignment slice (a value of 0 indicates the last position of the alignment, i.e. no slicing at 3’ side)

  • offset – The alignment coordinate offset for the position ruler.

  • columns – The number of columns before the alignment is wrapped as a new block (a value of 0 indicates no wrapping)

int vrna_file_PS_aln_opt(const char *filename, const char **seqs, const char **names, const char *structure, vrna_aln_opt_t options)#
#include <ViennaRNA/plotting/alignments.h>
struct vrna_aln_opt_t#

Public Members

unsigned int start#
#include <ViennaRNA/plotting/alignments.h>
unsigned int end#
#include <ViennaRNA/plotting/alignments.h>
unsigned int offset#
#include <ViennaRNA/plotting/alignments.h>
unsigned int columns#
#include <ViennaRNA/plotting/alignments.h>
double color_threshold#
#include <ViennaRNA/plotting/alignments.h>
double color_min_sat#
#include <ViennaRNA/plotting/alignments.h>

Other Plotting Utils#

Defines

VRNA_FILE_FORMAT_EPS#
#include <ViennaRNA/plotting/structures.h>
VRNA_FILE_FORMAT_SVG#
#include <ViennaRNA/plotting/structures.h>
VRNA_FILE_FORMAT_GML#
#include <ViennaRNA/plotting/structures.h>
VRNA_FILE_FORMAT_SSV#
#include <ViennaRNA/plotting/structures.h>
VRNA_FILE_FORMAT_XRNA#
#include <ViennaRNA/plotting/structures.h>
VRNA_FILE_FORMAT_PLOT_DEFAULT#
#include <ViennaRNA/plotting/structures.h>

Typedefs

typedef struct vrna_plot_data_s vrna_plot_data_t#
#include <ViennaRNA/plotting/structures.h>

Functions

int vrna_plot_structure(const char *filename, const char *sequence, const char *structure, unsigned int file_format, vrna_plot_layout_t *layout, vrna_plot_data_t *aux_data)#
#include <ViennaRNA/plotting/structures.h>
int vrna_plot_structure_svg(const char *filename, const char *sequence, const char *structure, vrna_plot_layout_t *layout, vrna_plot_data_t *data)#
#include <ViennaRNA/plotting/structures.h>
int vrna_plot_structure_eps(const char *filename, const char *sequence, const char *structure, vrna_plot_layout_t *layout, vrna_plot_data_t *data)#
#include <ViennaRNA/plotting/structures.h>
int vrna_plot_structure_gml(const char *filename, const char *sequence, const char *structure, vrna_plot_layout_t *layout, vrna_plot_data_t *data, char option)#
#include <ViennaRNA/plotting/structures.h>
int vrna_plot_structure_ssv(const char *filename, const char *sequence, const char *structure, vrna_plot_layout_t *layout, vrna_plot_data_t *data)#
#include <ViennaRNA/plotting/structures.h>
int vrna_plot_structure_xrna(const char *filename, const char *sequence, const char *structure, vrna_plot_layout_t *layout, vrna_plot_data_t *data)#
#include <ViennaRNA/plotting/structures.h>
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’.

#include <ViennaRNA/plotting/structures.h>

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)#

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

#include <ViennaRNA/plotting/structures.h>

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 vrna_file_PS_rnaplot_layout(const char *seq, const char *structure, const char *ssfile, const char *pre, const char *post, vrna_md_t *md_p, vrna_plot_layout_t *layout)#
#include <ViennaRNA/plotting/structures.h>
int PS_rna_plot_snoop_a(const char *string, const char *structure, const char *ssfile, int *relative_access, const char *seqs[])#
#include <ViennaRNA/plotting/structures.h>
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.

#include <ViennaRNA/plotting/structures.h>

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)#

Produce a secondary structure graph in SStructView format.

#include <ViennaRNA/plotting/structures.h>

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)#

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

#include <ViennaRNA/plotting/structures.h>
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)#

Produce a secondary structure plot for further editing in XRNA.

#include <ViennaRNA/plotting/structures.h>
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)#

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

#include <ViennaRNA/plotting/structures.h>

Deprecated:

Use vrna_file_PS_rnaplot() instead!

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’.

#include <ViennaRNA/plotting/structures.h>

Deprecated:

Use vrna_file_PS_rnaplot_a() instead!

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).

#include <ViennaRNA/plotting/structures.h>

Deprecated:

Use vrna_file_PS_rnaplot_a() instead!

struct vrna_plot_data_s#

Public Members

char *pre#
#include <ViennaRNA/plotting/structures.h>
char *post#
#include <ViennaRNA/plotting/structures.h>
vrna_md_t *md#
#include <ViennaRNA/plotting/structures.h>
unsigned int options#
#include <ViennaRNA/plotting/structures.h>