Question: How to do a heatmap (with pheatmap) when I have a multifactorial design with 3 replicates
1
gravatar for ivanasabljic
2.8 years ago by
ivanasabljic10
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

library(pheatmap)
topgenes <- head(rownames(resOrdered),100)
mat <- assay(rld)[topgenes,] 
mat <- mat - rowMeans(mat)
df <- as.data.frame(colData(dds)[,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).

Thanks!

ADD COMMENTlink modified 2.8 years ago by SES8.1k • written 2.8 years ago by ivanasabljic10
1

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

ADD REPLYlink written 2.8 years ago by Devon Ryan86k

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 2.8 years ago by ivanasabljic10
Please log in to add an answer.

Help
Access

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