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
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"))
ADD COMMENT
• link
updated 15 months ago by
Ram
44k
•
written 15 months ago by
bk11
★
3.0k
Great guidance! Thank you very much!