Learn R Programming

volcano3D (version 1.2.0)

radial_plotly: Three-way radial comparison Polar Plot (using plotly)

Description

This function creates an interactive plotly object which maps differential expression onto a polar coordinates.

Usage

radial_plotly(
  polar,
  colours = c("green3", "cyan", "blue", "purple", "red", "gold2"),
  non_sig_colour = "grey60",
  colour_scale = "discrete",
  continuous_shift = 1.33,
  label_rows = NULL,
  arrow_length = 50,
  grid = NULL,
  fc_or_zscore = "zscore",
  label_size = 14,
  colour_code_labels = TRUE,
  label_colour = NULL,
  hover_text = "label",
  grid_colour = "grey80",
  axis_colour = "black",
  marker_size = 6,
  marker_alpha = 0.7,
  marker_outline_colour = "white",
  marker_outline_width = 0.5,
  axis_title_size = 16,
  axis_label_size = 10,
  axis_ticks = NULL,
  axis_angle = 5/6,
  plot_height = 700,
  plot_width = 700,
  ...
)

Arguments

polar

A polar object with the pvalues between groups of interest and polar coordinates. Created by polar_coords.

colours

A vector of colour names or hex triplets for each of the six groups. Default = c("green3", "cyan", "blue", "purple", "red", "gold2"). Colours are assigned in order: group1+, group1+group2+, group2+, group2+group3+, group3+, group1+group3+.

non_sig_colour

The colour for non-significant markers (default = "grey60").

colour_scale

whether to use a 'discrete' or 'continuous' colour scale (default = 'discrete').

continuous_shift

The number of radians (between 0 and 6) to offset the continuous colour scale by. This is calculated by converting the angle to a hue using hsv where 0 corresponds to the colour scale starting with red and 360 with magenta (default = 2).

label_rows

A vector of row names or numbers to label.

arrow_length

The length of label arrows (default = 50).

grid

An optional grid object. If NULL this will be calculated using the default values of polar_grid.

fc_or_zscore

Whether to use the z-score or fold change as magnitude. Options are 'zscore' (default) or 'fc'.

label_size

Font size of labels/annotations (default = 14)

colour_code_labels

Logical whether label annotations should be colour coded. If FALSE label_colour is used.

label_colour

HTML colour of annotation labels if not colour coded.

hover_text

A character string containing the argument for hover text (default="label"). Possible columns include:

  • "Name" or "label": name and label column for each marker

  • paste(group, "_axis") the position for each marker on a given axis

  • "x_zscore", "y_zscore" or "r_zscore": The position according to z-score

  • "x_fc", "y_fc" or "r_fc": The position according to fold change

  • "angle", "angle_degrees": Then marker angle

  • "max_exp" or "sig": The maximally expressed group or significant group

  • "col" or "hue": The colour or hue of the marker

  • paste0(group A, "_", group B, "_pvalue"): The pvalue for comparisons

  • paste0(group A, "_", group B, "_padj"): The pvalue for comparisons

  • paste0(group A, "_", group B, "_logFC"): The pvalue for comparisons

  • paste0(multi_group_test, "_pvalue"), paste0(multi_group_test, "_padj"), paste0(multi_group_test, "_logFC"): The stats for all multi-group tests.

grid_colour

The colour of the grid (default="grey80").

axis_colour

The colour of the grid axes and labels (default="black").

marker_size

Size of the markers (default = 6).

marker_alpha

Opacity for the markers (default = 0.7).

marker_outline_colour

Colour for marker outline (default = white)

marker_outline_width

Width for marker outline (default = 0.5)

axis_title_size

Font size for axis titles (default = 16)

axis_label_size

Font size for axis labels (default = 10)

axis_ticks

A numerical vector of radial axis tick breaks. If NULL this will be calculated using pretty.

axis_angle

Angle in radians for the radial axis (default = 5/6).

plot_height

Plot height in px (default=700).

plot_width

Plot width in px (default=700).

...

Optional parameters to pass to polar_grid.

Value

Returns a plotly plot featuring variables on a tri-axis radial graph

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_cutoff = 0.3)

radial_plotly(polar = syn_polar, label_rows = c("SLAMF6"))
# }

Run the code above in your browser using DataLab