Description Usage Arguments Value Examples
The main function to perform dimension deduction and clustering.
1 2 3 4 5 6 7 8 9 10 11 12 |
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 |
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 |
sample.prob |
Probability used for classification application only. Leave this parameter as default, no user input is required. |
seed |
Seed for reproducibility. |
List with the following keys:
cluster - A numeric vector containing cluster assignment for each sample. If do.clus = False
, this values is always NULL
.
latent - A matrix representing compressed data from the input data, with rows represent samples and columns represent latent variables.
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
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.