Understanding edgeR coefficients and design
2
0
Entering edit mode
gthm ▴ 30
@gthm-8377
Last seen 5.6 years ago
spain

Hi, I have used edgeR for single factor and two factor experiments, but I am confused with 3 factor experiments. my code looks like below:

treat=c(rep("treated",12), rep("untreated",12))
subjects=factor(c(rep(1:12), rep(1:12)))
design <- model.matrix(~subjects+treat+W_1, data=pData(set2))

design <- model.matrix(~subjects+treat+W_1, data=pData(set2))
y <- DGEList(counts=counts(set), group=treat)
y <- calcNormFactors(y, method="upperquartile")
y <- estimateGLMCommonDisp(y, design)
y <- estimateGLMTagwiseDisp(y, design)
fit <- glmFit(y, design)
lrt <- glmLRT(fit, coef=?)

I would like to look for DE genes between "treated" vs "untreated". The W_1 comes from RUVSeq. So what would be my coef here ? as I have 12 subjects, my treatment becomes coef 13 ? or I could simply make my design as  

design <- model.matrix(~subjects+W_1+treat, data=pData(set2))

so that by default, the last factor will be considered.

Thanks in advance.

edger r edger de rna-seq • 3.5k views
ADD COMMENT
3
Entering edit mode
@james-w-macdonald-5106
Last seen 15 hours ago
United States

The default for glmLRT() is to drop the last coefficient when testing significance, in which case you can simply change your design matrix to be

design <- model.matrix(~subjects+W_1+treat, data=pData(set2)) 

and then you don't have to specify which coefficient to test, since the last coefficient will represent treated - untreated.

ADD COMMENT
0
Entering edit mode

Thank you very much.

ADD REPLY
2
Entering edit mode
@gordon-smyth
Last seen 1 hour ago
WEHI, Melbourne, Australia

Or you specify the coef by name, in this case

glmLRT(fit, coef="treatuntreated")

Have a look at colnames(fit).

ADD COMMENT

Login before adding your answer.

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