GeneScatterPlot: Visualize gene expression over nonlinear dimensionality...

GeneScatterPlotR Documentation

Visualize gene expression over nonlinear dimensionality reduction

Description

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

Usage

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

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")


elolab/iloreg documentation built on March 27, 2022, 4:19 a.m.