Hi,
I am trying to determine differentially expressed genes between different statuses using edgeR with the ANOVA-like approach. Our experiment is very similar to the mouse mammary gland experiment described in the edgeR user's guide. I can compare the three statuses for either the L cell type or the B cell type separately, as shown below:
> targets
CellType Status
B virgin
B virgin
B pregnant
B pregnant
B lactate
B lactate
L virgin
L virgin
L pregnant
L pregnant
L lactate
L lactate
> group <- factor(paste0(targets$CellType, ".", targets$Status))
> design <- model.matrix(~ 0 + group)
> fit <- glmQLFit(y, design, robust=TRUE)
> contrast <- makeContrasts(L.PvsL = L.pregnant - L.lactate,
L.VvsL = L.virgin - L.lactate,
L.VvsP = L.virgin - L.pregnant, levels=design)
> anova <- glmQLFTest(fit, contrast=contrast)
> topTags(anova, n=Inf, adjust.method = 'BH', sort.by = 'PValue')
However, I also want to find genes that are differentially expressed between the three statuses regardless of cell type. To do this, I would like to compare the 4 virgin, 4 pregnant, and 4 lactate samples together. How can I achieve this using the design above?
I have tried the following design, but it sets one of the statuses as a reference, and none of the statuses should serve as a reference or control:
> design <- model.matrix(~cell_type + status)
> fit <- glmQLFit(y, design)
> anova <- glmQLFTest(fit, coef=3:4)
> topTags(anova, n=Inf, adjust.method = 'BH', sort.by='PValue')
Simply remove the cell type from the model.
If you do it this way, the dispersion estimates would be much higher than they should (as the cell type difference is not accounted for in the design).