View source: R/get_coexpression_stat.R
get_coexpression_stat | R Documentation |
For each gene of interest, returns top co-expressed genes from the sce counts matrix (either filtered by number of co-expressed genes or correlation)
get_coexpression_stat(
sce,
genes,
n = 10,
corr.thresh = 0.5,
method = "spearman",
verbose = TRUE
)
sce |
SingleCellExperiment object containing gene counts matrix (stored in 'logcounts' assay). |
genes |
Charcter vector specifying genes to which co-expression stat should be returned. |
n |
Scalar (or NULL) specifying number of top HVGs to be return. Default n=10. If NULL, returns all genes with correlation higher than threshold. |
corr.thresh |
Scalar (float) specifying threshold for correlation to use. Default corr.thresh=0.5. |
method |
Character specifying method for correlation. Availbale options are c("spearman", "pearson", "kendall"). Default method="spearman". |
verbose |
Boolean identifying whether intermediate print outputs should be returned. Default verbose=TRUE. |
List, each element corresponds to a gene in genes. Each element is data.frame with co-expressed genes.
require(SingleCellExperiment)
n_row = 500
n_col = 100
sce = SingleCellExperiment(assays = list(logcounts = matrix(rnorm(n_row*n_col), ncol=n_col)))
rownames(sce) = as.factor(1:n_row)
colnames(sce) = c(1:n_col)
sce$cell = colnames(sce)
out = get_coexpression_stat(sce, c("1","2"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.