Question: What the Color is in heatmap for time series analysis
gravatar for rahel14350
2.7 years ago by
United States
rahel1435030 wrote:

Dear all,

I did DEG analysis for two condition with 5 time points using deseq2. In heatmap I have one colour for each DEG with lowest p- value which represent log2 fold change (wald test) for each deg in time 0. My question is that I have 4 sample in time point 1 vs 4 sample in time 0. But I see only one colour for all, as time0-vs-1. Is this colour from mean or median of all LFCs of 4 samples? Or there is an algorithm behind that in heatmap? Many thank in advance for your help, Cheers, Rahel

heatmap #deseq2 time series • 1.2k views
ADD COMMENTlink modified 2.7 years ago by EagleEye6.2k • written 2.7 years ago by rahel1435030

A picture is always better than a hundred words. Consider posting an example image.

ADD REPLYlink written 2.7 years ago by genomax62k

Link to Bioconductor post

ADD REPLYlink modified 2.7 years ago • written 2.7 years ago by Michael Love1.7k
gravatar for ivivek_ngs
2.7 years ago by
Seattle,WA, USA
ivivek_ngs4.6k wrote:

Can you be a bit more clear about what you want to see and show an image of your output as of now. It should be pretty straightforward to select the top 500 DEGs from your analysis and fish out the FPKM/TPM from the expression matrix for these genes across all the samples with various time points and then use pheatmap to represent these genes with annotation of the conditions and the time-series. Take a look at this link. You should be doing something similar to this. Also take a look at this blog as how to implement annotation which you should be doing for your time and conditions in order to cluster the data.

ADD COMMENTlink written 2.7 years ago by ivivek_ngs4.6k

Dear vchris,

Many thanks for your reply. I have a heatmap like the one in your link and each colour bulk represent the normalized read count of the genes with lowest p-value and colored by LFC.

enter image description here

But when I make the pheatmap with exact command from Deseq2:

opGenes <- head(order(resTC$padj),50)

mat <- betas[topGenes, -c(1,2)]

thr <- 3 

mat[mat < -thr] <- -thr

mat[mat > thr] <- thr

pheatmap(mat,breaks=seq(from=-thr, to=thr, length=101),border_color="NA",cluster_col=FALSE)

I get one color bulk for each of time point comparison to time 0.

enter image description here

My question is that how from 4 replicate per time point, I got one colour bulk per time point? I hope I made it clear. Cheers, Rahel

ADD REPLYlink modified 2.7 years ago by genomax62k • written 2.7 years ago by rahel1435030

Please change the formatting of the code so that it is intelligible. Please take a look at how to write in Biostars which should be a good start for you so that you can ask specific questions with proper clarity and we can understand your query and address it to the best of our capabilities. How to insert image in Biostars?

In any case how is the design of your experiment done in DESeq2. There are links which I am putting here for your reference which should be the way you should perform the time-series DE analysis. Take a look at here. Then if you directly want to use from DESeq2 the pheatmap function for the normalized counts here is a way it is being done. To be very precise what I would suggest is to get the DE list of genes across replicates across time points with their expression value (this expression value can be FPKM/TPM/RPKM/cpm). Create this matrix and then try to annotate the header with two vectors that symbolizes the groups for time series(0h,4h,8h,16h..) and one that shows the two different conditions. Use them to plot the heatmap for the DE genes with pheatmap, adding the annotation function, you should be able to see it. Not all times the normalized data of DESeq2 might be able to give you the perfect visualization. That is the reason we create TPM/FPKM and view the genes on these expression values. The pheatmap will compute the z-scores and do the needful for you.

ADD REPLYlink modified 2.7 years ago • written 2.7 years ago by ivivek_ngs4.6k

Dear Vchris,

Many thanks for your prompt and informative reply. I did correct the post, hope it is in the right order now. I am going through your links and comments now to reach my answer. Cheers, Rahel

ADD REPLYlink written 2.7 years ago by rahel1435030

You already have your answer in the bioconductor post where the DESeq2 author @Michael Love replied. I was unable to understand your query but the second is the plot of log2 fold change value with 4vs4 . So you see one cell representation.

ADD REPLYlink written 2.7 years ago by ivivek_ngs4.6k
gravatar for EagleEye
2.7 years ago by
EagleEye6.2k wrote:

It will be nice to use,

  1. RPKM/FPKM values or any normalized expression values

  2. Calculate z-score

  3. Use pheatmap to see clear picture of your time-series data.

ADD COMMENTlink written 2.7 years ago by EagleEye6.2k
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: 1191 users visited in the last hour