Question: DESeq2 lfcShrink and unshrunk fold changes
1
gravatar for igor
5 weeks ago by
igor30
United States
igor30 wrote:

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 • 96 views
ADD COMMENTlink modified 4 weeks ago by Michael Love25k • written 5 weeks ago by igor30
Answer: DESeq2 lfcShrink and unshrunk fold changes
1
gravatar for Michael Love
4 weeks ago by
Michael Love25k
United States
Michael Love25k wrote:

You could do:

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

Then combine res and res2 as you like.

ADD COMMENTlink written 4 weeks ago by Michael Love25k

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 REPLYlink modified 4 weeks ago • written 4 weeks ago by igor30
1

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 REPLYlink written 4 weeks ago by Michael Love25k

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

ADD REPLYlink modified 4 weeks ago • written 4 weeks ago by igor30
1

I can't think of anything it would break.

ADD REPLYlink written 4 weeks ago by Michael Love25k
Please log in to add an answer.

Help
Access

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