# [BioC] Affymetrix Limma design/contrast matrix

Matthew Hannah Hannah at mpimp-golm.mpg.de
Tue Jun 22 20:53:09 CEST 2004

```I know this has been asked several times for various designs, and I
have searched and read the user guide but I'm getting nowhere fast.
I would be very grateful if someone could help me out with what is
probably a simple request to someone familar with lm and Limma.

I was following
8.4 Estrogen Data: A 2x2 Factorial Experiment with Affymetrix Arrays
but have got a bit confused - especially if
> cont.matrix <- cbind(E10=c(0,0,1,0),E48=c(0,0,0,1))
is not a typo and should read
> cont.matrix <- cbind(E10=c(0,1,0,0),E48=c(0,0,0,1))

Anyway rather than say more than I'm statistically inept, I would
appreciate some help on an appropriate design and contrast matrix
for the list below.

Exp Genotype Treatment
MUTA.1   1      MUT         A
MUTA.2   2      MUT         A
MUTA.3   3      MUT         A
MUTA.4   4      MUT         A
MUTN.1   1      MUT         N
MUTN.2   2      MUT         N
MUTN.3   3      MUT         N
MUTN.4   4      MUT         N
ConA.1   1      Con         A
ConA.2   2      Con         A
ConA.3   3      Con         A
ConA.4   4      Con         A
ConN.1   1      Con         N
ConN.2   2      Con         N
ConN.3   3      Con         N
ConN.4   4      Con         N

I already have it as pData (is there an easy way
to adapt this?). I tried this design (is it correct?) but also want
it with the experiment included.

>treatments <- factor(c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4),
labels=c("MUTA","MUTN","ConA","ConN"))
> contrasts(treatments) <- cbind(Treat=c(1,0,1,0),MUT=c(1,1,0,0),
Con=c(0,0,1,1))
>design <- model.matrix(~treatments)

Then I got very confused with the contrasts - in the example they only
look at the estrogen effect, what if you want to make the same contrasts
as in the design (eg: also include time in the estrogen example) do you
need another fit or do you just use the first one?

Basically I want to compare MUTA vs ConA, MUTN vs ConN, A vs N.

Getting slightly more complicated the data is paired (eg: MUTA.1 with
MUTN.1) and was wondering if this pairwise nature could be taken into
account and compare the MUTA-MUTN changes vs ConA-ConN changes? I ask
this as I've found that the changes may be more reproducible than the
absolute values.