Entering edit mode
8.1 years ago
ivanasabljic
▴
10
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!
I would encourage you not to do that, it kind of defeats the purpose of a heatmap and masks the variability.
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.