Hi all, I am struggling to make a contrast with EdgeR.
design <- model.matrix(~Gender + Age + Group, data = patient.table)
The (disease) Group is a factor with [Control, Mild, Severe]. I want to compare C-M. M-S and C-S. Thus s i
DGEL <- edgeR::DGEList(expressionData) keep <- edgeR::filterByExpr(DGEL) DGEL <- DGEL[keep, , keep.lib.sizes=FALSE] DGEL <- edgeR::calcNormFactors(DGEL, method = "TMM") DGEL <- edgeR::estimateDisp(DGEL, design) fit <- edgeR::glmQLFit(DGEL, design) contrasts <- makeContrasts(c.vs.m = GroupC - GroupM, m.vs.s = GroupM - GroupS, c.vs.s = GroupC - GroupS, levels = design)
However, there is no GroupC in the model matrix. There is only an Intercept, GroupM and GroupS. How can I compare anything against the control group on a full-rank design matrix.
I already searched in the user manual and here on the website, but could not find it. Also, I tried
design <- model.matrix(~Gender + Age + Group, data = patient.table, contrasts.arg = list( Group = contrasts(patient.table$Group, contrasts = FALSE) ) )
But edgeR did not like that and informed me that the table was not of full rank. I am pretty sure this is something basic, but I just don't get it as a wet-lab worker.