col_ordering = c(9,10,7,8)#KO_M1vsM2 poly =poly0[,col_ordering]; poly = poly[(rowSums(poly[,1:2])>=2)&(rowSums(poly[,3:4])>=2),] conditions = factor(c("IFN","IFN","IL4","IL4")); exp_study = DGEList(counts=poly, group=conditions);exp_study = calcNormFactors(exp_study);exp_study = estimateCommonDisp(exp_study);exp_study = estimateTagwiseDisp(exp_study);et = exactTest(exp_study) tTags = topTags(et,n=NULL,adjust.method = "fdr") 1r <- rownames(tTags) c=cpm(exp_study)[r, order(exp_study$samples$group)] x=merge(x=as.data.frame(tTags),y=gl,by="row.names",all.x=TRUE) x=x[,!(names(x) %in% "ID")] rownames(x)=x$Row.names; x=x[,!(names(x) %in% "Row.names")] x2=merge(x=x,y=c,by="row.names",all.x=TRUE) x=x2[,!(names(x2) %in% "ID")] x=cbind(x,1000*x[,8]/x$genelength,1000*x[,9]/x$genelength,1000*x[,10]/x$genelength,1000*x[,11]/x$genelength) x=cbind(x,0.5*(x[,12]+x[,13]),0.5*(x[,14]+x[,15])) write.table(x, file="edgeRgenesPolyExpr-KO_M1vsM2.csv") x_m2=x for (i in 8:11){ print (colnames(x)[i]) tt=summary(x[,i]>0) print(tt) } str(exp_study$counts) int [1:21866, 1:4] 5 10 3 2 1 0 2 2 11 2 ... - attr(*, "dimnames")=List of 2 ..$ : chr [1:21866] "ENSMUSG00000051951" "ENSMUSG00000103377" "ENSMUSG00000104017" "ENSMUSG00000103025" ... ..$ : chr [1:4] "KO_IL4_replicate_IIb" "KO_IL4_replicate_Ib" "KO_IFN.gamma_replicate_IIb" "KO_IFN_replicate_Ib" col_ordering = c(9,10,7,8)#KO_M1vsM2 poly =poly0[,col_ordering]; poly = poly[(rowSums(poly[,1:2])>=2)&(rowSums(poly[,3:4])>=2),] conditions = factor(c("IFN","IFN","IL4","IL4")); col_ordering = c(9,10,7,8)#KO_M1vsM2 poly =poly0[,col_ordering]; poly = poly[(rowSums(poly[,1:2])>=2)&(rowSums(poly[,3:4])>=2),] conditions = factor(c("IL4","IL4","IFN","IFN")); exp_study = DGEList(counts=poly, group=conditions);exp_study = calcNormFactors(exp_study);exp_study = estimateCommonDisp(exp_study);exp_study = estimateTagwiseDisp(exp_study);et = exactTest(exp_study,pair=c("IFN","IL4")) tTags = topTags(et,n=NULL,adjust.method = "fdr") Comparison of groups: IL4-IFN logFC logCPM PValue FDR ENSMUSG00000020641 -5.8099539420 11.226557 1.736083e-40 3.004988e-36 ENSMUSG00000022126 -6.2315874981 9.663629 2.748548e-40 3.004988e-36 ENSMUSG00000020638 -5.5310326460 9.361139 2.561904e-34 1.867286e-30 poly[rownames(poly)=="ENSMUSG00000020641",] KO_IL4_replicate_IIb KO_IL4_replicate_Ib ENSMUSG00000020641 47 81 KO_IFN.gamma_replicate_IIb KO_IFN_replicate_Ib ENSMUSG00000020641 4046 6115