How to display all top markers in the heatmap by DoHeatmap (Seurat) when there are duplicates of top marker genes for several cell clusters
1
0
Entering edit mode
7 months ago
alwayshope ▴ 40

Dear genius,

Is there a way to display all the top markers in the heatmap by DoHeatmap (Seurat) when there are duplicates for several cell clusters?

Followed the tutorial from Seurat to integrate the treat and control Seurat object: https://satijalab.org/seurat/articles/integration_introduction.html, DoHeatmap(combined, features = top5$gene, group.by = "seurat_clusters") while the heatmap for the top markers is not all displayed, although I checked the top5$gene, it is indeed 35 genes for the 7 cell clusters, and class(top5$gene) are character, not factor

enter image description here

DoHeatmap Seurat • 932 views
ADD COMMENT
1
Entering edit mode
7 months ago
bk11 ★ 2.4k

You can create a new assay with the splitted genes expression for all your top genes including duplicates (label duplicates with cluster id), ScaleData and run DoHeatmap as follows-

seurat_object
# make a new assay with the splited genes expression for all your top genes
MS4A1.cl1 <- seurat_object[['RNA']]$data["MS4A1",] * (seurat_object$seurat_clusters == "1")
MS4A1.cl2 <- seurat_object[['RNA']]$data["MS4A1",] * (seurat_object$seurat_clusters == "2")

#Store these gene expressions in "NEW" assay 
seurat_object[['NEW']] <- CreateAssayObject(seurat_object = rbind(MS4A1.t1, MS4A1.t2))
DefaultAssay(temp) <- "NEW"
seurat_object <- ScaleData(seurat_object) ##DoHeatmap used scaled data
DoHeatmap(seurat_object, features = c("MS4A1.cl1", "MS4A1.cl2"))

enter image description here

ADD COMMENT
0
Entering edit mode

Great guidance! Thank you very much!

ADD REPLY

Login before adding your answer.

Traffic: 2457 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