performUMAP: Perform UMAP on an input data-frame or matrix, or...

Description Usage Arguments Details Value Author(s) Examples

View source: R/performUMAP.R

Description

Perform UMAP on an input data-frame or matrix, or SingleCellExperiment object, using the basic R implementation of UMAP.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
performUMAP(
  indata,
  config = NULL,
  assay = "scaled",
  reducedDim = NULL,
  dims = seq_len(20),
  newDimName = NULL,
  useMarkers = NULL,
  verbose = TRUE
)

Arguments

indata

A data-frame or matrix, or SingleCellExperiment object. If a data-frame or matrix, only the derived co-ordinates for the first two dimensions are returned. If a SingleCellExperiment object, UMAP is performed on the assay named by assay, and the co-ordinates for the first two dimensions are stored as a reduced dimension named by reducedDim.

config

UMAP configuration settings

assay

Name of the assay slot in indata from which data will be taken, assuming indata is a SingleCellExperiment object.

reducedDim

A dimensional reduction / embedding stored within indata, e.g., PCA. If activated, UMAP will be performed on this object in place of the assay component specified by assay.

dims

If 'reducedDim' is activated, the number of dimensions to use.

newDimName

Name for the new dimensional embedding that will be produced. If nothing is selected for neither this nor reducedDim, then the new name will be UMAP. If nothing is selected for this, but, e.g., PCA is selected for reducedDim, then the new name will be UMAP_PCA.

useMarkers

Before performing UMAP, subset the data for these markers.

verbose

Boolean (TRUE / FALSE) to print messages to console or not.

Details

Perform UMAP on an input data-frame or matrix, or SingleCellExperiment object, using the basic R implementation of UMAP.

Value

A SingleCellExperiment object.

Author(s)

Kevin Blighe <kevin@clinicalbioinformatics.co.uk>

Examples

1
2
3
4
5
6
7
# create random data that follows a negative binomial
mat <- jitter(matrix(
  MASS::rnegbin(rexp(1000, rate=.1), theta = 4.5),
  ncol = 20))
colnames(mat) <- paste0('CD', 1:ncol(mat))

performUMAP(mat)

kevinblighe/scDataviz documentation built on Sept. 28, 2021, 12:04 p.m.