#!/usr/bin/env Rscript
args <- commandArgs(TRUE)
library("edgeR")
rnaseqMatrix <- read.delim(args[1],row.names="Symbol")
head(rnaseqMatrix,5)
group <- factor(c("A","A","A","B","B","B"))
levels(group)
exp_study <- DGEList(counts=rnaseqMatrix,group=group)
exp_study = calcNormFactors(exp_study)
exp_study = estimateCommonDisp(exp_study)
exp_study = estimateTagwiseDisp(exp_study)
et = exactTest(exp_study, pair=c("A", "B"))
tTags = topTags(et,n=NULL)
write.table(tTags, file=args[2], sep='\t', quote=F, row.names=T)
