This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Heatmap2 code error

Hello I am using the following code for heatmap2 heatmap.2(as.matrix(X), col=redgreen(75), scale="row", key=T, keysize=1.5, density.info="none", trace="none",cexCol=0.9, labRow=NA). The head of my data as the following: AF PPTAF/PPT ICIPF PPTPF PPT ICIAD PPTAD PPT ICI` <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> 1 155. 24.2 24.2 23.0 24.2 22.2 2 18.0 4.97 13.1 9.60 13.1 15.1 3 199. 28.4 47.8 41.3 47.8 43.8 4 12.8 2.34 6.77 9.31 6.77 8.77 5 8.22 5.76 8.76 5.76 8.76 8.76 6 13.1 22.1 21.8 20.2 11.8 15.8

When I got the heatmap, the columns were not in order. See the figure I got: https://imgur.com/a/iZml9Co Any help explain why I am not getting the columns in the same order.

Thanks a lot

r

1 answer

Add Colv=NA to heatmap.2(as.matrix(X), col=redgreen(75), scale="row", key=T, keysize=1.5, density.info="none", trace="none",cexCol=0.9, labRow=NA, Colv=NA).

For detail, see manual of gplots::heatmap.2

BTW, see How to add images to a Biostars post to get how to upload figures. https://i.imgur.com/qjNR25g.jpg instead of https://imgur.com/a/iZml9Co should be used. Thank you.

Thank you so much, it worked

Log in to answer this question.