[BioC] two color arrays normalization

Jenny Drnevich drnevich at illinois.edu
Wed Feb 18 17:51:17 CET 2009


Hi Giusy,

It shouldn't matter if you put the minus signs in the design matrix 
or the contrast matrix, they will do the same thing. Actually, the 
contrast matrix is completely unnecessary, the columns of the design 
matrix already specify the differences between the ref and your two 
other groups. Now, are you having trouble getting the results 
switched, or is it just that the results for a few genes are the 
opposite of what you expect to happen? Let me walk you through a way 
to check that the directions of the M values are being reversed. Your 
design matrix is:

 >Filename        Cy3     Cy5
 >Control_1b.txt  ctrl    ref
 >Control_2b.txt  ctrl    ref
 >Control_3b.txt  ctrl    ref
 >dexa_dbz_lt_1.txt       treat   ref
 >dexa_dbz_lt_2.txt       treat   ref
 >dexa_dbz_lt_3.txt       treat   ref

Therefore, the M values in your MA object are log2(Cy5/Cy3), which is 
either log2(ref/ctrl) or log2(ref/treat). A positive M value means up 
in ref compared to the ctrl (or treat), but you really want the 
opposite, that positive values mean up in ctrl (or treat) as compared 
to the ref. Your design matrix as created by modelMatrix is:

     ctrl treat
[1,]    1     0
[2,]    1     0
[3,]    1     0
[4,]    0     1
[5,]    0     1
[6,]    0     1

Even though the column names say "ctrl" and "treat", they actually 
mean "ref-ctrl" and "ref-treat"; this is because the first column 
indicates the M values from the first three arrays in the original 
orientation, which is log2(Cy5/Cy3), or log2(ref) - log2(ctrl). If 
you use lmFit with this design matrix:

fit<-lmFit(MA,design)

The fit$coef values will be positive or negative, "up" or "down" in 
the ref as compared to the ctrl (or treat). There are many different 
ways to flip these, your contrast matrix with -1s is one way, but a 
quicker way is to just multiply the original design matrix by -1:

fit2 <- lmFit(MA, design*-1)

Now, compare the direction of change between the two fit objects:

fit$coef[1:5,]
fit2$coef[1:5,]

The magnitude of the values shouldn't change, but the direction 
should be switched. If you are absolutely sure that the ref was in 
Cy5 on your arrays, then the fit2 object should contain the correct 
orientation of "up" or "down" in the ctrl as compared to the ref. 
However, if the positive controls are going in the opposite direction 
of the way you expect them to be, it's not because you are setting up 
the contrasts incorrectly. Either you have somehow switched the 
samples on the arrays, or the probes for the positive control are 
measuring a different part of the transcript that give a different 
result than you expect.

HTH,
Jenny


