satijalab / seurat

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

How to output DoHeatmap matrix data ? #9503

Closed lidd77 closed 3 hours ago

lidd77 commented 12 hours ago

Hello,

`DoHeatmap(obj, features = c("g1", "g2", "g3")  ) `    

I am using  DoHeatmap to draw heatmap figure.

I want to get the matrix data used by DoHeatmap, so I can draw a heatmap figure flexibly. How to output that matrix data that DoHeatmap uses ?

For the default output of DoHeatmap , row is Gene, col is Cluster, I want to set row as Cluster and col as Gene, Does DoHeatmap support this request ?

thank you ! Expecting your reply !

Best

samuel-marsh commented 3 hours ago

Hi,

Not member of dev team but hopefully can be helpful. You can see the raw code here that is used to get the data used in DoHeatmap(https://github.com/satijalab/seurat/blob/1549dcb3075eaeac01c925c4b4bb73c73450fc50/R/visualization.R#L232

DoHeatmap does not support flipping the orientation current but this can be done either with ggplot in custom heatmap or using other heatmap packages.

Best, Sam