PomaUMAP: Dimensionality Reduction with UMAP

View source: R/PomaUMAP.R

PomaUMAPR Documentation

Dimensionality Reduction with UMAP

Description

PomaUMAP performs a dimension reduction of the data using the Uniform Manifold Approximation and Projection (UMAP) method. See ?uwot::umap() for more.

Usage

PomaUMAP(
  data,
  n_neighbors = floor(sqrt(nrow(data))),
  n_components = 2,
  metric = "euclidean",
  pca = NULL,
  min_dist = 0.01,
  spread = 1,
  hdbscan_minpts = floor(nrow(data) * 0.05),
  show_clusters = TRUE,
  hide_noise = TRUE,
  labels = FALSE,
  theme_params = list(legend_title = TRUE, legend_position = "bottom")
)

Arguments

data

A SummarizedExperiment object.

n_neighbors

Numeric. Indicates the size of local neighborhood (sample points) used for manifold approximation.

n_components

Numeric. Indicates the dimension of the space to embed into.

metric

Character. Indicates the distance measure method to find nearest neighbors. Options are "euclidean", "cosine", "manhattan", "hamming" and "correlation". See ?uwot::umap().

pca

If not NULL (default), reduce data to this number of columns using PCA before UMAP.

min_dist

Numeric. Indicates the effective minimum distance between embedded points.

spread

Numeric. Indicates the effective scale of embedded points.

hdbscan_minpts

Numeric. Indicates the minimum size of clusters. See ?dbscan::hdbscan().

show_clusters

Logical. Indicates if clusters computed with HDBSCAN method should be plotted or not.

hide_noise

Logical. Specifies whether to hide Cluster 0 in the plot. In HDBSCAN, Cluster 0 is typically regarded as "noise."

labels

Logical. Indicates if sample names should be plotted or not.

theme_params

List. Indicates theme_poma parameters.

Value

A list with results including plots and tables.

Author(s)

Pol Castellano-Escuder

References

McInnes, L., Healy, J., & Melville, J. (2018). Umap: Uniform manifold approximation and projection for dimension reduction. arXiv preprint arXiv:1802.03426.

Campello, R. J., Moulavi, D., & Sander, J. (2013, April). Density-based clustering based on hierarchical density estimates. In Pacific-Asia conference on knowledge discovery and data mining (pp. 160-172). Springer, Berlin, Heidelberg.

Examples

data <- POMA::st000284 # Example SummarizedExperiment object included in POMA

## Output is a list with objects `umap_embeddings` (tibble) and `umap_plot` (ggplot2 object)
data %>%
  PomaNorm() %>%
  PomaUMAP(metric = "euclidean",
           pca = NULL,
           min_dist = 0.01,
           spread = 1,
           hdbscan_minpts = floor(nrow(data) * 0.05),
           show_clusters = TRUE,
           hide_noise = TRUE,
           labels = FALSE)

pcastellanoescuder/POMA_package documentation built on Oct. 13, 2024, 8:47 p.m.