View source: R/get_redundancy_stat.R
get_redundancy_stat | R Documentation |
Functions calculates relevance of each gene (within current selection) to celltype mapping.
get_redundancy_stat(sce, genes, genes_to_assess = genes, batch = NULL, ...)
sce |
SingleCellExperiment object containing gene counts matrix (stored in 'logcounts' assay). |
genes |
Character vector specifying selected library. |
genes_to_assess |
Character vector specifying gene names for which we want to assess redundancy. Should be a subset of genes. |
batch |
Name of the field in colData(sce) to specify batch. Default batch=NULL if no batch is applied. |
... |
Additional arguments you can pass to get_celltype_mapping. |
data.frame, each row corresponds to celltype/gene; frac_correctly_mapped_ratio corresponds to ratio between accuracy of the mapping for a given celltype while using genes excluding and including the gene in question.
require(SingleCellExperiment)
n_row = 1000
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)
sce$celltype = as.character(sample.int(5, n_col, replace = TRUE))
genes = rownames(sce)
genes_to_assess = sample(rownames(sce),5)
out = get_redundancy_stat(sce, genes, genes_to_assess = genes_to_assess)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.