Question: Seurat - label cells in cluster plot by transcripts per cell
gravatar for camerond
3 months ago by
camerond150 wrote:

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 (nCount_RNA).

I have tried to use the DimPlot() function for this:

DimPlot(rna, reduction = "umap", label = TRUE, = 'nCount_RNA')


DimPlot(rna, reduction = "umap", label = TRUE, = rna$nCount_RNA)

As you can see, I'm trying to pass the nCount_RNA ident to the 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 `[<`(`*tmp*`, ,, value = list()) : 
new columns would leave holes after existing columns

The 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")

ADD COMMENTlink modified 3 months ago by rpolicastro3.3k • written 3 months ago by camerond150
gravatar for rpolicastro
3 months ago by
Bloomington, IN
rpolicastro3.3k wrote:

For continuous variables you want to use FeaturePlot. Your code should be something like:

FeaturePlot(rna, features="nCount_RNA", label=TRUE)
ADD COMMENTlink modified 3 months ago • written 3 months ago by rpolicastro3.3k

Yes - that's the one. Many Thanks. Wrong function!

ADD REPLYlink written 3 months ago by camerond150
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2479 users visited in the last hour