Seurat - label cells in cluster plot by transcripts per cell
1
0
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, group.by = 'nCount_RNA')

OR

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

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
ADD COMMENT
2
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)
ADD COMMENT
0
Entering edit mode

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

ADD REPLY

Login before adding your answer.

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

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

Powered by the version 2.3.6