How to export heatmap clusters to csv?
2
0
Entering edit mode
5.1 years ago
WUSCHEL ▴ 750

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 • 3.3k views
ADD COMMENT
2
Entering edit mode
5.1 years ago

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.

ADD COMMENT
2
Entering edit mode
5.1 years ago
Ashastry ▴ 60

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.

ADD COMMENT

Login before adding your answer.

Traffic: 2934 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6