[BioC] Limma contrasts with model.matrix

Daniel Brewer daniel.brewer at icr.ac.uk
Mon Feb 9 15:24:03 CET 2009


Hi,

I have the results of a number of Affymetrix microarray experiments
performed on samples that can be divided into two or four groups.  I
also need to adjust for variation caused by centre that the sample was
taken and amplification plate.  I would like to know for each group
which genes are significantly different to all the other groups i.e.
what genes "define" that group

For the case when there are two groups I can do this
design2 <- model.matrix(x~Plate+Centre+group2)
TwoFit <- lmFit(nodups,design=design2)
TwoFit2 <- eBayes(TwoFit)
topTable(FourFit2,coef=4)

this has a design matrix like so:

          (Intercept)   Plate2   CentreRMH    group2
Cb016_001           1   0            0         0
Cb016_002           1   0            1         1
Cb016_003           1   0            1         1
Cb016_004           1   0            1         0
Cb016_005           1   0            1         0
Cb016_006           1   0            1         0
..

When there are four groups I believe I need to set up contrasts, but I
am not sure the right way to do it.  Something like this:

design4 <- model.matrix(x~Plate+Centre+group4)
FourFit <- lmFit(nodups,design=design4)
contrast.matrix <- makeContrasts(
	group1vsrest=-(group2+group3+group4)/3
	group2vsrest=3*group2-(group3+group4)
	group3vsrest=3*group3-(group2+group4)
	group4vsrest=3*group4-(group3+group2)
)
FourFit2 <- contrasts.fit(FourFit,contrasts=contrast.matrix)
FourFit3 <- eBayes(FourFit)

Is the contrast.matrix correct?  My thinking above is based on group1
being the reference group.

Many thanks

Dan
-- 
**************************************************************
Daniel Brewer, Ph.D.

Institute of Cancer Research
Molecular Carcinogenesis
Email: daniel.brewer at icr.ac.uk
**************************************************************

The Institute of Cancer Research: Royal Cancer Hospital, a charitable Company Limited by Guarantee, Registered in England under Company No. 534147 with its Registered Office at 123 Old Brompton Road, London SW7 3RP.

This e-mail message is confidential and for use by the a...{{dropped:2}}



More information about the Bioconductor mailing list