scDHA.vis {scDHA}R Documentation

scDHA visulization

Description

Generating 2D embeded data for visulation.

Usage

scDHA.vis(sc = sc, method = "UMAP", ncores = 10L, seed = NULL)

Arguments

sc

Embedding object produced by the scDHA function.

method

Visualization method to use. It can be "UMAP" or "scDHA". The default setting is "UMAP".

ncores

Number of processor cores to use.

seed

Seed for reproducibility.

Value

a list with the following keys:

Examples


library(scDHA)
#Load example data (Goolam dataset)
data('Goolam'); data <- t(Goolam$data); label <- as.character(Goolam$label)
#Log transform the data 
data <- log2(data + 1)
if(torch::torch_is_installed()) #scDHA need libtorch installed
{
  #Generate clustering result, the input matrix has rows as samples and columns as genes
  result <- scDHA(data, ncores = 2, seed = 1)
  #Generate 2D representation, the input is the output from scDHA function
  result <- scDHA.vis(result, ncores = 2, seed = 1)
  #Plot the representation of the dataset, different colors represent different cell types
  plot(result$pred, col=factor(label), xlab = "scDHA1", ylab = "scDHA2")
}


[Package scDHA version 1.2.2 Index]