aggregateVar | R Documentation |
Aggregation function for single-cell log-normalized counts to calculate per-sample variance for dreamlet.
aggregateVar(
sce,
assay = NULL,
cluster_id = NULL,
sample_id = NULL,
min.cells = 10,
min.var = 0.01,
min.samples = 4,
min.prop = 0.4,
verbose = TRUE,
BPPARAM = SerialParam(progressbar = verbose)
)
sce |
a |
assay |
character string specifying the assay slot to use as input data. Defaults to the 1st available ( |
cluster_id |
character string specifying which variable to use as cluster id |
sample_id |
character string specifying which variable to use as sample id |
min.cells |
minimum number of observed cells for a sample to be included in the analysis |
min.var |
minimum variance for a gene to be considered expressed in a sample |
min.samples |
minimum number of samples passing cutoffs for cell cluster to be retained |
min.prop |
minimum proportion of retained samples with non-zero counts for a gene to be |
verbose |
logical. Should information on progress be reported? |
BPPARAM |
a |
The dreamlet
workflow can also be applied to model gene expression variance. In this case, a per-sample per-gene variance is calculated across all cells from a given sample and cell type. Here aggregateVar()
performs the roles of aggregateToPseudoBulk()
followed by processAssays()
but using log-normalized count data.
For each cell cluster, samples with at least min.cells are retained. Only clusters with at least min.samples retained samples are kept. Features are retained if they have at least min.var in at least min.prop fraction of the samples.
The precision of a measurement is the inverse of its sampling variance. The precision weights are computed as 1/sem^2
, where sem = sd / sqrt(n)
and n
is the number of cells.
a dreamletProcessedData
object
library(muscat)
library(SingleCellExperiment)
data(example_sce)
# Compute variance for each sample and cell cluster
pbVar <- aggregateVar(example_sce,
assay = "counts",
cluster_id = "cluster_id",
sample_id = "sample_id",
verbose = FALSE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.