PlotEmbedding: Two Dimensional Embedding for Visualization

Description Usage Arguments Details Value Examples

View source: R/emeddings.R

Description

2-D embedding of transcriptomes for visualization

Usage

1
PlotEmbedding(object, embedding = "tsne", use.subsamples = TRUE, ...)

Arguments

object

A SingleCellExperiment object containing normalized expression values in "normcounts".

embedding

Type of embedding to use, one of c("tsne", "umap"). defaults to "tsne". The uwot implementation of umap is used. Specific arguments may be passed with relevant umap argument names.

use.subsamples

logical indicating if sub-samples should be used for the post-hoc projection of the coordinates of remaining samples.

...

umap arguments may be passed.

Details

Performs 2D embedding on sampled cells followed by the post-hoc projection of 2D co-ordinated of unsampled cells. An ad-hoc clean up is also carried out to keep away stray points away from the plot - NA value is assigned to such points.

Value

A SingleCellExperiment object with a new entry under the reducedDim() containter to store the reduced dimension components with the name from the argument embedding.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
library(SingleCellExperiment)
ncells <- 100
ngenes <- 2000
x <- matrix(rpois(ncells*ngenes, lambda = 10), ncol=ncells, nrow=ngenes, byrow=TRUE)
rownames(x) <- paste0("Gene", seq_len(ngenes))
colnames(x) <- paste0("Cell", seq_len(ncells))
sce <- SingleCellExperiment(list(counts=x))
sce <- CountNormalize(sce)
sce <- RankGenes(sce)
sce <- PlotEmbedding(sce)
plot(reducedDim(sce, "tsne"))

debsin/dropClust documentation built on Nov. 4, 2019, 10:22 a.m.