computeCountPercentage | R Documentation |
Calculates the percentage contribution of a specified set of molecules to the total counts within the count matrix of the given assay.
computeCountPercentage(
object,
regex = NULL,
molecules = NULL,
var_name = NULL,
assay_name = activeAssay(object),
overwrite = FALSE
)
object |
An object of class |
regex |
Character value. A regular expression with which to create the set of molecules (e.g. '^MT-.*' to subset human mitochondrial genes). |
molecules |
Character vector. Instead of providing a regular expression the set of molecules can be specified directly. |
var_name |
Character value. The name of the new meta feature. |
assay_name |
Only relevant if the |
overwrite |
Logical value. Must be |
The equivalent of Seurat::PercentageFeatureSet()
. Usage differs. See examples.
The updated input object, containing the added, removed or computed results.
filterSpataObject()
library(SPATA2)
library(SPATAData)
library(patchwork)
object <- downloadSpataObject("MGH258")
# compute the percentage contribution of mitochondrial genes
object <- computeCountPercentage(object, regex = "MT-.*", var_name = "perc_mit")
plotSurface(object, color_by = "perc_mit") +
plotDensityPlot(object, variables = "perc_mit")
# keep only spots with less than 20% mitochondrial counts
object <- filterSpataObject(object, perc_mit < 20)
# new outlier identification necessary?
plotSurface(object, color_by = "tissue_section")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.