Skip to contents

Keeps genes whose variance across cells is at or above the var_quantile quantile of the gene variances and that are detected (count > 0) in at least a fraction min_nonzero of the cells. With the defaults this is the filter used in the DenMark paper: the genes in the lowest 5 percent of variance are dropped, and at least 5 percent of the cells must have a non-zero count.

Usage

denmark_filter_genes(expr, var_quantile = 0.05, min_nonzero = 0.05)

Arguments

expr

Cells x genes matrix or data frame of counts (numeric columns only), with the gene names as column names.

var_quantile

Quantile of the gene variances below which genes are dropped.

min_nonzero

Minimum fraction of cells with a non-zero count.

Value

Character vector of the genes kept.

Examples

toy <- denmark_toy_data()
tumor <- subset(toy, celltype == "Tumor", select = -celltype)
denmark_filter_genes(tumor[, c("geneA", "geneB", "geneC")])
#> [1] "geneA" "geneB"