ClusterDistrBar.RdPlot the percentage/absolute cell count of each cluster in each sample
ClusterDistrBar(
  origin,
  cluster,
  rev = F,
  normalize = rev,
  percent = T,
  plot = T,
  flip = T,
  reverse_order = T,
  width = 0.9,
  stack = T,
  cols = "light",
  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
If TRUE, will reverse the default stacking order. Default: T
Width of bars, Default: 0.9
If TRUE, plot stacked bars, Default: T
Colors to use for plotting. Default: "light"
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, and keep the default stacking order
ClusterDistrBar(origin = pbmc$orig.ident, cluster = pbmc$cluster, flip = F, reverse_order = 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)