View source: R/get_umap_coordinates.R
get_umap_coordinates | R Documentation |
Function returns UMAP-coordinates if onle selected genes are used.
get_umap_coordinates(sce, genes, batch = NULL, nPC = length(genes) - 1)
sce |
SingleCellExperiment object containing gene counts matrix (stored in 'logcounts' assay). |
genes |
Character vector specifying genes to use for calculating umap-coordinates. |
batch |
Name of the field in colData(sce) to specify batch. Default batch=NULL if no batch is applied. |
nPC |
Scalar specifying number of PCs to use. Default = length(genes)-1 |
data.frame, where UMAP-coordinates are assigned as x and y.
require(SingleCellExperiment)
n_row = 1000
n_col = 100
sce = SingleCellExperiment(assays = list(logcounts = matrix(rnorm(n_row*n_col), ncol=n_col)))
rownames(sce) = as.factor(1:n_row)
colnames(sce) = c(1:n_col)
sce$cell = colnames(sce)
out = get_umap_coordinates(sce, genes = rownames(sce)[1:10])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.