Search
Question: heatmap.2 question - plotting gene expression ordered by a vector
0
gravatar for Iain Gallagher
9.2 years ago by
United Kingdom
Iain Gallagher910 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. 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]]
ADD COMMENTlink modified 9.2 years ago by Sean Davis21k • written 9.2 years ago by Iain Gallagher910
0
gravatar for Sean Davis
9.2 years ago by
Sean Davis21k
United States
Sean Davis21k wrote:
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 COMMENTlink written 9.2 years ago by Sean Davis21k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 225 users visited in the last hour