Different Shrunk Log2FC according with reference
1
0
Entering edit mode
@andrebolerbarros-16788
Last seen 6 months ago
Portugal

Hello everyone,

I was exploring my dataset with a three-way interaction design (~TimePoint * Drug * Cell Line) and decided to check if, when comparing two levels of one of the variables, if the shrunken log2FC using apeglm would vary when releveled. For example, I want to check if the shrunken log2FC between TimePoint 1 and 10 would vary if we do TimePoint_10_vs_1 or TimePoint_1_vs_10. I checked and indeed are some relevant differences (I did subtraction of absolute values):

> summary(Dif)
     Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
-2.703706 -0.000064  0.000000  0.000917  0.000062  1.914137

Now, considering the complexity of my dataset, I decided to check if this would happen in a simpler dataset - so I created an example DESeq Datataset:

set.seed(123)

dds <- makeExampleDESeqDataSet(n = 10000,m=20)
dds

dds_example<-DESeq(dds)


res_BvA_shrink<-lfcShrink(dds_example,coef = "condition_B_vs_A")

dds_example$condition<-relevel(dds_example$condition,ref = "B")
dds_example<-nbinomWaldTest(dds_example)


res_AvB_shrink<-lfcShrink(dds_example,coef = "condition_A_vs_B")

Looking at the difference of absolute values between the two:

> summary(abs(res_BvA_shrink$log2FoldChange)-abs(res_AvB_shrink$log2FoldChange))
    Min.  1st Qu.   Median     Mean  3rd Qu.     Max.     NA's 
-3.20841 -0.00003  0.00000  0.00012  0.00002  3.08496        8

Is this expected? Can someone please help me to understand the logic?

Thanks in advance

DESeq2 • 442 views
ADD COMMENT
0
Entering edit mode
ATpoint ★ 4.5k
@atpoint-13662
Last seen 7 hours ago
Germany

Please see: apeglm -- influence of reference level on logFC and svalues

I asked basically the same before. In short, reference level might have an influence in some corner cases, so decide for a reference level and stick with it.

ADD COMMENT
0
Entering edit mode

Thanks ATpoint for your answer!

The issue with that is then it severely hinders the possiblity of using apeglm shrinking approach, since we cannot change the reference level.

Looking at the link you sent me (thanks once again!) and checking Michael Love answer, I just wanted to additionally say that, in my dataset (the real one, not the example one), I already filter every gene whose mean counts across the samples is below 5:

dm<-dm[rowMeans(assay(dm))>5,]

ADD REPLY
1
Entering edit mode

I took a look and the posterior width for these (fairly rare) examples overlaps zero. So the posterior when it disagrees is not narrow.

Anyway, you can also use ashr if you want releveling to not have an effect.

enter image description here

ADD REPLY

Login before adding your answer.

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