Mercurial > repos > yboursin > ebseq_eba
comparison ChoosePatterns.R @ 0:ddd3dad04441 draft default tip
Uploaded
| author | yboursin |
|---|---|
| date | Thu, 20 Oct 2016 08:59:24 -0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:ddd3dad04441 |
|---|---|
| 1 sink(file="/tmp/none") | |
| 2 sink("/dev/null") | |
| 3 options(warn=-1) | |
| 4 options(echo=F) | |
| 5 | |
| 6 #invisible("EBSeq") | |
| 7 #suppressMessages(library("EBSeq")) ##cms - changed on 11/11/13. Don't need EBSeq package. | |
| 8 | |
| 9 args <- commandArgs(trailingOnly = T) | |
| 10 inputfile <- args[1] | |
| 11 Idx <- args[2] | |
| 12 outputfile <- args[3] | |
| 13 | |
| 14 print(args) | |
| 15 | |
| 16 ReadIn=read.table(inputfile,stringsAsFactors=F,header=T, sep="\t") | |
| 17 | |
| 18 IndexIn=strsplit(Idx,split=",")[[1]] | |
| 19 Index=as.numeric(IndexIn) | |
| 20 | |
| 21 #Mat=data.matrix(ReadIn) | |
| 22 Mat=data.matrix(ReadIn[,-1]) ##cms - changed on 11/11/13. Otherwise pattern IDs are replaced with NA. | |
| 23 rownames(Mat)=ReadIn[,1] ##cms - also added on 11/11/13 to add pattern IDs back in. | |
| 24 | |
| 25 Out=Mat[Index,] | |
| 26 | |
| 27 | |
| 28 #write.table(Out,file=outputfile,quote=F,col.names=T,row.names=T,sep = "\t") | |
| 29 write.table(Out,file=outputfile,quote=F,col.names=NA,row.names=T,sep = "\t") ##cms - changed on 11/11/13 | |
| 30 |
