Learn R Programming

volcano3D (version 1.2.0)

polar_grid: Grid required for 3D volcano plot and 2D radial plots

Description

Generates a cylindrical grid of the appropriate dimensions for a 3D volcano plot

Usage

polar_grid(
  r_vector = NULL,
  z_vector = NULL,
  r_axis_ticks = NULL,
  z_axis_ticks = NULL,
  axis_angle = 5/6,
  n_spokes = 12,
  ...
)

Arguments

r_vector

An optional numerical vector for the radial coordinates. This is used to calculate breaks on the r axis using pretty. If this is NULL the r_axis_ticks are used as breaks.

z_vector

An optional numerical vector for the z coordinates. This is used to calculate breaks on the z axis using pretty. If this is NULL the z_axis_ticks are used as breaks.

r_axis_ticks

A numerical vector of breaks for the radial axis (used if r_vector is NULL).

z_axis_ticks

A numerical vector of breaks for the z axis (used if z_vector is NULL).

axis_angle

angle in radians to position the radial axis (default = 5/6)

n_spokes

the number of outward spokes to be plotted (default = 12)

...

optional parameters for pretty on the r axis

Value

Returns an S4 grid object containing:

  • 'polar_grid' The coordinates for a radial grid

  • 'axes' The axes features for 'plotly'

  • 'axis_labels' The axis labels

  • 'r' The grid radius

  • 'z' The grid height

  • 'text_coords' The coordinates for text labels

  • 'n_r_breaks' The number of ticks on the r axis

  • 'n_r_breaks' The number of ticks on the z axis

References

Lewis, Myles J., et al. (2019). Molecular portraits of early rheumatoid arthritis identify clinical and treatment response phenotypes. Cell reports, 28:9

Examples

Run this code
# NOT RUN {
data(example_data)
syn_polar <- polar_coords(sampledata = syn_example_meta,
                          contrast = "Pathotype",
                          groups = NULL,
                          pvalues = syn_example_p,
                          expression = syn_example_rld,
                          p_col_suffix = "pvalue",
                          padj_col_suffix = "padj",
                          non_sig_name = "Not Significant",
                          multi_group_prefix = "LRT",
                          significance_cutoff = 0.01,
                          fc_col_suffix='log2FoldChange',
                          fc_cutoff = 0.3)

grid <- polar_grid(r_vector=syn_polar@polar$r_zscore,
           z_vector=NULL,
           r_axis_ticks = NULL,
           z_axis_ticks = c(0, 8, 16, 32),
           n_spokes = 4)
# }

Run the code above in your browser using DataLab