cluster_genesets: Cluster each functional gene set into three groups.

View source: R/create_signs.R

cluster_genesetsR Documentation

Cluster each functional gene set into three groups.

Description

This function clusters each functional gene set into strongly, variably, and weakly correlated gene sets.

Usage

cluster_genesets(sce = NULL, cormat = NULL, th_posi = NULL, th_nega = NULL)

Arguments

sce

A SingleCellExperiment object.

cormat

A correlation matrix of gene expressions.

th_posi

A threshold of positive correlation coefficient.

th_nega

A threshold of negative correlation coefficient.

Value

A SingleCellExperiment object.

Examples

data(pbmc_eg)
data(human_GO_eg)
mat <- t(as.matrix(SummarizedExperiment::assay(pbmc_eg, "centered")))
pbmc_cormat <- cor(mat, method = "spearman")
pbmcs <- list(GO = pbmc_eg)
S4Vectors::metadata(pbmcs$GO) <- list(sign = human_GO_eg[["BP"]])
pbmcs$GO <- remove_signs(sce = pbmcs$GO, min_ngenes = 2, max_ngenes = 1000)
pbmcs$GO <- cluster_genesets(sce = pbmcs$GO, cormat = pbmc_cormat,
                             th_posi = 0.24, th_nega = -0.20)
# The results are stored in `metadata(pbmcs$GO)$sign`.


okadalabipr/ASURAT documentation built on Nov. 25, 2022, 5:40 p.m.