heatmap.2 question - plotting gene expression ordered by a vector
1
0
Entering edit mode
@iain-gallagher-2532
Last seen 8.7 years ago
United Kingdom
Hi List. I have question I hope someone can help me with. I have a matrix of gene expression results and I would like to generate a heatmap with each gene plotted in the order of a vector (specifically a biological parameter that all the genes co vary with). I've been wrestling with this for a couple of days now and I'm not sure my approach is right. z_mat is my matrix - samples in columns and genes in rows. max_resp is my biological parameter - a vector of values (1 for each subject). What I'd like is a gradient of expression for each gene (ideally)... the expression values do generally increase as max_resp increases. But I can't seem to get this and my heatmaps seem messier than they should be. Is there a way to order the rows (gene expression values) of the heatmap to reflect the order of the max_resp vector? For example I've tried: max_order<-order(change_data[,2]) to set a vector reflecting the order of the max_resp parameter from lowest to highest heatmap.2(z_mat, col=heatcols, Colv=max_order, labCol=change_data[,2][max_order]) but the labeling (labCol) is not in order (i.e. max_order) and the colour gradient does not reflect my data (i.e. generally good correlation of gene expression and max_resp). My understanding of the heatmap.2 help is that setting Colv (or Rowv) to a vector reorders the dendrogram to the vector order... my understanding is likely flawed. Could someone give me some advice? Thanks. Iain sessionInfo() R version 2.7.2 (2008-08-25) i486-pc-linux-gnu locale: LC_CTYPE=en_GB.UTF-8;LC_NUMERIC=C;LC_TIME=en_GB.UTF-8;LC_COLLATE=en_GB .UTF-8;LC_MONETARY=C;LC_MESSAGES=en_GB.UTF-8;LC_PAPER=en_GB.UTF-8;LC_N AME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_GB.UTF-8;LC_IDENTI FICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] RColorBrewer_1.0-2 gplots_2.6.0 gdata_2.4.2 gtools_2.5.0 [[alternative HTML version deleted]]
• 1.1k views
ADD COMMENT
0
Entering edit mode
@sean-davis-490
Last seen 3 months ago
United States
On Thu, Sep 4, 2008 at 5:29 PM, Iain Gallagher <iaingallagher at="" btopenworld.com=""> wrote: > Hi List. > > I have question I hope someone can help me with. I have a matrix of gene expression results and I would like to generate a heatmap with each gene plotted in the order of a vector (specifically a biological parameter that all the genes co vary with). I've been wrestling with this for a couple of days now and I'm not sure my approach is right. > > z_mat is my matrix - samples in columns and genes in rows. > > max_resp is my biological parameter - a vector of values (1 for each subject). > > What I'd like is a gradient of expression for each gene (ideally)... the expression values do generally increase as max_resp increases. But I can't seem to get this and my heatmaps seem messier than they should be. > > Is there a way to order the rows (gene expression values) of the heatmap to reflect the order of the max_resp vector? > > For example I've tried: > > max_order<-order(change_data[,2]) > > to set a vector reflecting the order of the max_resp parameter from lowest to highest > > heatmap.2(z_mat, col=heatcols, Colv=max_order, labCol=change_data[,2][max_order]) > > but the labeling (labCol) is not in order (i.e. max_order) and the colour gradient does not reflect my data (i.e. generally good correlation of gene expression and max_resp). > > My understanding of the heatmap.2 help is that setting Colv (or Rowv) to a vector reorders the dendrogram to the vector order... my understanding is likely flawed. You need to at least turn off row dendrograms; you cannot arbitrarily reorder a dendrogram. However, I remember that there were some bugs with heatmap.2 in the past that precluded the row ordering from working correctly (i.e., vector order if dendrogram was not used). I haven't checked recently to see if that is still the case. Hope that helps. Sean
ADD COMMENT

Login before adding your answer.

Traffic: 482 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