Contrasts matrix for 2x2 factorial
There are many contrasts to make in a 2x2 factorial design. You need to test for the differences in the type of tree in each of the water conditions, the differences in the response to drought for each of the trees, and the differences in the response to drought between the two types of tree (traditionally referred to as the interaction effect).
Cet exercice fait partie du cours
Differential Expression Analysis with limma in R
Instructions
The ExpressionSet object eset
with the Populus data and the design matrix you just created (design
) have been loaded in your workspace.
Create
type_drought
to test the effect of the type of tree (NM6 v. DN34) in the drought condition.Create
water_dn34
to test the effect of the drought in the DN34 trees.Create an interaction term to test for differences in the response to drought between the two types of tree (hint: contrast
water_nm6
andwater_dn34
).
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
# Load package
library(limma)
# Create a contrasts matrix
cm <- makeContrasts(type_normal = nm6.normal - dn34.normal,
type_drought = ___ - ___,
water_nm6 = nm6.drought - nm6.normal,
water_dn34 = ___ - ___,
interaction = (___ - ___) - (___ - ___),
levels = design)
# View the contrasts matrix
cm