Question: How to do a heatmap (with pheatmap) when I have a multifactorial design with 3 replicates
gravatar for ivanasabljic
4.7 years ago by
ivanasabljic10 wrote:

I load the table with the counts from HTSeq and then I ran de DESEq2 as follows:

condition = c("control","control","control","treated","treated","treated","control","control","control","treated","treated","treated")
genotype = c("A","A","A","A","A","A","B","B","B","B","B","B")
dds <- DESeqDataSetFromMatrix(countData = filtered, colData = colData, design = ~ genotype + condition)

design(dds) <- formula(~ genotype + condition)
dds <- DESeq(dds)

res <- results(dds)
resOrdered <- res[order(res$padj),]

rld <- rlog(dds)
sampleDists <- dist(t(assay(rld)))
vsd <- varianceStabilizingTransformation(dds)

#Finally I did a heatmap

topgenes <- head(rownames(resOrdered),100)
mat <- assay(rld)[topgenes,] 
mat <- mat - rowMeans(mat)
df <-[,c("genotype","condition")])
pheatmap(mat, annotation_col=df)

But the biological replicates appear separated. I would like to know how to do the mean just to have one column for each treatment (control-A, treated-A, control-B, treated-B).


ADD COMMENTlink modified 4.7 years ago by SES8.4k • written 4.7 years ago by ivanasabljic10

I would encourage you not to do that, it kind of defeats the purpose of a heatmap and masks the variability.

ADD REPLYlink written 4.7 years ago by Devon Ryan97k

Ok, thanks. That was a doubt I had. I haven't seen heatmaps with replicates in papers so I thought that the mean is used.

ADD REPLYlink written 4.7 years ago by ivanasabljic10
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: 1160 users visited in the last hour