fitVarPart | R Documentation |
Perform Variance Partition analysis for each assay
fitVarPart(
x,
formula,
data = colData(x),
assays = assayNames(x),
quiet = FALSE,
BPPARAM = SerialParam(),
...
)
## S4 method for signature 'dreamletProcessedData'
fitVarPart(
x,
formula,
data = colData(x),
assays = assayNames(x),
quiet = FALSE,
BPPARAM = SerialParam(),
...
)
x |
SingleCellExperiment or dreamletProcessedData object |
formula |
regression formula for differential expression analysis |
data |
metadata used in regression formula |
assays |
array of assay names to include in analysis. Defaults to |
quiet |
show messages |
BPPARAM |
parameters for parallel evaluation |
... |
other arguments passed to |
Object of class vpDF
inheriting from DataFrame
storing the variance fractions for each gene and cell type.
library(muscat)
library(SingleCellExperiment)
data(example_sce)
# create pseudobulk for each sample and cell cluster
pb <- aggregateToPseudoBulk(example_sce,
assay = "counts",
cluster_id = "cluster_id",
sample_id = "sample_id",
verbose = FALSE
)
# voom-style normalization
res.proc <- processAssays(pb, ~group_id)
# variance partitioning analysis
vp <- fitVarPart(res.proc, ~group_id)
# Show variance fractions at the gene-level for each cell type
genes <- vp$gene[2:4]
plotPercentBars(vp[vp$gene %in% genes, ])
# Summarize variance fractions genome-wide for each cell type
plotVarPart(vp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.