filter_genes | R Documentation |
Preprocessing function to filter low-expressed genes and/or mitochondrial genes for 'nnSVG'.
filter_genes(
spe,
filter_genes_ncounts = 3,
filter_genes_pcspots = 0.5,
filter_mito = TRUE
)
spe |
|
filter_genes_ncounts |
|
filter_genes_pcspots |
|
filter_mito |
|
Preprocessing function to filter low-expressed genes and/or mitochondrial genes for 'nnSVG'.
This function can be used to filter out low-expressed genes and/or mitochondrial genes before additional preprocessing (calculating logcounts or deviance residuals) and running 'nnSVG'.
We use this function in the examples and vignettes in the 'nnSVG' package, and provide default filtering parameter values that are appropriate for 10x Genomics Visium data.
The use of this function is optional. Users can also perform filtering and
preprocessing separately, and run nnSVG
on a preprocessed
SpatialExperiment
object.
Returns SpatialExperiment
with filtered genes (rows) removed.
library(SpatialExperiment)
library(STexampleData)
# load example dataset from STexampleData package
spe <- Visium_humanDLPFC()
# preprocessing steps
# keep only spots over tissue
spe <- spe[, colData(spe)$in_tissue == 1]
dim(spe)
# filter low-expressed and mitochondrial genes
spe <- filter_genes(spe)
dim(spe)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.