plotCellComposition | R Documentation |
Bar plot of cell compositions
plotCellComposition(obj, col, width = NULL)
## S4 method for signature 'SingleCellExperiment'
plotCellComposition(obj, col, width = NULL)
## S4 method for signature 'matrix'
plotCellComposition(obj, col, width = NULL)
## S4 method for signature 'data.frame'
plotCellComposition(obj, col, width = NULL)
obj |
matrix of [cells] x [samples] or |
col |
array of colors. If missing, use default colors. If |
width |
specify width of bars |
Barplot showing cell fractions
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
)
# show cell composition bar plots
plotCellComposition(pb)
# extract cell counts
df_cellCounts <- cellCounts(pb)
# show cell composition bar plots
plotCellComposition(df_cellCounts)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.