Question: DeSeq2 extract internal expression values
gravatar for konradgru
13 days ago by
konradgru0 wrote:


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


example code:

deseqRes <-
myEnsID <- "ENSG00000271894"
deseqRes[myEnsID,"log2FoldChange"] # yields 0.934
counts <-
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




ADD COMMENTlink modified 12 days ago by Michael Love20k • written 13 days ago by konradgru0
gravatar for Michael Love
12 days ago by
Michael Love20k
United States
Michael Love20k wrote:

This is answered by reading the vignette or DESeq2 paper. The version you are using (which is 12 releases ago) automatically shrinks the LFC in the table provided by results(). Since v1.16, results() does not shrink but instead lfcShrink() is used to shrink the LFC

ADD COMMENTlink written 12 days ago by Michael Love20k
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.2.0
Traffic: 459 users visited in the last hour