[BioC] Error in contrast.fit, LIMMA
Mark Robinson
mrobinson at wehi.EDU.AU
Fri Feb 13 10:13:07 CET 2009
David,
Is this just a typo?
The following commands (changed minorly) work for me in a fresh R session:
-------
library(limma)
lev<-c("LPS.0hr","CON.0hr","LPS.6hr","CON.6hr","LPS.12hr","CON.12hr")
f<-factor(rep(lev,each=2)[-c(1,3)],levels=lev) # same as yours
design<-model.matrix(~0+f)
colnames(design)<-lev
cont.con<-makeContrasts("CON.6hr-CON.0hr","CON.12hr-CON.6hr",levels=design)
cont.lps<-makeContrasts("LPS.6hr-LPS.0hr","LPS.12hr-LPS.6hr",levels=design)
cont.dif<-makeContrasts(Dif6H=(LPS.6hr-LPS.0hr)-
(CON.6hr-CON.0hr),Dif12H=(LPS.12hr-LPS.6hr)- # fixed typo
(CON.12hr-CON.6hr),levels=design)
cont.matrix<-cbind(cont.con,cont.lps,cont.dif)
xx <- matrix( rnorm(100), nc=10) # made this up
biolrep<-c(1,2,3,3,4,4,5,5,6,6)
corfit<-duplicateCorrelation(xx,ndups=1,block=biolrep)
fit<-lmFit(xx,design,block=biolrep,cor=corfit$consensus) # changed this
fit <- eBayes(fit)
fit2<-contrasts.fit(fit,cont.matrix)
-------
> fit<-lmFit(,x,block=biolrep,cor=corfit$consensus)
Perhaps this should be:
fit <- lmFit(x,design,block=biolrep,cor=corfit$consensus)
> + (CON.6h-CON.0hr),Dif12H=(LPS.12hr-LPS.6hr)-
Should 'CON.6h' be 'CON.6hr'?
HTH,
Mark
> sessionInfo()
R version 2.8.1 (2008-12-22)
i386-apple-darwin8.11.1
locale:
en_AU.UTF-8/en_AU.UTF-8/C/C/en_AU.UTF-8/en_AU.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] statmod_1.3.6 limma_2.16.2
More information about the Bioconductor
mailing list