comparison ChoosePatterns.R @ 30:689cba393d6b draft

Uploaded
author ning
date Mon, 16 Jun 2014 16:21:33 -0400
parents
children
comparison
equal deleted inserted replaced
29:f2327f520c4d 30:689cba393d6b
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