RunUMAP.Matrix: Perform UMAP Dimensionality Reduction on a Matrix

View source: R/Umap.R

RunUMAP.MatrixR Documentation

Perform UMAP Dimensionality Reduction on a Matrix

Description

This function applies the Uniform Manifold Approximation and Projection (UMAP) algorithm to reduce the dimensionality of a given data matrix using the native R 'uwot' package.

Usage

## S3 method for class 'Matrix'
RunUMAP(
  DGEmat,
  assay = NULL,
  n.neighbors = 30L,
  n.components = 2L,
  metric = "correlation",
  min.dist = 0.3,
  spread = 1,
  seed.use = 42,
  reduction.key = "UMAP_",
  verbose = TRUE,
  ...
)

Arguments

DGEmat

A numeric matrix where rows represent samples and columns represent features.

assay

Optional assay information (not used in this implementation).

n.neighbors

Integer. Number of nearest neighbors to consider (default: 30).

n.components

Integer. Number of dimensions for the reduced space (default: 2).

metric

Character. Distance metric to use (default: "correlation"). Options include '"euclidean"', '"cosine"', '"manhattan"', etc.

min.dist

Numeric. Minimum distance between embedded points (default: 0.3).

spread

Numeric. Spread of the UMAP embedding (default: 1).

seed.use

Integer. Seed for reproducibility (default: 42).

reduction.key

Character. Prefix for naming UMAP dimensions in the output (default: "UMAP_").

verbose

Logical. Whether to print progress messages (default: TRUE).

...

Additional arguments passed to 'uwot::umap()'.

Value

A matrix of reduced UMAP coordinates with row names corresponding to 'DGEmat'.

Examples

## Not run: 
if(requireNamespace("uwot", quietly = TRUE)) {
    data_matrix <- matrix(rnorm(1000), nrow = 100, ncol = 10)
    umap_results <- RunUMAP.Matrix(DGEmat = data_matrix)
}

## End(Not run)

eisascience/scCustFx documentation built on June 2, 2025, 3:59 a.m.