View source: R/retain_informative_genes.R
retain_informative_genes | R Documentation |
Function selects variable genes and retains them to represent counts matrix for downstream analysis. This is essentially a wrapper for scran::getTopHVGs + simple check for mt-genes.
retain_informative_genes(
sce,
n = NULL,
var.thresh = 0,
select.hvgs = TRUE,
discard.mt = TRUE
)
sce |
SingleCellExperiment object containing gene counts matrix (stored in 'logcounts' assay). |
n |
Scalar (or NULL, if not applied) specifying number of top HVGs to be return. Default=NULL. |
var.thresh |
Scalar (float) specifying threshold for variation to filter HVGs. Default=0. |
select.hvgs |
Boolean specifying if we want to discard not HVGs. Default=TRUE. |
discard.mt |
Boolean specifying if mitochondrial genes should be discarded. Default=TRUE. |
Reduced sce with prefiltered set of genes.
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)
out = retain_informative_genes(sce)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.