This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Help me with Heatmap

Hi everyone, I'm a beginner student who is approaching bioinformatics for the first time and I have some difficulties with DESeq 2.

I need to create a heatmap with the top 36 genes, these are the instructions I was given but I couldn't understand:

  • For the heatmap you need to transform the output of the DESeq() function;
  • I only display the top 36 genes, otherwise the heatmap is unreadable;

I should use this formula but I don't understand how to display top genes in the heatmap:

mat <- counts("#OUTPUT OF DESeq()", normalized = T)[rownames(top_36),]
mat.z <- t(apply(mat, 1, scale))
colnames(mat.z) <- coldata$sample
df <- as.data.frame(colData("#OUTPUT OF DESeq()")[,c("hour","strain")])
  • Heatmap with pheatmap()

I would be very grateful if anyone could help me, thanks in advance.

rna-seq r deseq2

2 answers

  1. you have to say what question you are actually asking. There are few different designs that would address different questions.
  2. work through the vignette. Then find another tutorial, and work through that before trying with your own data.

Hello!

So, what is the correct design ?

You will have to ask yourself, what do you want to compare? WT vs mut? If so it will be strain. 20 vs 25? It will be hour. WT at 20 vs mut at 20? It will be strain + hour.

Then:

dds <- DESeq(ddsTxi)

# Then check the contrast option from results about the design of your preference. For example if you want WT vs mut. 
res <- results(dds, contrast=c("strain","mut","WT"))

After the results, you can select the top15 upregulated genes and 15 downregulated genes based on the log2foldchange column and try to make the heatmap.

A comment to add. Do not erase or change the question, just add a comment! There exist people who might have the same question as you and as such those questions are beneficial!

Log in to answer this question.