I am writing to clarify on the design matrix for running edgeR on data with multiple time points with two conditions.
condition time Group
sample1 condition1 T0 c1.to sample2 condition2 T0 c2.t0 sample3 condition1 T1 c1.t1 sample4 condition2 T1 c2.t1 sample5 condition1 T2 c1.t2 sample6 condition2 T2 c2.t2
Following section 3,3 in the edgeR manual, to find differentially expressed genes between condition1 and condition2 at baseline, T0,T1 andT2, the contrasts used are for example:
my.contrasts <- makeContrasts( c1.vs.c2.baseline = c1.t0-c2.t0, c1.vs.c2.T1 = (c1.t1-c1.t0)-(c2.t1-c2.t0), c1.vs.c2.T2 = (c1.t2-c1.t0)-(c2.t2-c2.t0), levels=design ) lrt0<- glmLRT(fit, contrast=my.contrasts[,"c1.vs.c2.baseline"]) lrt1<- glmLRT(fit, contrast=my.contrasts[,"c1.vs.c2.T1"]) lrt2<- glmLRT(fit, contrast=my.contrasts[,"c1.vs.c2.T2"])
Can you please let me know if I should be using any different approach for the comparisons.
Thanks for all the help. Sharvari