scDHA: scDHA

Description Usage Arguments Value Examples

View source: R/scDHA.R

Description

The main function to perform dimension deduction and clustering.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
scDHA(
  data = data,
  k = NULL,
  method = "scDHA",
  sparse = FALSE,
  n = 5000,
  ncores = 10L,
  gen_fil = TRUE,
  do.clus = TRUE,
  sample.prob = NULL,
  seed = NULL
)

Arguments

data

Gene expression matrix, with rows represent samples and columns represent genes.

k

Number of clusters, leave as default for auto detection. Has no effect when do.clus = False.

method

Method used for clustering. It can be "scDHA" or "louvain". The default setting is "scDHA".

sparse

Boolen variable indicating whether data is a sparse matrix. The input must be a non negative sparse matrix.

n

Number of genes to keep after feature selection step.

ncores

Number of processor cores to use.

gen_fil

Boolean variable indicating whether to perform scDHA gene filtering before performing dimension deduction and clustering.

do.clus

Boolean variable indicating whether to perform scDHA clustering. If do.clus = False, only dimension deduction is performed.

sample.prob

Probability used for classification application only. Leave this parameter as default, no user input is required.

seed

Seed for reproducibility.

Value

List with the following keys:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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)
  #The clustering result can be found here 
  cluster <- result$cluster
}

scDHA documentation built on Sept. 16, 2021, 1:07 a.m.