[BioC] Error in contrast.fit, LIMMA

David Martino dmartino at meddent.uwa.edu.au
Fri Feb 13 08:37:05 CET 2009


Dear list,

I get an error:

 "Error in contrasts.fit(fit,contrast.matrix): 
Number of rows of contrast matrix must match number of 
coefficients
In addition: 
Warning row names don't match col names of coefficients"

for the following Timecourse design:
3 Timepoints
Stimulated (LPS) versus Unstimulated (CON) cells
Affy Gene1.0 chips


The targets are

ChipNumber	Name	Filename	     Time	Treatment	Biolrep
1                    	LPS.0hr	0Hr_1.CEL  	0	T	          1
2	                CON.0hr	0Hr_2.CEL 	0	C	          2
3	                LPS.6hr	6HrLPS_1.CEL	6	T	          3
4	                LPS.6hr	6HrLPS_2.CEL	6	T	          3
5	                CON.6hr	6HrCon_1.CEL	6	C	          4
6	                CON.6hr	6HrCon_2.CEL	6	C	          4
7	                LPS.12hr	12HrLPS_1.CEL	12	T	          5
8	                LPS.12hr	12HrLPS_2.CEL	12	T	          5
9	                CON.12hr	12HrCon_1.CEL	12	C	          6
10	                CON.12hr	12HrCon_2.CEL	12	C	          6

The design matrix is:
Targets<-readTargets()
lev<-c("LPS.0hr","CON.0hr","LPS.6hr",
+"CON.6hr","LPS.12hr","CON.12hr")
f<-factor(Targets$Name,levels=lev)
design<-model.matrix(~0+f)
colnames(design)<-lev
biolrep<-c(1,2,3,3,4,4,5,5,6,6)
corfit<-duplicateCorrelation(x,ndups=1,block=biolrep)
fit<-lmFit(,x,block=biolrep,cor=corfit$consensus)
fit<-eBayes(fit)

To extract the contrasts of interest:
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.6h-CON.0hr),Dif12H=(LPS.12hr-LPS.6hr)-
+    (CON.12hr-CON.6hr),levels=design)
cont.matrix<-cbind(cont.con,cont.lps,cont.dif)

The code:
fit2<-contrasts.fit(fit,cont.matrix)
returns the afforementioned error message.

Any input would be greatly appreciated.

With thanks,
David

sessionInfo(): R version 2.8.0 (2008-10-20)



More information about the Bioconductor mailing list