plotDimReduceModule: Plotting Celda module probability on a dimension reduction...

Description Usage Arguments Value Examples

Description

Create a scatterplot for each row of a normalized gene expression matrix where x and y axis are from a data dimension reduction tool. The cells are colored by the module probability.

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
27
28
29
30
31
32
33
34
35
36
37
38
39
plotDimReduceModule(x, ...)

## S4 method for signature 'SingleCellExperiment'
plotDimReduceModule(
  x,
  reducedDimName,
  dim1 = NULL,
  dim2 = NULL,
  useAssay = "counts",
  altExpName = "featureSubset",
  modules = NULL,
  rescale = TRUE,
  limits = c(0, 1),
  size = 1,
  xlab = "Dimension_1",
  ylab = "Dimension_2",
  colorLow = "grey90",
  colorHigh = "firebrick1",
  ncol = NULL,
  decreasing = FALSE
)

## S4 method for signature 'matrix'
plotDimReduceModule(
  x,
  dim1,
  dim2,
  celdaMod,
  modules = NULL,
  rescale = TRUE,
  limits = c(0, 1),
  size = 1,
  xlab = "Dimension_1",
  ylab = "Dimension_2",
  colorLow = "blue4",
  colorHigh = "firebrick1",
  ncol = NULL,
  decreasing = FALSE
)

Arguments

x

Numeric matrix or a SingleCellExperiment object with the matrix located in the assay slot under useAssay. Rows represent features and columns represent cells.

...

Ignored. Placeholder to prevent check warning.

reducedDimName

The name of the dimension reduction slot in reducedDimNames(x) if x is a SingleCellExperiment object. Ignored if both dim1 and dim2 are set.

dim1

Numeric vector. First dimension from data dimension reduction output.

dim2

Numeric vector. Second dimension from data dimension reduction output.

useAssay

A string specifying which assay slot to use if x is a SingleCellExperiment object. Default "counts".

altExpName

The name for the altExp slot to use. Default "featureSubset".

modules

Character vector. Module(s) from celda model to be plotted. e.g. c("1", "2").

rescale

Logical. Whether rows of the matrix should be rescaled to [0, 1]. Default TRUE.

limits

Passed to scale_colour_gradient. The range of color scale.

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.

colorHigh

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

ncol

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

decreasing

logical. Specifies the order of plotting the points. If FALSE, the points will be plotted in increasing order where the points with largest values will be on top. TRUE otherwise. If NULL, no sorting is performed. Points will be plotted in their current order in x. Default FALSE.

celdaMod

Celda object of class "celda_G" or "celda_CG". Used only if x is a matrix object.

Value

The plot as a ggplot object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(sceCeldaCG)
sce <- celdaTsne(sceCeldaCG)
plotDimReduceModule(x = sce,
  reducedDimName = "celda_tSNE",
  modules = c("1", "2"))
library(SingleCellExperiment)
data(sceCeldaCG, celdaCGMod)
sce <- celdaTsne(sceCeldaCG)
plotDimReduceModule(x = counts(sce),
  dim1 = reducedDim(altExp(sce), "celda_tSNE")[, 1],
  dim2 = reducedDim(altExp(sce), "celda_tSNE")[, 2],
  celdaMod = celdaCGMod,
  modules = c("1", "2"))

celda documentation built on Nov. 8, 2020, 8:24 p.m.