ClusterDistrBar.Rd
Plot the percentage/absolute cell count of each cluster in each sample
ClusterDistrBar(
origin,
cluster,
rev = F,
normalize = rev,
percent = T,
plot = T,
flip = T,
width = 0.9,
stack = T,
cols = "pro_default",
border = "white"
)
factor/vector of sample
factor/vector of cluster
If TRUE, plot the proportion of sample in each cluster, Default: F
Normalize sample size to 100, Default: rev
If FALSE, plot absolute cell number instead of percentage, Default: T
Generate plot (TRUE) or matrix (FALSE), Default: T
If plot bars horizontally, Default: T
Width of bars, Default: 0.9
If TRUE, plot stacked bars, Default: T
Colors to use for plotting. Default: "pro_default"
Border color, Default: "white"
ggplot object or matrix
See example
ClusterDistrBar(origin = pbmc$orig.ident, cluster = pbmc$cluster)
# absolute cell count
ClusterDistrBar(origin = pbmc$orig.ident, cluster = pbmc$cluster, percent = F)
# reverse x and y axis, normalized by sample size
ClusterDistrBar(origin = pbmc$orig.ident, cluster = pbmc$cluster, rev = T, normalize = T)
# reverse x and y axis, not normalized by sample size
ClusterDistrBar(origin = pbmc$orig.ident, cluster = pbmc$cluster, rev = T, normalize = F)
# vertical bar plot
ClusterDistrBar(origin = pbmc$orig.ident, cluster = pbmc$cluster, flip = F)
# not stacking bars
ClusterDistrBar(origin = pbmc$orig.ident, cluster = pbmc$cluster, flip = FALSE, stack = FALSE)
# export matrix
ClusterDistrBar(origin = pbmc$orig.ident, cluster = pbmc$cluster, plot = F)