Question: DeSeq2 extract internal expression values
0
10 weeks ago by

Hello,

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.

Thanks for any help

example code:

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

deseq2 • 83 views
modified 10 weeks ago by Michael Love21k • written 10 weeks ago by konradgru0
Answer: DeSeq2 extract internal expression values
0
10 weeks ago by
Michael Love21k
United States
Michael Love21k 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

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.