Question: Seurat - label cells in cluster plot by transcripts per cell
0
gravatar for camerond
3 months ago by
camerond150
Cardiff
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, 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")

ADD COMMENTlink modified 3 months ago by rpolicastro3.3k • written 3 months ago by camerond150
2
gravatar for rpolicastro
3 months ago by
rpolicastro3.3k
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.

Help
Access

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
_