annotate ChoosePatterns.R @ 18:3eb0e0d10f36 draft

Uploaded
author ning
date Wed, 20 Mar 2013 00:06:40 -0400
parents 58bb88f53765
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15
58bb88f53765 Uploaded
ning
parents:
diff changeset
1 sink(file="/tmp/none")
58bb88f53765 Uploaded
ning
parents:
diff changeset
2 sink("/dev/null")
58bb88f53765 Uploaded
ning
parents:
diff changeset
3 options(warn=-1)
58bb88f53765 Uploaded
ning
parents:
diff changeset
4 options(echo=F)
58bb88f53765 Uploaded
ning
parents:
diff changeset
5
58bb88f53765 Uploaded
ning
parents:
diff changeset
6 #invisible("EBSeq")
58bb88f53765 Uploaded
ning
parents:
diff changeset
7 suppressMessages(library("EBSeq"))
58bb88f53765 Uploaded
ning
parents:
diff changeset
8
58bb88f53765 Uploaded
ning
parents:
diff changeset
9 args <- commandArgs(trailingOnly = T)
58bb88f53765 Uploaded
ning
parents:
diff changeset
10 inputfile <- args[1]
58bb88f53765 Uploaded
ning
parents:
diff changeset
11 Idx <- args[2]
58bb88f53765 Uploaded
ning
parents:
diff changeset
12 outputfile <- args[3]
58bb88f53765 Uploaded
ning
parents:
diff changeset
13
58bb88f53765 Uploaded
ning
parents:
diff changeset
14 print(args)
58bb88f53765 Uploaded
ning
parents:
diff changeset
15
58bb88f53765 Uploaded
ning
parents:
diff changeset
16 ReadIn=read.table(inputfile,stringsAsFactors=F,header=T, sep="\t")
58bb88f53765 Uploaded
ning
parents:
diff changeset
17
58bb88f53765 Uploaded
ning
parents:
diff changeset
18 IndexIn=strsplit(Idx,split=",")[[1]]
58bb88f53765 Uploaded
ning
parents:
diff changeset
19 Index=as.numeric(IndexIn)
58bb88f53765 Uploaded
ning
parents:
diff changeset
20
58bb88f53765 Uploaded
ning
parents:
diff changeset
21 Mat=data.matrix(ReadIn)
58bb88f53765 Uploaded
ning
parents:
diff changeset
22
58bb88f53765 Uploaded
ning
parents:
diff changeset
23 Out=Mat[Index,]
58bb88f53765 Uploaded
ning
parents:
diff changeset
24
58bb88f53765 Uploaded
ning
parents:
diff changeset
25
58bb88f53765 Uploaded
ning
parents:
diff changeset
26 write.table(Out,file=outputfile,quote=F,col.names=T,row.names=T,sep = "\t")
58bb88f53765 Uploaded
ning
parents:
diff changeset
27