Seurat - label cells in cluster plot by transcripts per cell
Entering edit mode
5 months ago
camerond ▴ 160

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

Seurat RNA-Seq single-cell cluster labelling • 536 views
Entering edit mode
5 months ago

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

FeaturePlot(rna, features="nCount_RNA", label=TRUE)
Entering edit mode

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


Login before adding your answer.

Traffic: 1833 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6