plotDim3D: Dimensionality reduction plot in 3D.

Description Usage Arguments Value

View source: R/plot-dim-3D.R

Description

Plots cells according to their coordinates in a dimensionality reduction (tSNE by default, but also PCA or diffusion map). Cells are colored according to a user set label that can range from gene expression, to metadata values, or cluster identity. See data.for.plot for more information about labels that can be chosen. Views can be stored using plotDim3DStoreView that can reproduce the same orientation plot repeatedly.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
plotDim3D(
  object,
  label,
  label.type = "search",
  reduction.use = c("dm", "pca"),
  view = NULL,
  dim.1 = NULL,
  dim.2 = NULL,
  dim.3 = NULL,
  w.1 = NULL,
  w.2 = NULL,
  w.3 = NULL,
  cells = NULL,
  alpha = 0.2,
  size = 4,
  title = NULL,
  title.cex = 3,
  title.line = 0,
  bounding.box = T,
  xlab = NULL,
  ylab = NULL,
  zlab = NULL,
  continuous.colors = NULL,
  continuous.color.limits = NULL,
  discrete.colors = NULL
)

Arguments

object

An URD object

label

(Character) Data to use for coloring points (e.g. a metadata name, group ID from clustering, or a gene name)

label.type

(Character) Type of data to search for the label. Default is "search" which checks several data types in order. For more information: data.for.plot

reduction.use

(Character) Dimensionality reduction to use (Diffusion Map ("dm") or PCA ("pca"))

view

(Character) Stored view to use. These are created with plotDim3DStoreView and contain the dimensions and weights to use, as well as the stored orientation of the plot. Should be the name of an entry in the list @plot.3d.

dim.1

(Numeric vector) Component(s) to use on x-axis. If > 1, they will be interpolated according to weights in w.1.

dim.2

(Numeric vector) Component(s) to use on y-axis. If > 1, they will be interpolated according to weights in w.2.

dim.3

(Numeric vector) Component(s) to use on z-axis. If > 1, they will be interpolated according to weights in w.3.

w.1

(Numeric vector) Weight to use for the members of dim.1. Defaults to equal weights for all members. Important to note that these can be negative to reverse the contribution of particular dimensions.

w.2

(Numeric vector) Weight to use for the members of dim.1. Defaults to equal weights for all members. Important to note that these can be negative to reverse the contribution of particular dimensions.

w.3

(Numeric vector) Weight to use for the members of dim.1. Defaults to equal weights for all members. Important to note that these can be negative to reverse the contribution of particular dimensions.

cells

(Character vector) Cells to plot. (Default NULL plots all cells.)

alpha

(Numeric) Transparency of points on plot: 0 (Transparent) - 1 (Opaque)

size

(Numeric) Size of points on plot

title

(Character) Title for plot. (This is sensitive to resizing the window after plotting, but if a view is stored, the window will be resized before the title is added, so it will be acceptable resolution for figures.)

title.cex

(Numeric) Adjust the title font size

title.line

(Numeric) Adjust the position of the title. Positive numbers move the title upward.

bounding.box

(Logical) Should a bounding box with axis labels be displayed on the plot?

xlab

(Character) Label for x-axis (if bounding.box=T)

ylab

(Character) Label for y-axis (if bounding.box=T)

zlab

(Character) Label for z-axis (if bounding.box=T)

continuous.colors

(Character vector) Vector of colors to use if data is continuous

continuous.color.limits

(Numeric vector, length 2) Limits of data for color scale. Data outside these limits will be squished. NULL uses the original range of the data.

discrete.colors

(Character vector) Vector of colors to use if data is discrete

Value

Returns nothing, but produces an output through rgl.


farrellja/URD documentation built on June 17, 2020, 4:48 a.m.