[BioC] Do I now understand Limma contrast matrices??

Matthew Hannah Hannah at mpimp-golm.mpg.de
Tue Sep 7 16:54:02 CEST 2004


Hi,

Now I've finally had some time to look practically at contrast matrices
I've made some progress but still have a couple of questions.

I was initially wary of the contrast fit as I thought there was some
special type of notation, but it seems it's basic arithmetic, is this
right, or are there any exceptions.

This is what I've done
#3 genotypes(Con, Mut, Mut2), 2 treatments(A, N), 4 reps

treatments <- factor(c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,6))
design <- model.matrix(~ 0+treatments)
colnames(design) <- c("ConA","ConN","MutA","MutN","Mut2A","Mut2N")
fit <- lmFit(esetgcrma, design)
cont.matrix <- makeContrasts(
treatment.1=(ConA+MutA+Mut2A-ConN-MutN-Mut2N)/3, 
treatment.2=((ConA+MutA+Mut2A)-(ConN+MutN+Mut2N))/3,
treatment.3=((ConA-ConN)+(MutA-MutN)+(Mut2A-Mut2N))/3,
,levels=design)
con.fit <- contrasts.fit(fit, cont.matrix)

I thought treatment.1 and 2 would NOT take the genotype into effect,
whilst 3 would. But all 3 produce exactly the same results, coefs, sd,
df, p.values....etc. This may seem obvious to some but I was wondering
if the contrasts could be written in different ways to take the genotype
effect into account when looking at treatment effects, but
initially/simply it seems not, is this right?

I've compared the results to unpaired t-test (limma increases t-value
changes), and to paired t (more similar, distributed around slope of 1).
>From these I guess the genotype effect is taken into account, but I
cannot be sure.

Basically what I'm asking is would the above fit find the following
consistent treatment effect, despite the genotype effect (that would
mask it in a simple unpaired t)?
             Con  /  Mut  /  Mut2
Untreated - 1,2,3 / 4,4,6 / 1,1,2
Treated   - 3,4,4 / 5,6,7 / 2,3,3

Finally it has been mentioned there are lots of ways of producing the
design and contrast matrices. In the above situation is there an
alternative matrix that I should be comparing?

Thanks,
Matt



More information about the Bioconductor mailing list