#' make umap of varbin data
#'
#' @param df
#'
#' @return
#' @export
#'
#' @examples
varbin_umap <- function(seg_df_cells_t) {
# subsetting only the cells
set.seed(42)
dat_umap <- uwot::umap(seg_df_cells_t,
metric = "manhattan",
min_dist = 0,
n_neighbors = 40)
umap_df <- as.data.frame(dat_umap) %>%
dplyr::rename("umap1" = "V1",
"umap2" = "V2")
rownames(umap_df) <- rownames(seg_df_cells_t)
# We can visualize the result of the dimension reduction.
umap_df %>%
rownames_to_column(var = "Cell") %>%
identity()
return(umap_df)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.