Question: How To Draw A Heat Map For Gene Expression Data?
gravatar for Fahmida
8.4 years ago by
Fahmida80 wrote:

I have a data set containing about 3000 genes with their numerical expression values and P-values.That means each gene has one expression value and one P-value.Now How can I draw a heat map?

microarray heatmap • 60k views
ADD COMMENTlink modified 16 months ago by sonpham570 • written 8.4 years ago by Fahmida80

How come you have only one expression value per gene? This sound as you would have measured the expression for one sample. What does this p-value mean, then?

ADD REPLYlink written 8.4 years ago by Laurent1.6k

You mean cluster THEN draw a heat map?

ADD REPLYlink written 8.4 years ago by Martin A Hansen3.0k

@Laurent It's probably the P value for a present/absent call (e.g. from Illumina's BeadArray software), but Fahmida would have to confirm that.

ADD REPLYlink written 8.4 years ago by David Quigley11k

This kind of questions has already been addressed (and answered) a few times. You can find some insights here:

ADD REPLYlink modified 18 days ago by RamRS24k • written 8.4 years ago by Philippe1.9k

@David Quigley -- Yes, that's what I thought too, but then the heatmap does not make too much sense.

ADD REPLYlink written 8.4 years ago by Laurent1.6k

Yup, David is right, the P-value is for a present/absent call. Thanks to all. but one another question If I have such a data set which I have mentioned earlier,that means 3000 gene and each has single expression level and P-value for a present and absent call and this set up is for all the 39 experimental condition,then can I do any meaningful statistical operation to this data set?

ADD REPLYlink written 8.3 years ago by Fahmida80
gravatar for Laurent
8.4 years ago by
Cambridge, UK
Laurent1.6k wrote:

R is very good to explore your data and draw plots. Here is how to plot a heatmap using the heatmap function.

## Some dummy data: 100 genes x 10 samples 
> d <- matrix(rnorm(1000),100)
> rownames(d) <- paste("gene",1:100,sep="")
> colnames(d) <- LETTERS[1:10]
> head(d)
               A           B          C           D          E           F
gene1 -1.0362235  0.82685836 -0.3053555 -1.25348438 -1.1167804 -0.21246920
gene2 -1.0280138 -0.10380856 -0.4725301 -0.02306777 -0.6119725  0.10499482
gene3 -1.2072158 -0.09147717  0.2429783  0.18397650 -0.5749762 -0.82854688
gene4  1.3769346 -0.34478739 -1.6498159 -0.04752349 -0.3759327  0.04173142
gene5 -0.8177475 -0.20440739 -1.4889405  0.50194321  0.9544585  1.23902602
gene6  0.5511526  0.62477829 -0.2677255 -0.74236524 -0.1572775  0.91825030
               G          H          I           J
gene1 -0.9427938 -1.4545177 -1.0756554 -0.08241979
gene2 -1.7248344 -2.2090110 -1.5504237 -0.19954993
gene3  0.2018804  1.7318818 -1.8288649  0.58678452
gene4  0.2948888 -0.2522309 -1.1669122 -0.60243273
gene5  1.0042703  0.5899186 -0.4196320 -0.66348636
gene6  2.3309169 -1.0491888  0.3506227 -0.71594841

And now, the heatmap function get the figure

> heatmap(d)


See ?heatmap for details and customisation. To read you data into R, see ?read.table, assuming it is in a csv format, or similar.

Hope this helps.

EDIT: The dendrograms have been added automatically. In brief, the heatmap represents the values in your data matrix (scaled and centred by default) and the hierarchical clustering is performed along columns and rows using the hclust function (see ?hclust) based on eucledian distance (see ?dist).

To draw then manually

> dd <- matrix(rnorm(100),5,2)
> distMatrix <- dist(dd) ## genes/lines -- use dist(t(dd)) for samples/columns
> distMatrix
         1        2        3        4
2 1.139330                           
3 2.764294 2.995049                  
4 1.654401 2.484039 1.677883         
5 1.254484 1.291086 1.714694 1.483167
> dendro <- hclust(distMatrix)
> plot(dendro)


ADD COMMENTlink modified 8.4 years ago • written 8.4 years ago by Laurent1.6k

Has R put the trees in or is that external? Cant see how it could be done from your inputs. Only Ive been looking to do a heatmap just like that AND to learn R for ages and this would kill two birds with one stone!

ADD REPLYlink written 8.4 years ago by Daniel3.7k

Thank you for the expansion, very interesting. This has bumped learning R from near the bottom of my todo list right to the top.

ADD REPLYlink written 8.4 years ago by Daniel3.7k


suppose that i have already downloaded GSE63706 and normalized that and i have a normalized text file now. and i have also a list of probsets (a text file of my interest probsets) in this array...i want to have a heat map showing the expression pattern of my interest probsets in this array, for example in this array i have 4 varieties and different tissues (rind and flesh) and phases (0,10,20,30,40 and 50 days after harvesting). heat maps showing the expression pattern of my probsets in varieties, tissues and phases i mean

ADD REPLYlink written 4.2 years ago by Angel3.5k
gravatar for Ian
8.4 years ago by
University of Manchester, UK
Ian5.5k wrote:

Here is a GUI called Microarray Software Suite (MeV). It has quite a simple tab-delimited upload format and lots of other functions, besides heatmaps.

Another is called GenePattern, but i have not really looked at this, just seen papers that have used it.

ADD COMMENTlink written 8.4 years ago by Ian5.5k

Another choice is HeatmapGenerator, which draws heatmaps based on R's heatmap libraries directly within a user-friendly GUI environment. 

ADD REPLYlink modified 4.4 years ago • written 4.4 years ago by Bohdan Khomtchouk320
gravatar for Rm
8.4 years ago by
Danville, PA
Rm7.9k wrote:

heatmap builder from Dr. Ashley 's lab

ADD COMMENTlink written 8.4 years ago by Rm7.9k
gravatar for alaincoletta
5.4 years ago by
alaincoletta160 wrote:

Are you a bioinformatician or a biomedical researcher?

If you are a Biomedical researcher I would recommend Gene-E from the Broad Institute to generate heatmaps, calculate differential gene expression and clusterings, and GenePattern (also from the Broad) to to perform more advanced analyses such as GSEA.

If you have Affymetrix .CEL files and an excel spreadsheet with clinical annotations you can use InSilico DB ( to go from you .CEL files to a list of differential expressed genes in Gene-E in ~20 mintutes (registration and upload included). Large datasets take longer to upload.



ADD COMMENTlink written 5.4 years ago by alaincoletta160
gravatar for Bohdan Khomtchouk
4.5 years ago by
Stanford University
Bohdan Khomtchouk320 wrote:

Try HeatmapGenerator to produce heatmaps directly in R without needing to know how to program in R:


ADD COMMENTlink written 4.5 years ago by Bohdan Khomtchouk320
gravatar for mitra.tajro
18 months ago by
mitra.tajro0 wrote:

Hi every one

There are miRNA sets containing cancer and healthy samples. I want to identify miRNA probes that differentially expressed in healthy subjects and cancer patients by applying t-test. Is there any one can help?


ADD COMMENTlink written 18 months ago by mitra.tajro0
gravatar for sonpham
16 months ago by
sonpham570 wrote:

This can be helpful:

ADD COMMENTlink written 16 months ago by sonpham570
Please log in to add an answer.


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