plotDimReduceGrid: Mapping the dimensionality reduction plot

Description Usage Arguments Value Examples

View source: R/plot_dr.R

Description

Creates a scatterplot given two dimensions from a data dimensionality reduction tool (e.g tSNE) output.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
plotDimReduceGrid(
  dim1,
  dim2,
  matrix,
  size = 1,
  xlab = "Dimension_1",
  ylab = "Dimension_2",
  colorLow = "grey",
  colorMid = NULL,
  colorHigh = "blue",
  midpoint = NULL,
  varLabel = NULL,
  ncol = NULL,
  headers = NULL
)

Arguments

dim1

Numeric vector. First dimension from data dimensionality reduction output.

dim2

Numeric vector. Second dimension from data dimensionality reduction output.

matrix

Numeric matrix. Each row of the matrix will be plotted as a separate facet.

size

Numeric. Sets size of point on plot. Default 1.

xlab

Character vector. Label for the x-axis. Default 'Dimension_1'.

ylab

Character vector. Label for the y-axis. Default 'Dimension_2'.

colorLow

Character. A color available from 'colors()'. The color will be used to signify the lowest values on the scale. Default 'grey'.

colorMid

Character. A color available from 'colors()'. The color will be used to signify the midpoint on the scale.

colorHigh

Character. A color available from 'colors()'. The color will be used to signify the highest values on the scale. Default 'blue'.

midpoint

Numeric. The value indicating the midpoint of the diverging color scheme. If NULL, defaults to the mean with 10 percent of values trimmed. Default NULL.

varLabel

Character vector. Title for the color legend.

ncol

Integer. Passed to facet_wrap. Specify the number of columns for facet wrap.

headers

Character vector. If 'NULL', the corresponding rownames are used as labels. Otherwise, these headers are used to label the genes.

Value

The plot as a ggplot object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
data(celdaCGSim, celdaCGMod)
celdaTsne <- celdaTsne(
  counts = celdaCGSim$counts,
  celdaMod = celdaCGMod
)
plotDimReduceGrid(celdaTsne[, 1],
  celdaTsne[, 2],
  matrix = celdaCGSim$counts,
  xlab = "Dimension1",
  ylab = "Dimension2",
  varLabel = "tsne",
  size = 1,
  colorLow = "grey",
  colorMid = NULL,
  colorHigh = "blue"
)

celda documentation built on June 9, 2020, 2 a.m.