scverse / scanpy

Single-cell analysis in Python. Scales to >1M cells.
https://scanpy.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.9k stars 599 forks source link

Idents in Featureplot in Seurat outputs Idents name on top of the if Label is set to true. How do we see labels on top of scanpy UMAP plots. #2257

Open smk5g5 opened 2 years ago

smk5g5 commented 2 years ago

Hi,

Seurat allows us to set an Ident and when we do a feature plot we can label that feature plot with that ident. If I were to achieve something similar how would I go about it in scanpy? It is particularly useful when you are looking at the UMAP and want to figure out based on the expression over the UMAP as to which clusters are expressing a gene and deciding whether that particular cluster is a particular celltype.

Thanks

LuckyMD commented 2 years ago

Hey! You can colour a umap plot with covariate 'key' via sc.pl.umap(adata, color='key'). Here 'key' can be anything from a gene name or the clustering covariate. Is that what you are looking for?

smk5g5 commented 2 years ago

Nope what I am looking for is Featureplot functionality of Seurat in scanpy where you can label the UMAP by Idents like shown in the attached figure. umap 50 0 7 colorby UMI lab Cycling 220501

smk5g5 commented 2 years ago

Here the Ident is set to be a particular clustering resolution and we are visualizing nCount on the UMAP. So basically what I am looking for is "Color by Key" and label by idents.

LuckyMD commented 2 years ago

I see. That's not something that is implemented at the moment. You would have to combine a umap plot with legend_loc = 'on data' with a feature plot. I guess I've been using two plots next to one another for this type of thing. Sounds like a good feature request to me.

ivirshup commented 2 years ago

From the example plot, I'm not sure that one would be able to tell which labels map to which points.

LuckyMD commented 2 years ago

I guess that's not strictly necessary for interpretation. If you plot only gene expression on a UMAP, you are interpreting regions of that plot. This is at least a bit better in that you can focus on clusters after your first overlayed plot.