plot_overlay: plot overlay

Description Usage Arguments Value Note

View source: R/plot_overlay.R

Description

Takes a ggplot2 object and overlays points from a reference. The function uses the mapping and plot environment from a previous ggplot to add an overlay with a matching 'reference' data.frame. This yields a new plot with items that intersect the the original ggplot data and the reference data. Can be applied iteratively. The user can input certain columns in the reference to gain more control over the plotting parameters of individual points. See notes for additional details.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
plot_overlay(
  p,
  reference,
  match = "gene",
  label = NULL,
  label.size = NULL,
  label.color = "black",
  label.box.padding = 0.3,
  label.point.padding = 0.5,
  label.arrowhead.size = 0.01
)

Arguments

p

A ggplot object. Usually passed down from plot_volcano_basic or plot_scatter_basic.

reference

a list of data.frames that are preferably named. The name of the list will passed down to the data.frame as the column 'dataset'. Alternatively, the dataset can have a column name dataset.

match

by what string should the ggplot and overlay be merged? Default is 'gene'.

label

A boolean. This will overwrite the label column in the reference data.frame.

label.size

numeric. Size of label. This will overwrite the label.size column in the reference data.frame.

label.color

the color of the label. Default is black.

label.box.padding

Amount of padding around bounding box. See ?ggrepel::geom_text_repel for more details.

label.point.padding

Amount of padding around label. See ?ggrepel::geom_text_repel.

label.arrowhead.size

The size of the arrowhead. 0 means no arrowhead.

Value

a ggplot

Note

The following data.frame headers for a reference are accepted:

See ?validate_reference or additional details.


frhl/genoppi-v4 documentation built on May 5, 2020, 7:16 a.m.