This is a test version of Biostars. For the public version, visit https://www.biostars.org.
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)
rna-seq r r

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.

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.

Log in to answer this question.