Question: DeSeq2 extract internal expression values
gravatar for konradgru
8 months 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




deseq2 • 137 views
ADD COMMENTlink modified 8 months ago by Michael Love24k • written 8 months ago by konradgru0
Answer: DeSeq2 extract internal expression values
gravatar for Michael Love
8 months ago by
Michael Love24k
United States
Michael Love24k 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 8 months ago by Michael Love24k

Thanks Michael. Time to update my DESeq2 package;-)

I actually want to accomplish the opposite. From what I understand the shrinked LFC is more accurate as it e.g. reduces inflation by random noise. So I would rather extract the expression values that fit to that shrinked LFC, than get the unshrunken LFC that fit to the used expression values.

ADD REPLYlink written 7 months ago by konradgru0

There aren’t expression values that correspond to our shrinkage estimators produced by the functions in DESeq2.

ADD REPLYlink written 7 months ago by Michael Love24k
Please log in to add an answer.


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