plotPercentBars,vpDF-method | R Documentation |
Bar plot of variance fractions for a subset of genes
## S4 method for signature 'vpDF'
plotPercentBars(
x,
col = c(ggColorHue(ncol(x) - 3), "grey85"),
genes = unique(x$gene),
width = NULL,
ncol = 3,
...
)
## S4 method for signature 'cellSpecificityValues'
plotPercentBars(
x,
col = ggColorHue(ncol(x)),
genes = rownames(x),
width = NULL,
...
)
x |
|
col |
color of bars for each variable |
genes |
name of genes to plot |
width |
specify width of bars |
ncol |
number of columns in the plot |
... |
other arguments |
Bar plot showing variance fractions for each gene
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
plotPercentBars(vp, genes = vp$gene[2:4], ncol = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.