Percentage of each cluster in Seurat I am using Seurat to analyze my single cell data. I have 2 conditions, treated and untreated.  I am trying to create a stacked bar graph in order to show the differences in cell types for each condition but need to collect the percentages of each cluster for the specific cell types. How to I put together a sheet that contains the percentages of each cluster and the make a stacked bar graph of comparison of each condition.
pt &lt;- table(Idents(myobj), myobj$orig.ident)
pt &lt;- as.data.frame(pt)
pt$Var1 &lt;- as.character(pt$Var1)

ggplot(pt, aes(x = Var2, y = Freq, fill = Var1)) +
  theme_bw(base_size = 15) +
  geom_col(position = "fill", width = 0.5) +
  xlab("Sample") +
  ylab("Proportion") +
  scale_fill_manual(values = brewer.pal(12, "Paired")) +
  theme(legend.title = element_blank())


This shall work. myobj is your seurat object. This is my old code so if I remember correct, orig.ident is your treated and untreated conditions. Idents should give you cell clusters.
If this does not work, please let me know