I am trying to visualize the frequency of the different cells clusters on Seurat object clustered using SingleR. It is a naive question but am not sure what should I have in the Var. supposedly, it is the clusters in metadata but It keeps giving me the error "Error in .var_OR_get_meta_or_gene(var, object) :
pred21@meta.data is not a metadata or gene nor equal in length to ncol('object')"
```dittoBarPlot(
object = JHMV21,
var = "pred21@meta.data")
You'll also need a secondary metadata to group.by, for which you could probably use 'orig.ident', but this will entirely depend on how you want to organize the data.
So try:
dittoBarPlot(
JHMV21,
var = 'SingleR.labels',
group.by = 'orig.ident'
)
You may also wish to add scale = "count" to see numbers rather than percent.