Testing moderated fold changes in DESeq2 version >= 1.16.0
1
1
Entering edit mode
david.watson ▴ 30
@davidwatson-9545
Last seen 5.2 years ago
Queen Mary University of London

I'm trying to run a straightforward Wald test in DESeq2 and was a little surprised to see that fold changes and standard errors are no longer shrunken by default. I know I can still compute moderated values using the lfcShrink() function, but I see no straightforward way to:

a) calculate the corresponding test statistics and p-values; or

b) implement the gene filtering, LFC thresholding, hypothesis testing, and/or p-value adjustment options implemented in results() to these shrunken estimates.

It's especially weird that test statistics and p-values are calculated from raw rather than moderated values even when running lfcShrink(). For instance:

dds <- makeExampleDESeqDataset()
dds <- DESeq(dds)
res <- results(dds)
shrunk <- lfcShrink(dds)

# Fold changes and SEs are different
identical(res$log2FoldChange, shrunk$log2FoldChange)
# [1] FALSE
identical(res$lfcSE, shrunk$lfcSE)
# [1] FALSE
# But test statistics and p-values are the same
identical(res$stat, shrunk$stat)
# [1] TRUE
identical(res$pvalue, shrunk$pvalue)
# [1] TRUE

Of course it's fairly simple to calculate moderated z-scores (z <- shrunk$log2FoldChange / shrunk$lfcSE) and two-sided p-values (p <- 2 * (1 - pnorm(abs(z)))) from the lfcShrink() output, but it's confusing that the function doesn't do so by default or include an option to do so automatically.

Moreover, it would be nice to incorporate some of the helpful functionalities of results() into lfcShrink(). I'm thinking specifically about the ability to specify filter methods and LFC thresholds, perform one-sided tests, etc. Again, it's not impossible to do all this oneself, but I don't see why it shouldn't be part of the package anymore. Is there some simple way to recombine the two functions or at least extend the same options to both? Or are there good reasons why these options were removed that I'm just failing to appreciate?

deseq2 • 969 views
ADD COMMENT
0
Entering edit mode
@mikelove
Last seen 7 hours ago
United States

hi David,

Here's a post from a few weeks ago that maybe answers some of these questions:

DESeq2 threshold-based Wald tests, before or after lfcShrink?

There's another thread here where we discussed what vignette updates are needed for the new functions (these will go in to the April release):

A: lfcShrink and factors with multiple levels

In short though:

We purposefully want to separate shrunken LFC and the standard DESeq2 null hypothesis tests. p-values and FDR sets are calculated on the MLE LFCs. Going forward we will be adding more statistical inference for the shrunken LFC, it's just that we've been doing a lot of work and internal testing on these estimates themselves, and haven't had time to push everything out to users!

In version 1.18, released in October, we added two new shrinkage estimators (one we built ourselves called 'apeglm', the other leverages the 'ashr' package). In the latest release, you can compute s-values (aggregate false sign rate statistics) on the shrunken LFCs using these new estimation packages, ... but we haven't written it up what these mean and what they are useful for, etc. in the vignette, because we didn't have time before the Bioconductor release, and the new estimation package was only added to Bioconductor in September. So the functionality exists but we didn't advertise it widely yet. We also want to compute posterior areas for arbitrary thresholds, as in lfcThreshold, but didn't get a chance to do this either. That is just sitting as a comment in the code right now.

Did I miss anything? I appreciate the feedback. Hopefully the new vignette documentation for the next release (April) will be able to clear things up.

ADD COMMENT
0
Entering edit mode

Hi Michael,

 

Thanks so much for the prompt and informative reply. I didn't realise that setting betaPrior = TRUE ensures back compatibility when running results(), so that's especially helpful. I recently read the Stephens paper and am very interested to see how local false sign rates may improve analyses moving forward. These alternative shrinkage methods sound promising! I also totally appreciate that this is a fast evolving piece of software, and it must be a real challenge to be constantly updating code and documentation, not to mention answering questions from confused users like myself. Thanks again for all your help!

ADD REPLY
0
Entering edit mode

Thanks. Feel free to post Qs as they come up, and I'll probably post another lfcShrink() thread when we've added the new functionality, like arbitrary posterior areas. Also need to update plotMA() to know about s-values, and probably to have different coloring to indicate the difference.

My priority is to get the functions and man pages correct, and then hopefully vignette sections follow soon after, but they do take a while to write well.

ADD REPLY

Login before adding your answer.

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