This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Seurat 'DoHeatmap()' hierarchical clustering

Hello. I am trying to draw a heatmap using the 'DoHeatmap()' function of 'Seurat'.

When I draw a heatmap using the 'DoHeatmap()' function, I want to cluster by gene.

The first picture is the heatmap I drew, and the second picture is the heatmap I want.

enter image description here

enter image description here

In the heatmap I drew, the columns are cell types, and the rows are genes. If you look at it, I don't see a pattern in the heatmap I drew. I want to do clustering according to genes. How can I do clustering?

doheatmap seurat clustering

1 answer

DoHeatmap does not cluster (either rows or columns). If you want to "see patterns" you have two options:

  1. Order the genes and cell types yourself. This is what happens in the second figure, where the genes are ordered (likely) based on the result of DE analysis (FindAllMarkers likely). Te patterns you see are the top genes in each cluster.

  2. You extract the count matrix and use a different tools (e.g. pheatmap with cluster_rows and cluster_cols set to TRUE) to generate the figure.

Log in to answer this question.