Plots proportions of a group of cells within a secondary group of cells. E.g. The proportions of samples in seurat clusters, or the proportions of samples in defined cell subtypes
GEX_proportions_barplot(GEX, source.group, target.group, stacked.plot)
Returns a ggplot barplot showing cell proportions by source and target group.
GEX Seurat object generated with VDJ_GEX_matrix (VDJ_GEX_matrix.output[[2]])
Character. A column name of the GEX@meta.data with the group of which proportions should be plotted
Character. A column name of the GEX@meta.data with the group to calculate proportions within. If unsure, see examples for clarification
Boolean. Defaults to FALSE. Whether to return a stacked barplot, with the y axis representing the % of cells of the target group. If set to FALSE a normal barplot (position = "dodge") will be returned with the y axis representing the % of cells of the source group
# \donttest{
try({
GEX_proportions_barplot(GEX = Platypus::small_vgm[[2]], source.group = "sample_id"
, target.group = "seurat_clusters",stacked.plot = FALSE)
GEX_proportions_barplot(GEX = Platypus::small_vgm[[2]],
source.group = "seurat_clusters", target.group = "sample_id"
,stacked.plot = TRUE)
})
# }
Run the code above in your browser using DataLab