SEQanswers log fold change from glm/poisson
 User Name Remember Me? Password
 Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 Similar Threads Thread Thread Starter Forum Replies Last Post ppm Bioinformatics 4 05-06-2014 07:49 AM Erwan Bioinformatics 3 03-25-2014 05:05 AM dbaud Introductions 5 01-27-2014 10:47 AM Alex234 RNA Sequencing 11 08-22-2013 03:36 AM madsaan Bioinformatics 4 02-10-2011 06:51 AM

 12-14-2014, 06:27 PM #1 fpbarthel Junior Member   Location: Houston Join Date: Dec 2014 Posts: 5 log fold change from glm/poisson Hi, I'm wondering how to derive the log fold change from the output of R's glm using poisson family (for RNA-seq data). From R's lm function for linear models (for log2 microarray data) the log fold looks like it is the coefficient (beta), but it looks like the glm output needs some transformation to obtain log fold change. Anyone can walk me through the commands to do this? Thanks!
12-14-2014, 11:35 PM   #2
dariober
Senior Member

Location: Cambridge, UK

Join Date: May 2010
Posts: 311

Quote:
 Originally Posted by fpbarthel Hi, I'm wondering how to derive the log fold change from the output of R's glm using poisson family (for RNA-seq data).
Hi- The coefficients from glm with Poisson family distribution by R default are presented as natural log since the link function is log. so you have to anti-log the coefficient by exponentiation to get fold change. E.g.:

Quote:
 y<- rep(c(10, 40), each= 5) x<- rep(c('A', 'B'), each= 5) (fit<- glm(y ~ x, family= poisson())) Call: glm(formula = y ~ x, family = poisson()) Coefficients: (Intercept) xB 2.303 1.386 Degrees of Freedom: 9 Total (i.e. Null); 8 Residual Null Deviance: 96.37 Residual Deviance: -3.997e-14 AIC: 52.44 fc<- exp(fit\$coefficients[2]) ## Antilog coef #2 log2(fc) ## Convert to more familiar log2 fold change: 2