I'm trying to create a cluster plot in Seurat where instead of the cluster colours being determined by cluster IDs, they are determined by the the transcripts per cell (
I have tried to use the
DimPlot() function for this:
DimPlot(rna, reduction = "umap", label = TRUE, group.by = 'nCount_RNA')
DimPlot(rna, reduction = "umap", label = TRUE, group.by = rna$nCount_RNA)
As you can see, I'm trying to pass the
nCount_RNA ident to the
group.by parameter but neither of these produce the desired result. The former produces a list of numbers on the plot screen and the latter throws an error:
Error in `[<-.data.frame`(`*tmp*`, , group.by, value = list()) : new columns would leave holes after existing columns
DimPlot() help page refers to passing
'ident' to group by identity class, as far as I understand it the first command is passing the
nCount_RNA ident to group by by it's identity class, but I could be mistaken in this.
I'm a bit stumped by this. It seems like I may be missing something trivial here.
Any tips on how to generate this plot would be greatly appreciated.
P.S. I know the violin plots can do something similar (see below) but I'd also like to visualise this on the clusters themselves.
umiPerCell_post_clust_plot <- VlnPlot(rna, features = c("nFeature_RNA"), pt.size = 0.5) + ggtitle("UMI per cluster")