get_redundancy_stat: get_redundancy_stat

View source: R/get_redundancy_stat.R

get_redundancy_statR Documentation

get_redundancy_stat

Description

Functions calculates relevance of each gene (within current selection) to celltype mapping.

Usage

get_redundancy_stat(sce, genes, genes_to_assess = genes, batch = NULL, ...)

Arguments

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.

Value

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.

Examples

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)


MarioniLab/geneBasisR documentation built on June 30, 2023, 2:04 p.m.