get_umap_coordinates: get_umap_coordinates

View source: R/get_umap_coordinates.R

get_umap_coordinatesR Documentation

get_umap_coordinates

Description

Function returns UMAP-coordinates if onle selected genes are used.

Usage

get_umap_coordinates(sce, genes, batch = NULL, nPC = length(genes) - 1)

Arguments

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

Value

data.frame, where UMAP-coordinates are assigned as x and y.

Examples

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


MarioniLab/geneBasisR documentation built on June 30, 2023, 2:04 p.m.