Hi
I'm confused about how to identify differentially expressed genes (DEGs) in a single-channel expt.
Is it possible to identify DEGs without making a contrast.matrix?
I saw examples just did:
fit <- lmFit(...)
fit <- eBayes(fit)
tt <- topTable(fit, coef=2)
All DEGs are stored in tt
However, when I looked up the limma user guide (version 2016) in section 9.6, the example used contrast.matrix.
Can someone help?
Thanks Eric.
I think my answer can be found in chapter 9 (2016 edition) on p.40-41. For a fixed reference group, there is no need to construct a contrast.matrix because eBayes and topTable always use 'intercept' or coef=1 as the reference for comparison. For this scenario, design <- model.matrix(~conditions). conditions is a factor variable defining the experimental conditions including the reference.
However, if a fixed reference group is not applicable for your problem. More flexibility can be accommodated by building a contrast.matrix. In such case, you can contrast different experimental conditions. The design must be defined as:
design <- model.matrix(~0+conditions)
In such case, you can compare e.g. condition3-condition2, condition2-condition1, by
cont.matrix <- makeContrasts(C3vsC2=condition3-condition2, C2vsC1=condition2-condition1, levels=design)