DESeq2 lfcShrink and unshrunk fold changes
1
1
Entering edit mode
igor ▴ 40
@igor
Last seen 9 months ago
United States

In DESeq2, it's possible to keep the unshrunk fold changes in results() output using addMLE=TRUE, but that requires betaPrior=TRUE. This behavior seems to be based on the old workflow.

The more modern approach is to use lfcShrink(), but then the unshrunk fold changes are lost. Is there a way to run lfcShrink(), but somehow retain both types of fold changes? It's possible to take the fold change before and after lfcShrink(), but that seems not optimal.

deseq2 • 1.1k views
ADD COMMENT
3
Entering edit mode
@mikelove
Last seen 16 hours ago
United States

You could do:

res <- results(dds, ...)
res2 <- lfcShrink(dds, ...)

Then combine res and res2 as you like.

ADD COMMENT
0
Entering edit mode

That's the option I use, but then you end up with two objects. I save the results object in case I need to access it in the future, so I was hoping to avoid having to save both of them. I could modify them, but then I am concerned there would be issues with having them in a custom format. It would great if lfcShrink kept the unshrunk fold change. Maybe that could be an option or would that potentially break something downstream?

ADD REPLY
1
Entering edit mode

How about:

res <- results(dds, ...)
res$lfcMLE <- res$log2FoldChange
res$log2FoldChange <- lfcShrink(dds, ...)$log2FoldChange

Seems easy enough for the user to do this manipulation, and then it's clear what is what in the table.

ADD REPLY
0
Entering edit mode

That is easy indeed. And that shouldn't break anything downstream?

ADD REPLY
1
Entering edit mode

I can't think of anything it would break.

ADD REPLY

Login before adding your answer.

Traffic: 731 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