satijalab / seurat

R toolkit for single cell genomics
http://www.satijalab.org/seurat
Other
2.29k stars 915 forks source link

A less biased approach to cluster renaming? #8435

Open KevinMaroney opened 9 months ago

KevinMaroney commented 9 months ago

Hi all, I have a theory question, not an issue for once. So I have all these seurat clusters from different samples which were merged (no batch effect) and thereby have metadata inherited from their source. I used SingleR on the cell subset I know they are (CiteSeq markers) to classify by memory. I have all of this. My main question is in how to apply all this nice, neat metadata to my clusters in a non-fucky way. My approach was to just make tables of the number of cells with each metadata type/cluster, then use pheatmap to make a z-score heatmap by row (rows are clusters and columns are metadata) with the Z-scores labelling each cell. Then, to "call" my clusters different metadata, I'm taking the top Z-score as well as any Z-score within 0.6 (a smaller margin would actually benefit me, but it feels like cheating, if there are still quite a few mapping to other metadata) to call it the top 1-4, or 1-5 if there's no difference. This still doesn't feel scientific enough to me, but it does seem better than the approach I see most others do, just "picking one" per cluster and manually renaming everything. Any thoughts on how to make this better? Or is there another approach that I should use? This will drive much of my DEG analysis so I'm just trying to be cautious.

image

Code used to generate table and heatmap (replaced actual metadata name manually in vector software with Metadata 1/2/etc. because sensitive, not important): Table_RelativeMetadata <- table(Sig_Increase_ClonotypePair_Seurat@meta.data$seurat_clusters, Sig_Increase_ClonotypePair_Seurat@meta.data$MetadataGroup) heatmap1 <- as.ggplot(pheatmap::pheatmap(Table_RelativeMetadata, scale = "row", cellwidth = 30, display_numbers = TRUE, fontsize_number = 5, treeheight_row = 0, treeheight_col = 0))

Cell number table which is converted to Z-score in heatmap:

image

Gesmira commented 4 months ago

Hi @SomeGuy3865,

Thanks for your question!

In an effort to more promptly address user issues, we’ve started asking users to direct questions like this to our Discussions board, where community members and developers can provide more targeted assistance.

We’re going to close this issue for now but strongly encourage you to repost your question in the other forum.

We look forward to seeing your post there - thanks for using Seurat!