[BioC] How to create a design matrix for a three-way design?

January Weiner january.weiner at mpiib-berlin.mpg.de
Fri Mar 26 09:03:11 CET 2010


Hello,

I would be grateful for any kind of hint -- redirection to other
posts, documents, examples etc. I have trouble getting a clear picture
how I should create the design matrix and extract the contrasts.

I have the following situation: I am comparing two strains of cells,
wild type and mutant. The cells are subjected to treatment (T) or kept
as control (C), and RNA is collected at two different times after
experiment setup (t1, t2). What I would like to know is whether the
response to treatment is different in the wild type and the mutant at
any point in time. Two-color arrays are used with dye-swaps, and in
each the treatment is compared to the appropriate control.

My targets look like this:

Cy3       Cy5
wt_t1_T  wt_t1_C
wt_t1_C  wt_t1_T
wt_t2_T  wt_t2_C
wt_t2_C  wt_t2_T
mu_t1_T mu_t1_C
mu_t1_C mu_t1_T
mu_t2_T mu_t2_C
mu_t2_C mu_t2_T

What I did (and what was surely not correct) was to call any "C" as
"control", and use this as a reference:

Cy3   Cy5
wt_t1  control
control wt_t1
wt_t2  control
control  wt_t2
mu_t1  control
control mu_t1
mu_t2  control
control mu_t2

design <- modelMatrix( target, ref="control" )
fit <- lmFit( ma, design )
contrast <- makeContrast( foo=(wt_t1-mu_t1)+(wt_t2-mu_t2), levels=design)

contrast:
> contrast
          Contrasts
Levels      foo
  mu_t1    -1
  mu_t2    -1
  wt_t1      1
  wt_t2      1

fit2 <- contrasts.fit( fit, contrast )
fit2 <- eBayes( fit )

etc. This seems to work... somewhat. If I run separate contrasts to
compare wt and mu at t1, and wt and mu at t2, I get different results,
and also way more significant. I am confused.

best regards,
j.

-- 
-------- Dr. January Weiner 3 --------------------------------------



More information about the Bioconductor mailing list