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_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_GB.UTF-8;LC_IDENTIFICATION=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]]

