Hello,
I am working on an RNAseq project in EdgeR and I have a random effect variable that I am not sure how to best deal with since EdgeR doesn't use mixed models. I have three main questions: 1) how have people dealt with random effects in EdgeR, or do you use different programs to accomplish this? 2) How are blocking and batch effects different in EdgeR (the manual suggests using the same additive model for both), and 3) is it possible to block for a variable that is unreplicated (see below)?
Set up: I have a control and three dose groups (low, medium, high) each with five replicates. Within each treatment group, samples came from one of twelve different mesocosms, with each mesocosm representing a single dose. Thus, there are three mesocosms contributing between one and three individuals to a treatment group. For example, the five high dose individuals had three individuals from the S2h mesocosm and one each from the S3h and C1h mesocosms. After reading the EdgeR manual, I tried blocking for mesocosm, but because I don't have replicates for each mesocosm, I got an error message due to my design matrix not having a full rank:
> mfit <- glmQLFit(e2, design4) Error in glmFit.default(y, design = design, dispersion = dispersion, offset = offset, : Design matrix not of full rank. The following coefficients not estimable: groupH groupL groupM
Here is the code that I was using to set this up:
group <- factor(c("C","H","L","M","H","C","L","M","C","M","H","M","L","H","C","L","H","C","M","L")) mesocosm <- factor(c("C1c", "C1h", "S2l", "S2m", "S2h", "S2c", "S2l", "S2m", "S2c", "S2m", "S2h", "C1m", "S2l", "S2h", "S3c", "S3l", "S3h", "S3c", "S3m", "S3l")) design4 <- model.matrix(~mesocosm+group) mfit <- glmQLFit(e2, design4) mqlf <- glmQLFTest(fit, coef=4:6)
Thank you for your help!
Would I be correct to guess that each "mesocosm" in your experiment is a separate physical field station with its own environmental setup? Does any physical station contribute individuals with more than one dose? In other words, do you really have 12 different physical environments or only 3? I would guess that it would usually be possible to apply more than one dose within the same physical environmental.
Hi Gordon,
Thank you for your reply. All mesocosms are at the same physical site, but the site is broken down into fenced in "pads" which contain the mesocosms (which are individual cattle tanks). Thus, the S1 mesocosms (S1h, S1m, S1l, S1c) are within one fenced pad. The pads are very close to one another and any sort of environmental variation (i.e. shading from sun) is just as likely across mesocosms as it is across pads.