Previous changeset 0:e42c12a40df6 (2013-03-15) Next changeset 2:186aff8bcca3 (2013-03-15) |
Commit message:
Uploaded |
added:
GetNormalizedExpression.R |
b |
diff -r e42c12a40df6 -r aebe98ba5c22 GetNormalizedExpression.R --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/GetNormalizedExpression.R Fri Mar 15 18:19:48 2013 -0400 |
[ |
@@ -0,0 +1,41 @@ +sink(file="/tmp/none") +sink("/dev/null") +options(warn=-1) +options(echo=F) + +invisible("EBSeq") +suppressMessages(library("EBSeq")) + +args <- commandArgs(trailingOnly = T) +inputfile <- args[1] +WhetherSampleName <- args[2] +outputfile <- args[3] +Boxplots<-args[4] +Sizesout <-args[5] + +print(args) + +if(WhetherSampleName=="y"){ + ReadIn=read.table(inputfile,stringsAsFactors=F,header=T, sep="\t") + Names=names(ReadIn)[-1] + } +if(WhetherSampleName=="n"){ + ReadIn=read.table(inputfile,stringsAsFactors=F,header=F, sep="\t") +} + +GeneMat=do.call(cbind,ReadIn[-1]) +rownames(GeneMat)=ReadIn[[1]] +if(WhetherSampleName=="y")colnames(GeneMat)=Names + + +Sizes=MedianNorm(GeneMat) + +Data.norm=GetNormalizedMat(GeneMat, Sizes) + +write.table(round(Data.norm,2),file=outputfile,quote=F,col.names=T,row.names=T,sep = "\t") +pdf(Boxplots) +boxplot(Data.norm,log="y",ylim=c(10^-1,10^6)) +dev.off() + +write.table(Sizes,file=Sizesout,quote=F,col.names=F,row.names=F,sep = "\t") + |