Entering edit mode

Guido Hooiveld
★
4.0k

@guido-hooiveld-2020
Last seen 3 days ago

Wageningen University, Wageningen, the …

Hi,
Maybe a naive question, but is it possible to do a 'one sample t-test'
in limma while including a covariate in the model? If so, how?
I have an experiment in which 32 volunteers were profiled on array
after and before a (short-term) intervention (physical exercise). Some
volunteers used a supplement, others not.
I would like to identify genes responding to the intervention, while
correcting for supplement use.
I manually subtracted the 'before' from the 'after' expression data,
so I got delta values (delta.data; a matrix).
Then I checked for differential gene expression using the one sample
t-test approach to check whether differences are significant from 0
(thus without defining a design using contrast.matrix).
> fit <- lmFit(delta.data)
> fit2 <- eBayes(fit)
> topTable(fit2)
ID logFC t P.Value adj.P.Val
B
4426 xxx 0.4229133 9.496956 3.149698e-12 5.193054e-08
17.34925
14955 yyy 0.4817134 9.314950 5.598957e-12 5.193054e-08 16.82030
So far so good, but how can I include the covariate 'supplement'
[being 0 or 1 for 38ppl] in the model?
If I try to do this the usual way by defining the design using
contrast.matrix, a got an error:
> design <- model.matrix(~0+Intervention+Supplement)
Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) :
contrasts can be applied only to factors with 2 or more levels
The error is obviously correct because 'Intervention' is 1 for all
samples.
Thanks,
Guido
---------------------------------------------------------
Guido Hooiveld, PhD
Nutrition, Metabolism & Genomics Group
Division of Human Nutrition
Wageningen University
Biotechnion, Bomenweg 2
NL-6703 HD Wageningen
the Netherlands
tel: (+)31 317 485788
fax: (+)31 317 483342
email: guido.hooiveld@wur.nl
internet: http://nutrigene.4t.com
http://scholar.google.com/citations?user=qFHaMnoAAAAJ
http://www.researcherid.com/rid/F-4912-2010
[[alternative HTML version deleted]]