[BioC] automating makeContrasts call in limm

Francois Pepin fpepin at cs.mcgill.ca
Tue Mar 14 17:36:53 CET 2006


Hi eveyrone,

Thanks to Carolyn Fitzsimmons for pointing out that there was indeed a
bug in that code. The behavior on R 2.2 is indeed the same as with R
2.1.

Sorry about that.

Francois

On Mon, 2006-03-13 at 11:53 -0500, Francois Pepin wrote:
> Hi Gordon,
> 
> I should mention that the behavior is different with R 2.2, but it still
> doesn't work.
> 
> >  myContrasts<-c("t1-t2","t1-3","t2-t3")
> > contrast.matrix<-makeContrasts(myContrasts,levels=design)
> Error in eval(expr, envir, enclos) : object "myContrasts" not found
> > traceback()
> 3: eval(expr, envir, enclos)
> 2: eval(ej, envir = levelsenv)
> 1: makeContrasts(myContrasts, levels = design)
> 
> > sessionInfo()
> R version 2.2.0, 2005-10-06, x86_64-redhat-linux-gnu
> 
> attached base packages:
> [1] "methods"   "stats"     "graphics"  "grDevices" "utils"
> "datasets"
> [7] "base"
> 
> other attached packages:
>   limma
> "2.3.7"
> 
> I don't have any machine with R 2.3, but I could install it.
> 
> Francois
> 
> On Mon, 2006-03-13 at 11:31 -0500, Francois Pepin wrote:
> > > > Ideally, I would want to have a way to do:
> > > >
> > > > myContrasts<-c("t1-t2","t1-3","t2-t3")
> > > > contrast.matrix<-makeContrasts(myContrasts,levels=design)
> > > 
> > > Your question isn't clear, at least not to me.  What is wrong with the code you've just given?
> > 
> > Sorry, I thought this was a well-known "feature" of the makeContrasts
> > function, so I didn't go into the details.
> > 
> > So to complete the toy example with 3 treatments and dye swaps of each:
> > 
> > > design
> >      t1 t2 t3
> > [1,] -1  0  0
> > [2,]  1  0  0
> > [3,]  0 -1  0
> > [4,]  0  1  0
> > [5,]  0  0 -1
> > [6,]  0  0  1
> > 
> > > myContrasts
> > [1] "t1-t2" "t1-3"  "t2-t3"
> > 
> > > contrast.matrix<-makeContrasts(myContrasts,levels=design)
> > > contrast.matrix
> >    myContrasts
> > t1 "t1-t2"
> > t2 "t1-3"
> > t3 "t2-t3"
> > 
> > Which doesn't make for a usable design matrix. The expected behavior is:
> > 
> > > contrast.matrix<-makeContrasts("t1-t2","t1-t3","t2-t3",levels=design)
> > > contrast.matrix
> >    t1-t2 t1-t3 t2-t3
> > t1     1     1     0
> > t2    -1     0     1
> > t3     0    -1    -1
> > 
> > > sessionInfo()
> > R version 2.1.0, 2005-04-18, x86_64-unknown-linux-gnu
> > 
> > attached base packages:
> > [1] "methods"   "stats"     "graphics"  "grDevices" "utils"
> > "datasets"
> > [7] "base"
> > 
> > other attached packages:
> >   limma
> > "1.9.6"
> > 
> > 
> > 
> > > Is your question that you'd like to compute all pairwise comparisons between hundreds of different
> > > treatments or patients?
> > 
> > No. I have tumors and normal samples for each patient. One of the things
> > I'd like to do is tumor vs normal for all each of the patients. Another
> > would be to automate the comparisons between clinical variables. It's
> > just cumbersome (and error-prone) to do by hand when there are over 50
> > patients.
> > 
> > Francois
> > 
> > _______________________________________________
> > Bioconductor mailing list
> > Bioconductor at stat.math.ethz.ch
> > https://stat.ethz.ch/mailman/listinfo/bioconductor
> >



More information about the Bioconductor mailing list