GeneScatterPlot: Visualize gene expression over nonlinear dimensionality...

Description Usage Arguments Value Examples

Description

GeneScatterPlot enables visualizing gene expression of a gene over nonlinear dimensionality reduction with t-SNE or UMAP.

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
GeneScatterPlot.SingleCellExperiment(
  object,
  genes,
  return.plot,
  dim.reduction.type,
  point.size,
  title,
  plot.expressing.cells.last,
  nrow,
  ncol
)

## S4 method for signature 'SingleCellExperiment'
GeneScatterPlot(
  object,
  genes = "",
  return.plot = FALSE,
  dim.reduction.type = "tsne",
  point.size = 0.7,
  title = "",
  plot.expressing.cells.last = FALSE,
  nrow = NULL,
  ncol = NULL
)

Arguments

object

of SingleCellExperiment class

genes

a character vector of the genes to be visualized

return.plot

whether to return the ggplot2 object or just draw it (default FALSE)

dim.reduction.type

"tsne" or "umap" (default "tsne")

point.size

point size (default 0.7)

title

text to write above the plot

plot.expressing.cells.last

whether to plot the expressing genes last to make the points more visible

nrow

a positive integer that specifies the number of rows in the plot grid. Default is NULL.

ncol

a positive integer that specifies the number of columns in the plot grid. Default is NULL.

Value

ggplot2 object if return.plot=TRUE

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(SingleCellExperiment)
sce <- SingleCellExperiment(assays = list(logcounts = pbmc3k_500))
sce <- PrepareILoReg(sce)
## These settings are just to accelerate the example, use the defaults.
sce <- RunParallelICP(sce,L=2,threads=1,C=0.1,k=5,r=1)
sce <- RunPCA(sce,p=5)
sce <- RunTSNE(sce)
GeneScatterPlot(sce,"CD14",dim.reduction.type="tsne")
sce <- RunUMAP(sce)
GeneScatterPlot(sce,"CD14",dim.reduction.type="umap")

ILoReg documentation built on Nov. 8, 2020, 8:20 p.m.