Hi,
I have the following design. Three cell types, A, B, and C obtained from three subjects.
subject condition
1 A
1 B
1 C
2 A
2 B
2 C
3 A
3 B
3 C
I would like to compare condition A to B to C (A is sort of primary ref here, so like BvsA, CvsA, and CvsB). I am not interested in differences between the subjects and would like to adjust for it. Though the data (from PCA plots etc) clearly shows separation by condition and similarity among subjects. The data is RNAseq processed, filtered for genes, and normalized (TMM with voom).
I am thinking of "blocking" using the design matrix:
design <- model.matrix(~subject+condition)
This generates only five columns, three for the subjects and two for the conditions. Where is the third condition? and the intercept is the first subject. Is this correct? Am I doing something wrong?
How should I define contrasts to detect genes differentially expressed in condition B vs condition A; condition C vs condition A; condition C vs condition B; and in in any of the three treatments? Do I specify as in below?
DGE = DGEList(counts=exprdatafltd, group=metadata)
y <- calcNormFactors(DGE,method =c("TMM"))
v <- voom(y, design, plot=TRUE)
fit <- lmFit(v, design)
fit <- contrasts.fit(fit, coefficient=?)
fit <- eBayes(fit)
Appreciate any help or suggestions! Thank you.
Got it. Thank you so much for the detailed explanation!