DeSeq2 extract internal expression values
1
0
Entering edit mode
konradgru • 0
@konradgru-18231
Last seen 5.4 years ago

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.

How would you go about the task with the boxplots?

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 • 738 views
ADD COMMENT
0
Entering edit mode
@mikelove
Last seen 8 hours ago
United States

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 COMMENT
0
Entering edit mode

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 REPLY
0
Entering edit mode

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

ADD REPLY

Login before adding your answer.

Traffic: 655 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6