compute_umap: Compute UMAPs.

Description Usage Arguments Value Examples

View source: R/umap.R

Description

Computation is be done using the embed package.

Usage

1
compute_umap(df, num_comp = 2, subset = NULL)

Arguments

df

A data frame.

num_comp

A positive integer. The number of UMAP components to compute.

subset

A character vector. The subset of columns to use for UMAP calculation. Default is all columns. Columns in df outside of this subset will be kept in the result.

Value

A data frame with the UMAP components.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
if (rlang::is_installed("mirmisc")) {
  ga_data <- get_ga_data(
    log2 = TRUE,
    gene_predicate = ~ median(.) > 0
  )
  genes <- dplyr::intersect(names(ga_data), mirmisc::get_gene_names())
  umap <- compute_umap(ga_data, subset = genes)
  ggplot2::ggplot(
    umap,
    ggplot2::aes(umap_1, umap_2, color = meta_collectionga)
  ) +
    ggplot2::geom_point() +
    ggplot2::scale_color_viridis_c()
}

mirvie/mirmodels documentation built on Jan. 14, 2022, 11:12 a.m.