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.
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?
1 answer
DoHeatmap does not cluster (either rows or columns). If you want to "see patterns" you have two options:
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 (
FindAllMarkerslikely). Te patterns you see are the top genes in each cluster.You extract the count matrix and use a different tools (e.g.
pheatmapwithcluster_rowsandcluster_colsset toTRUE) to generate the figure.
Log in to answer this question.