lfcShrink results differ for the same coefficient after relevelling
1
1
Entering edit mode
@aditya-bandla-24072
Last seen 3.9 years ago
Singapore/National University of Singap…

My design consists of one factor i.e. treatment with three levels

>dds <- phyloseq_to_deseq2(ps, ~treatment)
>levels(dds$treatment)
'Compost''Control''Forest''Groundnut'

>dds <- DESeq(dds, "LRT", reduced = ~ 1)
>resultsNames(dds)
'Intercept''treatment_Control_vs_Compost''treatment_Forest_vs_Compost''treatment_Groundnut_vs_Compost'

>lfcShrink(
  dds,
  res = results(
    dds,
    name = "treatment_Control_vs_Compost",
    test = "Wald"
  ),
  type = "apeglm",
  coef = "treatment_Control_vs_Compost"
) %>%
  data.frame() %>%
  filter(padj <= 0.05 & abs(log2FoldChange) >= 1)

I then ran lfcShrink for my co-efficient of interest i.e treatment_Control_vs_Compost and after filtering for padj <= 0.05 & abs(log2FoldChange) >= 1, I ended up with 169 features. However, when I repeated this after changing the reference level to Control, I get only 23 features for the same co-efficient

>dds$treatment <- relevel(dds$treatment, ref = "Control")
>dds <- nbinomWaldTest(dds)
>resultsNames(dds)
'Intercept''treatment_Compost_vs_Control''treatment_Forest_vs_Control''treatment_Groundnut_vs_Control'

>lfcShrink(
  dds,
  res = results(
    dds,
    name = "treatment_Compost_vs_Control",
    test = "Wald"
  ),
  type = "apeglm",
  coef = "treatment_Compost_vs_Control"
) %>%
  data.frame() %>%
  filter(padj <= 0.05 & abs(log2FoldChange) >= 1)

I expected more or less the same results, but this kind of surprised me

deseq2 • 1.3k views
ADD COMMENT
0
Entering edit mode

In your second code chunk, I think that you need to use the following:

dds <- nbinomLRT(dds)

, not:

dds <- nbinomWaldTest(dds)

?

ADD REPLY
0
Entering edit mode

Thanks, Kevin. Yes, I did try setting my initial test set to Walds and the problem with lfcShrink (specifically with apeglm) still persists. I typically do the LRT first and then do Wald's for specific co-efficients

>dds <- phyloseq_to_deseq2(ps, ~treatment) %>% DESeq(.,  "Wald", parallel = TRUE)
ADD REPLY
0
Entering edit mode

No, i was saying to use:

dds$treatment <- relevel(dds$treatment, ref = "Control")
dds <- nbinomLRT(dds)

?

ADD REPLY
0
Entering edit mode

Yes, I tried both your suggestions, but still the same results. I am wondering what leads to different results from apeglm, for the same coefficient, based on which factor level is set as the reference

ADD REPLY
0
Entering edit mode
@mikelove
Last seen 7 days ago
United States

I don’t think the apeglm results should change much (eg only due to numerical differences).

You are showing that the adjusted pvalues are different, which can occur especially when the data are not a good fit to NB. Note that you’re not looking at adjusted pvalues from apeglm because it doesn’t make pvalues, only passes them through from results. If you want to produce svalues, you can either specify svalue=TRUE or use the threshold argument.

I don’t universally recommend DESeq2 for metagenomic/microbiome data as I’m not convinced the NB GLM per gene is always appropriate here.

ADD COMMENT
0
Entering edit mode

Hi Mike, the results don't change much when I use ashr for shrinkage. When switching the reference levels, as you say, the results should not change much. I get identical results without shrinkage. With shrinkage, yes, the p-values don't change. But seems like the LFCs are shrunk very differently when the reference level is changed.

Here's the dataset https://bit.ly/2DWzkyj

ADD REPLY
0
Entering edit mode

Hmm I wouldn’t expect the shrinkage to change much but it could be because the NB is not the correct model for the data here, as some have already shown for microbiome.

ADD REPLY
0
Entering edit mode

Thanks, Mike. Yes, perhaps that might be it, I ll dig a bit deeper

ADD REPLY
0
Entering edit mode

Without yet going into the distributions, the results with shrinkage seem reasonable when minReplicatesForReplace is set to Inf

ADD REPLY

Login before adding your answer.

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