Go Back   SEQanswers > Bioinformatics > Bioinformatics

Similar Threads
Thread Thread Starter Forum Replies Last Post
RNA-seq, RPKM and heatmap??? sdwy2008 RNA Sequencing 10 07-14-2011 11:41 PM
R: heatmap color palette akolman Bioinformatics 5 06-16-2011 12:51 PM
DESeq question gfmgfm Bioinformatics 2 04-18-2011 04:15 AM
ncRNA heatmap with next gen sequencing NicoBxl Bioinformatics 2 11-23-2010 02:12 AM
'heatmap' tool Livi81 General 0 07-14-2010 04:07 PM

Thread Tools
Old 03-01-2012, 01:14 AM   #1
Senior Res.
Location: Plovdiv, Bulgaria

Join Date: Oct 2008
Posts: 110
Default help with a heatmap with deseq - legend?

I have made with deseq a heatmap, but it does not show a legend/colorkey and I need to have it?

I did not see elsewhere how colorkey/legends is made when heatmap is generated from sequencing copy number values, it should not de in log2 values or?
vebaev is offline   Reply With Quote
Old 03-03-2012, 08:28 AM   #2
Wolfgang Huber
Senior Member
Location: Heidelberg, Germany

Join Date: Aug 2009
Posts: 109

Dear Vebaev

DESeq does not do heatmaps. The programming language R, in which DESeq is implemented, has functions to make heatmaps, and I recommend that you have a look at the manual pages of some of these functions, for instance

## install (do only once)

## load (do each time you need it)

As to transformation - the log2-transformation is problematic due to its singularity at 0 and its large slope for values close to 0. Doing no transformation is also problematic since then the dynamic range of the colour scale tends to be "wasted" on a sparse set of large values. My recommdation is to have a look at Section 6 of the DESeq vignette, Variance stabilizing transformation, where in Fig.13 you also see an example heatmap (but using the more primitive function heatmap that does not offer a color bar).

Hope this helps,

Wolfgang Huber
Wolfgang Huber is offline   Reply With Quote
Old 03-03-2012, 08:42 AM   #3
David Eccles (gringer)
Location: Wellington, New Zealand

Join Date: May 2011
Posts: 835

Here's an R function for producing a heatmap based on the vsd data (together with colour legend and dendrogram):

make.heatmap <- function(data.vsd, columns = dim(data.vsd)[2], col = colorRampPalette(blues9)(100), log = FALSE, top = dim(data.vsd)[1], method = "canberra"){
  hm.dist <- dist(t(head(data.vsd[,columns],top)), method = method);
  hm.dend <- as.dendrogram(hclust(hm.dist));
  scaled.mat <- as.matrix(hm.dist);
    scaled.mat <- log(scaled.mat);
  diag(scaled.mat) <- NA;
  scaled.mat <- scaled.mat[order.dendrogram(hm.dend),rev(order.dendrogram(hm.dend))];
  scaled.range <- t(as.matrix(seq(range(scaled.mat, na.rm = TRUE)[1],
                                  range(scaled.mat, na.rm = TRUE)[2], length.out = 100)));

  layout(matrix(1:3,1,3),widths = c(1,2,8));
  par(mar = c(10,3,0.5,0.5));
  image(1,scaled.range[1,],scaled.range, col = col,
        xlab = "", ylab = "", xaxt = "n");
  plot(hm.dend, axes = FALSE, horiz = TRUE, yaxs = "i", leaflab = "none");
  par(mar = c(10,0.5,0.5,10));
        col = col,
        xlab = "", ylab = "", xaxt = "n", yaxt = "n");
  axis(4, 1:length(colnames(scaled.mat)), labels = sub("_seq1","",colnames(scaled.mat)), las = 2,
       line = -0.5, tick = 0, cex.axis = 0.2 + 1/log10(length(colnames(scaled.mat))));
  axis(1, 1:length(rownames(scaled.mat)), labels = rownames(scaled.mat), las = 2,
       line = -0.5, tick = 0, cex.axis = 0.2 + 1/log10(6));
I recommend top <= 1000 if you're looking at all transcripts.
gringer is offline   Reply With Quote
Old 03-03-2012, 10:39 AM   #4
Senior Res.
Location: Plovdiv, Bulgaria

Join Date: Oct 2008
Posts: 110

Thanks both of you, I will try your suggestions!
vebaev is offline   Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -8. The time now is 08:30 AM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2022, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO