Hello, I am trying to make a heatmap in R and am having some trouble. I am very new to the world of R, but have been told that what I am trying to do should be possible. I want to make a heat map that looks like a gene expression heatmap (see http://en.wikipedia.org/wiki/Heat_map).
I have 43 samples and 900 genes (yes I know this will be a huge map). I also have copy numbers associated with each gene/sample and need these to be represented as the colour intensities on the heat map. There are multiple genes per sample with different copy numbers. I think my trouble may be how I am setting up my data frame. My data frame was created in excel as a tab deliminated text file: Gene Copy Number Sample ID A 1935 01 B 2057 01 C 2184 02 D 1498 03 E 2294 03 F 2485 03 G 1560 04 H 3759 04 I 2792 05 J 7081 05 K 1922 06 . . . . . . . . . ZZZ 1354 43 My code in R is something like this: data<-read.table("/Users/jsmt/desktop/test.txt",header=T) data_matrix<-data.matrix(data) data_heatmap <- heatmap(data_matrix, Rowv=NA, Colv=NA, col = cm.colors(256), scale="column", margins=c(5,10)) I end up getting a heat map split into 3 columns: sample, depth, gene and the colours are just in big blocks that don't mean anything. Can anyone help me with my dataframe or my R code? Again, I am fairly new to R, so if you can help, please give me very detailed help :) Thanks in advance! -- View this message in context: http://r.789695.n4.nabble.com/Heat-map-in-R-tp3176478p3176478.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.