[BioC] Design matrix with multiple genotypes + quantified variables

Matthew Hannah Hannah at mpimp-golm.mpg.de
Thu Aug 19 14:55:31 CEST 2004


Hi,

After asking before this design and contrast matrix was suggested and it
worked well. But now it gets complicated?
2 genotypes - Con, Mut
2 treatments - A, N.
4 replicates

treatments <- factor(c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4))
design <- model.matrix(~ 0+treatments)
colnames(design) <- c("ConA","ConN","MutA","MutN")
fit <- lmFit(esetgcrma, design)

cont.matrix <- makeContrasts(ConA-MutA, ConN-MutN,
Gen=(ConN+ConA-MutN-MutA)/2, ConA-ConN, MutA-MutN,
treatment=(ConA+MutA-ConN-MutN)/2,levels=design)
con.fit <- contrasts.fit(fit, cont.matrix)

So what if I add a third genotype - Mut2? 
Is it the obvious add treatments <- .....5,5,5,5,6,6,6,6))
and then for the contrasts
treatment=(ConA+MutA+Mut2A-ConN-MutN-Mut2N)/3) 
Or am I misunderstanding how to design contrasts? Is there an easier way
of writing this when you have more genotypes?

Also logically the lm is treating all samples as independent when they
are not, does this matter? Is it possible to fit the original lm using a
design taking genotype and treatment into account? Would this be a
better approach, especially as if you have more genotypes (eg:5-10).
What would the design matrix then look like?

Finally, what if you have a quantified variable for each genotype like a
measure of growth before and after the treatment. Can you specify this
in anyway (in the design matrix?) so you take this into account during
the fit. I thought this was possible using lm or rlm, or am I confusing
something? Alternatively, does anyone have a different approach, such as
an efficient way of doing a gene-by-gene regression or correlation
analysis against the growth measure, and extracting the genes that
correlate best with the growth measure?

Perhaps there is there a good (biologist simple?) book that would cover
design and contrast of lms, anyone know of one?

Thanks again,
Matt



More information about the Bioconductor mailing list