I'm new to edgeR and trying to perform differential expression for my samples, but having difficulties getting started. I have 8 pairs of samples most with 3 replicates each (1 replicate each from 2 groups had to be thrown out because they didn't pass QC).
So in general, each pair consists of 3 control and 3 treated biological replicates.
What I've tried to do is this:
group <- factor(c(1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6,6,7,7,7,7,7,8,8,8,8,8,8)) treat <- factor(c(1,1,1,2,2,2,1,1,1,2,2,2,1,1,1,2,2,2,1,1,1,2,2,2,1,1,1,2,2,1,1,1,2,2,2,1,1,2,2,2,1,1,1,2,2,2)) ## Set up y and design y <- DGEList(counts = x, group = group) y <- calcNormFactors(y) design <- model.matrix(~treat+group, data = y$samples) y <- estimateDisp(y,design)
However, when I run estimateDisp I get the following error:
Error in lfproc(x, y, weights = weights, cens = cens, base = base, geth = geth, : newsplit: out of vertex space
Am I setting up the DGEList object and design matrix correctly? If not, what should I do differently?
keep <- filterByExpr(x)
x <- x[keep,]
solved the issue!
I'm still not sure what my design should be: treat+group, group+treat, group*treat, group:treat? I want to compare treated and untreated within groups, but I also want to compare all treated vs all untreated. Would I use et for these comparisons?
Your design matrix is correct as it is.
For the filtering, you should use