Hi
I am stuck with limma design and contrasts. My pdata file consist of 3 variables
change Cells Days SelP G2215 D1 SelP G2215 D1 SelN G2215 D1 SelN G2215 D1 SelP G2 D1 SelP G2 D1 SelN G2 D1 SelN G2 D1 SelP G2215 D2 SelP G2215 D2 SelN G2215 D2 SelN G2215 D2 SelP G2 D2 SelP G2 D2 SelN G2 D2 SelN G2 D2 SelP G2215 D3 SelP G2215 D3 SelN G2215 D3 SelN G2215 D3 SelP G2 D3 SelP G2 D3 SelN G2 D3 SelN G2 D3
I want to compare the difference between selP and selN in G2 and G2215 cells and difference between these two cell types and how change in days is regulating this differential expression. I am not very well familiar with statistics so after reading manual and many online forums, i wrote the following code for this purpose
day=as.numeric(pdata$Days)
sc=paste(pdata$change,pdata$Cells,sep='.')
design<-model.matrix(~0+sc+ sc:day)
colnames(design)=gsub(':','_',colnames(design))
ContMatrix<-makeContrasts(G2=scSelP.G2-scSelN.G2,
G2215=scSelP.G2215-scSelN.G2215,
diff1=((scSelP.G2-scSelN.G2)-(scSelP.G2215-scSelN.G2215)),
G2_day=scSelP.G2_day-scSelN.G2_day,
G2215_day=scSelP.G2215_day-scSelN.G2215_day,
diff2=((scSelP.G2_day-scSelN.G2_day)-(scSelP.G2215_day-scSelN.G2215_day)),
levels=design)
fit<-lmFit(data,design)
fit2<-contrasts.fit(fit,ContMatrix)
fit2<-eBayes(fit2)
I am assuming that coef=1 to 3 will give me difference in the group without modulating changes depending on time (days) however coef=4 to 6 will give same results but this time how this differential expression is varying with time.
Can any one please suggest me if this design is ok or does it need further modification?