I'm using edgeR to test for DE genes in an expression matrix. For each sample if have a condition and a batch. I want to use the glm-functionality in edgeR to test for DE between conditions, while taking into account batches.

Some example data to show my problem. Say if have a count matrix, EM, of 10 sample with the following labels:

Do you want to just compare "con3" and "con2" vs. "con1" or do all of the pairwise comparisons? Your setup is more targeted toward comparing things versus con1 and including an intercept rather than using contrasts.

There are two ways to go about this. Firstly, either allow an intercept and then just use a contrast for the cond3 to cond2 comparison, or don't allow an intercept and group things different (e.g., group=sprint("%s.%s",batch,condition)).