cole-trapnell-lab / monocle-release

277 stars 116 forks source link

Extract gene list in the order plotted on heatmap by plot_pseudotime_heatmap #504

Open shabs24 opened 10 months ago

shabs24 commented 10 months ago

Hello!

Is it possible to extract the list of genes in the order they appear on the heatmap in each cluster.

Any help will be appreciated.

Thanks

Cynthia1012 commented 5 months ago

I have the same problem. Have you managed to solve it?

shabs24 commented 5 months ago

I have the same problem. Have you managed to solve it?

Yes, I was able to solve it. Here is the code

t <- plot_pseudotime_heatmap(cds[genes,],cluster_rows = TRUE, show_rownames = TRUE,return_heatmap=T) t.data=cutree(t$tree_row, k=6) t.order = t$tree_row[["order"]] heatmap.rows = as.data.frame(t.data[t.order])