logFC in GLM of egdeR
1
0
Entering edit mode
Xinwei Han ▴ 30
@xinwei-han-5868
Last seen 9.6 years ago
Hi, I fit a GLM with edgeR like this: >colnames(fit) A B C D For contrast = c(-1,0,1,0), I guess logFC = log2 (average CPM in C/ average CPM in A). But for contrast = c(1,-1,-1,1), how is logFC calculated? Thanks, Xinwei [[alternative HTML version deleted]]
edgeR edgeR • 1.3k views
ADD COMMENT
0
Entering edit mode
@gordon-smyth
Last seen 13 minutes ago
WEHI, Melbourne, Australia
Dear Xinwei, Well, in the first case you get C-A (C minus A). In the second case you get A-B-C+D. Best wishes Gordon > Date: Mon, 1 Apr 2013 23:10:42 -0400 > From: Xinwei Han <xinwei.han at="" duke.edu=""> > To: <bioconductor at="" stat.math.ethz.ch=""> > Subject: [BioC] logFC in GLM of egdeR > > Hi, > > I fit a GLM with edgeR like this: > >> colnames(fit) > A B C D > > For contrast = c(-1,0,1,0), I guess logFC = log2 (average CPM in C/ average > CPM in A). > > But for contrast = c(1,-1,-1,1), how is logFC calculated? > > Thanks, > Xinwei > ______________________________________________________________________ The information in this email is confidential and intend...{{dropped:4}}
ADD COMMENT
0
Entering edit mode
HI Gordon, Thanks. Does that mean in the second case, basically logFC = log2 ( (average CPM in D+ average CPM in A) / (average CPM in B +average CPM in C) ), except for other adjustments from negative binomial? Thanks, Xinwei On Tue, Apr 2, 2013 at 7:03 PM, Gordon K Smyth <smyth@wehi.edu.au> wrote: > Dear Xinwei, > > Well, in the first case you get C-A (C minus A). In the second case you > get A-B-C+D. > > Best wishes > Gordon > > Date: Mon, 1 Apr 2013 23:10:42 -0400 >> From: Xinwei Han <xinwei.han@duke.edu> >> To: <bioconductor@stat.math.ethz.**ch <bioconductor@stat.math.ethz.ch="">> >> Subject: [BioC] logFC in GLM of egdeR >> >> Hi, >> >> I fit a GLM with edgeR like this: >> >> colnames(fit) >>> >> A B C D >> >> For contrast = c(-1,0,1,0), I guess logFC = log2 (average CPM in C/ >> average >> CPM in A). >> >> But for contrast = c(1,-1,-1,1), how is logFC calculated? >> >> Thanks, >> Xinwei >> >> > ______________________________**______________________________**____ ______ > The information in this email is confidential and inte...{{dropped:10}}
ADD REPLY
0
Entering edit mode
Dear Xinwei, No, not quite. It would be best to try to think in terms of linear comparisons on the log-scale, because that is how glms works. A-B-C+D means (average log CPM in A) minus (average log CPM in B) minus (average log CPM in C) add (average log CPM in D) You can think of it as twice (average log CPM in A and D) minus (average log CPM in B and C). or you could think of it as (log fold change from A to B) plus (log fold change from D to C) but none of these are quite the same as what you wrote. Your expression interchanges averages and logs in a way that is not correct. Note that the logFC you get from the contrast c(1,-1,-1,1) is exactly equal to the logFC you get from c(1,-1,0,0) plus what you get from (0,0,-1,1). It just adds up in the natural way. Best wishes Gordon On Tue, 2 Apr 2013, Xinwei Han wrote: > HI Gordon, > > Thanks. Does that mean in the second case, basically logFC = log2 ( > (average CPM in D+ average CPM in A) / (average CPM in B +average CPM in > C) ), except for other adjustments from negative binomial? > > Thanks, > Xinwei > > > On Tue, Apr 2, 2013 at 7:03 PM, Gordon K Smyth <smyth at="" wehi.edu.au=""> wrote: > >> Dear Xinwei, >> >> Well, in the first case you get C-A (C minus A). In the second case you >> get A-B-C+D. >> >> Best wishes >> Gordon >> >> Date: Mon, 1 Apr 2013 23:10:42 -0400 >>> From: Xinwei Han <xinwei.han at="" duke.edu=""> >>> To: <bioconductor at="" stat.math.ethz.**ch="" <bioconductor="" at="" stat.math.ethz.ch="">> >>> Subject: [BioC] logFC in GLM of egdeR >>> >>> Hi, >>> >>> I fit a GLM with edgeR like this: >>> >>> colnames(fit) >>>> >>> A B C D >>> >>> For contrast = c(-1,0,1,0), I guess logFC = log2 (average CPM in C/ >>> average >>> CPM in A). >>> >>> But for contrast = c(1,-1,-1,1), how is logFC calculated? >>> >>> Thanks, >>> Xinwei >>> >>> >> ______________________________**______________________________**___ _______ >> The information in this email is confidential and intended solely for the >> addressee. >> You must not disclose, forward, print or use it without the permission of >> the sender. >> ______________________________**______________________________**___ _______ >> > ______________________________________________________________________ The information in this email is confidential and intend...{{dropped:4}}
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