Functions for Creating Secondary Structure Plots, Dot-Plots, and More

Overview

// structs

struct COORDINATE
struct vrna_dotplot_auxdata_t

// global variables

int rna_plot_type

// global functions

int naview_xy_coordinates (
    short* pair_table,
    float* X,
    float* Y
    )

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

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

int vrna_file_PS_aln_sub (
    const char* filename,
    const char** seqs,
    const char** names,
    const char* structure,
    int start,
    int end,
    int columns
    )

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
    )

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

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
    )

int PS_color_dot_plot (
    char* string,
    cpair* pi,
    char* filename
    )

int PS_color_dot_plot_turn (
    char* seq,
    cpair* pi,
    char* filename,
    int winSize
    )

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

int vrna_plot_dp_PS_list (
    char* seq,
    int cp,
    char* wastlfile,
    plist* pl,
    plist* mf,
    char* comment
    )

int PS_dot_plot_turn (
    char* seq,
    plist* pl,
    char* filename,
    int winSize
    )

int PS_dot_plot (
    char* string,
    char* file
    )

// macros

#define PI
#define PIHALF
#define VRNA_PLOT_PROBABILITIES_ACC
#define VRNA_PLOT_PROBABILITIES_BP
#define VRNA_PLOT_PROBABILITIES_DEFAULT
#define VRNA_PLOT_PROBABILITIES_SC_BP
#define VRNA_PLOT_PROBABILITIES_SC_MOTIF
#define VRNA_PLOT_PROBABILITIES_SC_UP
#define VRNA_PLOT_PROBABILITIES_SD
#define VRNA_PLOT_PROBABILITIES_UD
#define VRNA_PLOT_PROBABILITIES_UD_LIN
#define VRNA_PLOT_TYPE_CIRCULAR
#define VRNA_PLOT_TYPE_NAVIEW
#define VRNA_PLOT_TYPE_SIMPLE

Detailed Documentation

Global Variables

int rna_plot_type
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 [3] .

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!

Global 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 []
    )
PS_color_aln for duplexes
int simple_xy_coordinates (
    short* pair_table,
    float* X,
    float* Y
    )
Calculate nucleotide coordinates for secondary structure plot the Simple way

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
    )
Calculate nucleotide coordinates for Circular Plot

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

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

Note

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 R 2 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. :math:` P^{t}_x[i] = X[i] * rs` and \(P^{t}_y[i] = Y[i] * rs\) .

int PS_dot_plot_list (
    char* seq,
    char* filename,
    plist* pl,
    plist* mf,
    char* comment
    )
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.

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
    )
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 Deprecated This function is deprecated and will be removed soon! Use PS_dot_plot_list() instead!

Note

DO NOT USE THIS FUNCTION ANYMORE SINCE IT IS NOT THREADSAFE

Macros

#define VRNA_PLOT_TYPE_CIRCULAR
Definition of Plot type Circular

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

#define VRNA_PLOT_TYPE_NAVIEW
Definition of Plot type Naview

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

#define VRNA_PLOT_TYPE_SIMPLE
Definition of Plot type simple

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