Skip to main content
Topic: Heat Map Visualization (Read 9717 times) previous topic - next topic

Heat Map Visualization

Hi,

 I have been attempting to visualize the data as a heat map but haven't found much luck in doing so. Ideally, I'd love to display the data showing changes in abundance with color between two conditions compared to a control group. Does anyone know the correct R code to perform this action? I have looked for the code to make a heat map but I really need something more similar to how microarray data is displayed.

Thank you for your input and if you require further information, please do not hesitate to ask,

Sam

Re: Heat Map Visualization

Reply #1
Sam,

There are many different packages to show your data as heatmaps. I've outlined some code below which should hopefully be useful.


Code: [Select]
library(xcms)
library(faahKO)
cdfpath <- system.file("cdf", package = "faahKO")
cdffiles <- list.files(cdfpath, recursive = TRUE,full=T)
faahko <- xcmsSet(cdffiles)
faahko <- group(faahko)
The above loads the faahko toy dataset. You can skip this step and use your own data. I'm just using it for demo purposes.

Code: [Select]
values<-groupval(faahko) ## gets the raw values of each feature from each file
image(values) ## a simple heatmap
library(lattice)
levelplot(values) ## a nicer heatmap look at the the help for more details ie ?levelplot
library(gplots) ## a very good graphics library
heatmap.2(values, Rowv=F, Colv=F, dendrogram="none", trace="none", scale="none", col=redgreen)
## probably more what you want. You can scale the data to z values using scale="row"
## might also want to look at the dendrogram cluster
heatmap.2(values, Rowv=F, Colv=T, dendrogram="col", trace="none", scale="row", col=redgreen)

I would also suggest looking at this site for general R help:
http://www.statmethods.net/
and for the heapmaps:
http://www2.warwick.ac.uk/fac/sci/moac/ ... r/heatmap/
~~
H. Paul Benton
Scripps Research Institute
If you have an error with XCMS Online please send me the JOBID and submit an error via the XCMS Online contact page

Re: Heat Map Visualization

Reply #2
Thank you very much for the reply. I am on my way to making a better figure. However, I am wondering how I can group the files such that the control conditions files are merged to one dataset and the treatment is another. I want to display differences between the control condition and the treatment.

 

Re: Heat Map Visualization

Reply #3
sam,

I would name all of the columns with the names that you want so that all classes are named the same. You could probably look at playing with factors but that will be complicated. If you look at the example all of KO and WT are plotted together due to the naming of the columns ie:

colnames(values)
 [1] "ko15" "ko16" "ko18" "ko19" "ko21" "ko22" "wt15" "wt16" "wt18" "wt19" "wt21" "wt22"

Hope it helps.

Paul

EDIT : This pdf has some good examples p10
http://chromium.liacs.nl/R_users/200602 ... others.pdf
~~
H. Paul Benton
Scripps Research Institute
If you have an error with XCMS Online please send me the JOBID and submit an error via the XCMS Online contact page