# HG changeset patch # User ning # Date 1363386237 14400 # Node ID 58bb88f53765b1abcb15c5e51580cb9935218a52 # Parent eb8e01ed3516355ee7d963f5f232375596ee9dec Uploaded diff -r eb8e01ed3516 -r 58bb88f53765 ChoosePatterns.R --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ChoosePatterns.R Fri Mar 15 18:23:57 2013 -0400 @@ -0,0 +1,27 @@ +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] +Idx <- args[2] +outputfile <- args[3] + +print(args) + +ReadIn=read.table(inputfile,stringsAsFactors=F,header=T, sep="\t") + +IndexIn=strsplit(Idx,split=",")[[1]] +Index=as.numeric(IndexIn) + +Mat=data.matrix(ReadIn) + +Out=Mat[Index,] + + +write.table(Out,file=outputfile,quote=F,col.names=T,row.names=T,sep = "\t") +