[BioC] dealing with technical replication and common reference in limma package

Juan C Oliveros Collazos oliveros at cnb.uam.es
Wed Nov 14 17:38:41 CET 2007


Dear all,

I am trying to write the R code for the analysis of a microarray 
experiment involving both technical replication and common reference design.

The targets file is:
---------------------------------------------------------------------
FileName    Cy3    Cy5
Array1A.gpr    Ref1    WT1
Array1B.gpr    Ref1    WT1
Array2A.gpr    Ref2    WT2
Array2B.gpr    Ref2    WT2
Array3A.gpr    Ref3    MU1
Array3B.gpr    Ref3    MU1
Array4A.gpr    Ref4    MU2
Array4B.gpr    Ref4    MU2
---------------------------------------------------------------------

I am interested in the comparison MU vs WT.

"Ref" is a RNA universal used here as common reference.
Numbers indicate the technical groups.

I already wrote a piece of R code based on the limma users guide but I 
am not sure if I did it well (I am not an statistician)

Could you please tell me if the script below is correct? if not, how may 
I change it?

Thanks in advance,

...and thanks to Dr. Gordon Smyth and cols. for limma package!


The R code:
---------------------------------------------------------------------
library(limma);

targets<-readTargets("Targets.txt");

RG<-read.maimages(targets$FileName,columns=list(Rf="F635 Median", 
Gf="F532 Median", Rb="B635 Median", Gb="B532 
Median"),annotation=c("Block","Row","Column","ID","Name"));

RG<-backgroundCorrect(RG,method="normexp",offset=50);

MA<-normalizeWithinArrays(RG,method="loess");

MA<-normalizeBetweenArrays(MA,method="quantile");

design<-cbind(MU1vsRef3=c(0,0,0,0,1,1,0,0),MU2vsRef4=c(0,0,0,0,0,0,1,1),WT1vsRef1=c(1,1,0,0,0,0,0,0),WT2vsRef2=c(0,0,1,1,0,0,0,0));

fit <- lmFit(MA,design);

cont.matrix<-makeContrasts(MUvsWT=((MU1vsRef3+MU2vsRef4)/2-(WT1vsRef1+WT2vsRef2)/2),levels=design);

fit2<-contrasts.fit(fit,cont.matrix);
fit2<-eBayes(fit2);
topTable(fit2,adjust="BH");
---------------------------------------------------------------------

Supplementary material:

The design matrix generated:
 > design
      MU1vsRef3 MU2vsRef4 WT1vsRef1 WT2vsRef2
[1,]          0          0          1          0
[2,]          0          0          1          0
[3,]          0          0          0          1
[4,]          0          0          0          1
[5,]          1          0          0          0
[6,]          1          0          0          0
[7,]          0          1          0          0
[8,]          0          1          0          0


The contrast matrix generated:
 > cont.matrix
             Contrasts
Levels       MUvsWT
   MU1vsRef3      0.5
   MU2vsRef4      0.5
   WT1vsRef1     -0.5
   WT2vsRef2     -0.5



All the best,

Juan Carlos Oliveros
BioinfoGP, CNB-CSIC



More information about the Bioconductor mailing list