I happily use DESeq2 (DESeq2_1.10.1) in R for several years now. The log2FoldChanges (lfc) returned by the results function are estimates after estimateSizeFactors and estimateDispersions (called by DESeq function).
For cluster analysis we usually take rlog transformed data as recommended in the vignette.
We want to make boxplots of a gene of the expression values in the one and the other group that were compared with DESeq2 (e.g treated vs. untreated). Thus we could visualize the difference. The problem is, the lfc from the results function deviates from the lfc seen in the plots. I guess the reason is that no transformation provided (rlog, varianceStabilizing, counts, counts(object, normalized = T) …) resembles what happens inside DESeq.
Is there a way to extract expression values that are used inside DESeq for differential expression testing? I suppose there is not, because there are no such internal values calculated explicitly.
How would you go about the task with the boxplots?
Thanks for any help
deseqRes <- as.data.frame(results(dds)) myEnsID <- "ENSG00000271894" deseqRes[myEnsID,"log2FoldChange"] # yields 0.934 counts <- as.data.frame(assay(dds)) log2(mean(t(counts[myEnsID, group1ids]))/mean(t(counts[myEnsID, group2ids]))) # yields 1.95 countsNorm <- counts(dds,normalized=T) log2(mean(countsNorm[myEnsID, group1ids])/mean(countsNorm[myEnsID, group1ids])) # yields 1.63