How to export heatmap clusters to csv?
I am unable to get gene names to heatmap in a readable font (> 600 genes). Is there any way that I could export clustering genes to a separate file (e.g. csv)?
plot_heatmap(df, type = "centered", kmeans = TRUE,
k = 6, col_limit = 2, show_row_names = T)
• 4,209 views
•
link
2 answers
Assign it to an object and then take a look inside that object with str(). For example:
hmap <- plot_heatmap(...)
str(hmap)
You will likely see a 'slot' (variable) that contains the gene names and / or their cluster assignments.
• 0 views
•
link
Try saving it to a large pdf or as an image.
pdf("heat maps.pdf", height =1000, width= 1000)
plot_heatmap{your code}
dev.off()
This should save the plot to your working directory. You can also change pdf to png for an image.
• 0 views
•
link
Log in to answer this question.