At 09:13 AM 2/18/2009, Giusy Della Gatta wrote:
>Hi Naomi,
>I don't know if I understood correct. I switched the signs of the 
>design  and the
>contrast matrices, but I still have the same results: controls going 
>at the opposite way.
>
> > library(limma)
> > # Read in data files
> > targets=readTargets("target_frame_ltbarc_pgedit.giusy")
> > RG<-read.maimages(targets$FileName, source="agilent", ext="txt")
>Read Control _1b.txt
>Re
>Read Control_3b.txt
>Read dexa_dbz_lt_1.txt
>Read dexa_dbz_lt_2.txt
>Read dexa_dbz_lt_3.txt
> > # create MA list
> > MA<-MA.RG(RG, bc.method="none")
> > # perform background correction
> > RG<-backgroundCorrect (RG,method="none")
> > # perform within array normalization
> > MA<-normalizeWithinArrays(RG, method="loess")
> > # Create design matrix
> > design <- modelMatrix(targets, ref="ref")
>Found unique target names:
>  ctrl ref treat
> > design<- cbind(ctrl= c(1,1,1,0,0,0), treat= c(0,0,0,1,1,1))
> > design
>      ctrl treat
>[1,]    1     0
>[2,]    1     0
>[3,]    1     0
>[4,]    0     1
>[5,]    0     1
>[6,]    0     1
> > fit<-lmFit(MA,design)
> > cont.matrix<-cbind("ctrl-ref"=c(-1,0), "treat-ref"=c(0,-1))
> > cont.matrix
>      ctrl-ref treat-ref
>[1,]       -1         0
>[2,]        0        -1
> > fit2<-contrasts.fit(fit, cont.matrix)
> > d1 <- ebayes(fit2)
>
>
>
>
>Thank you
>Giusy
>
>
>-----Original Message-----
>From: Naomi Altman [mailto:naomi at stat.psu.edu]
>Sent: Tue 2/17/2009 7:50 PM
>To: Giusy Della Gatta; Naomi Altman; bioconductor at stat.math.ethz.ch
>Subject: RE: [BioC] two color arrays normalization
>
>Hi Giusy,
>Move the minus signs from the first design matrix to the 2nd and I
>think it will work fine.
>
>--Naomi
>
>At 06:07 PM 2/17/2009, Giusy Della Gatta wrote:
> >Hi Naomi,
> >
> >I performed the analysis of my micorarrays,but still I don't manage
> >to revert the channels!
> >My experiment consisted into infect cells with an adenovirus: an emty one
> >and an adenovirus expressing for a specific protein.  Then I
> >treated the same cells with a specific drug or simply with the 
> vehicle (DMSO).
> >I have 6 microarrays: 3 controls DMSO0-treated and 3 samples drug-treated.
> >In each microarray the green channel is expressing the levels of
> >infected and treated
> >cells while the red channel are not infected cells. For all the experiments
> >I have the same RED CHANNEL reference.
> >I composed the target file as follows:
> >
> >Filename        Cy3     Cy5
> >Control_1b.txt  ctrl    ref
> >Control_2b.txt  ctrl    ref
> >Control_3b.txt  ctrl    ref
> >dexa_dbz_lt_1.txt       treat   ref
> >dexa_dbz_lt_2.txt       treat   ref
> >dexa_dbz_lt_3.txt       treat   ref
> >
> >and the I used the following script:
> >
> > >targets=readTargets("target_frame_ltbarc_pgedit.giusy")
> > >RG<-read.maimages(targets$FileName, source="agilent", ext="txt")
> > >MA<-MA.RG(RG, bc.method="normexp")
> > >MA<-normalizeWithinArrays(RG, method="loess")
> > >design <- modelMatrix(targets, ref="ref")
> > > design
> >  ctrl treat
> >[1,]   -1     0
> >[2,]   -1     0
> >[3,]   -1     0
> >[4,]    0    -1
> >[5,]    0    -1
> >[6,]    0    -1
> > >fit<-lmFit(MA,design)
> > >cont.matrix<-cbind("ctrl-ref"=c(1,0), "treat-ref"=c(0,1))
> > >cont.matrix
> >      ctrl-ref treat-ref
> >[1,]        1         0
> >[2,]        0         1
> >
> > >fit2<-contrasts.fit(fit, cont.matrix)
> > >d1 <- ebayes(fit2)
> > >toptable(fit2,adjust="fdr")
> >
> >I don't know if I am still omitting
> >something, because I have the positive
> >controls of this experiment  that
> >are going exactly in the opposite way!!
> >
> >May you can help me?
> >
> >Thank you in advance!
> >Giusy
> >
> >
> >-----Original Message-----
> >From: Naomi Altman [mailto:naomi at stat.psu.edu]
> >Sent: Mon 2/9/2009 9:56 PM
> >To: Giusy Della Gatta; bioconductor at stat.math.ethz.ch
> >Subject: Re: [BioC] two color arrays normalization
> >
> >If there is no dye-swap, then what do you mean by "swapping of the colors"?
> >
> >--Naomi
> >
> >At 07:56 PM 2/9/2009, Giusy Della Gatta wrote:
> >
> > >Hi everybody,
> > >
> > >I am analyzing two color Agilent microarrays
> > >by using LIMMA package.
> > >In my specific case the red channel is representing
> > >"the reference" while the green channel is "the treatment".
> > >Is it enough to use the Target File composition to specify the name
> > >of  the samples
> > >and their corrispondet channels?  Or I have to use other specific commands
> > >to specify the "swapping" of the colors?
> > >
> > >Thank you in advance!
> > >Regards
> > >Giusy
> > >
> > >_______________________________________________
> > >Bioconductor mailing list
> > >Bioconductor at stat.math.ethz.ch
> > >https://stat.ethz.ch/mailman/listinfo/bioconductor
> > >Search the archives:
> > >http://news.gmane.org/gmane.science.biology.informatics.conductor
> >
> >Naomi S. Altman                                814-865-3791 (voice)
> >Associate Professor
> >Dept. of Statistics                              814-863-7114 (fax)
> >Penn State University                         814-865-1348 (Statistics)
> >University Park, PA 16802-2111
>
>Naomi S. Altman                                814-865-3791 (voice)
>Associate Professor
>Dept. of Statistics                              814-863-7114 (fax)
>Penn State University                         814-865-1348 (Statistics)
>University Park, PA 16802-2111
>
>_______________________________________________
>Bioconductor mailing list
>Bioconductor at stat.math.ethz.ch
>https://stat.ethz.ch/mailman/listinfo/bioconductor
>Search the archives: 
>http://news.gmane.org/gmane.science.biology.informatics.conductor

Jenny Drnevich, Ph.D.

Functional Genomics Bioinformatics Specialist
W.M. Keck Center for Comparative and Functional Genomics
Roy J. Carver Biotechnology Center
University of Illinois, Urbana-Champaign

330 ERML
1201 W. Gregory Dr.
Urbana, IL 61801
USA

ph: 217-244-7355
fax: 217-265-5066
e-mail: drnevich at illinois.edu



More information about the Bioconductor mailing list