**0**wrote:

I want to analyze single-colour Agilent microarrays. I have two Treatment groups (Treat & CTRL) and three Genotypes (WildType, MutantA, & MutantB), and each Treatment/Genotype combination has 4 replicates.

i.e.

Genotype <- factor(rep(c("WildType","MutantA","MutantB"),each=8),levels=c("WildType","MutantA", "MutantB")) Treatment <- factor(rep(c("CTRL","Treat"),each=4,3),levels=c("CTRL","Treat"))

I want to test the following effects and comparisons:

Treatment Effect

Genotype Effect

Treatment x Genotype Interaction

WildType.Treat versus WildType.CTRL

MutantA.Treat versus MutantA.CTRL

MutantB.Treat versus MutantB.CTRL

MutantA.CTRL versus WildType.CTRL

MutantB.CTRL versus WildType.CTRL

MutantB.CTRL versus MutantA.CTRL

It is not clear to me how to set up the model.matrix and/or contrast.matrix to test all of these.

If I use:

design <- model.matrix(~Treatment*Genotype)

I get one coefficient for Treatment, but two for both Genotype and the interactions. How do I combine coefficients to get a single Genotype effect and a single Treatment x Genotype interaction effect?

If I use:

design <- model.matrix(~0+Treatment*Genotype)

I get two coefficients for Treatment, and again two for both Genotype and the interactions.

I found the thread here that discusses 2x3: 2 way anova in Bioconductor

But, when I try it, the results from the interaction terms don't appear correct. I.e. the:

summary(decideTests(fit,method="global",adjust.method="BH",p.value=0.05,lfc=0))

shows only a handful of significant genes for each of the two Treatment x Genotype coefficients, but pulling out the results with:

c89 <- topTable(fit2, coef = 8:9, sort="none", n=Inf,adjust.method = "BH") # where 8 and 9 or the two Treatment x Genotype coefficients

gives 20,000 significant genes.

I cannot fully wrap my head around how to interact with the models and coefficients to get out what I want. Any help would be appreciated. Thanks!

**39k**• written 3.7 years ago by ckeeling •

**0**