annotate Use/ChoosePatterns.R @ 27:fdbabf28d095 draft

Uploaded
author ning
date Mon, 16 Jun 2014 16:16:43 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27
fdbabf28d095 Uploaded
ning
parents:
diff changeset
1 sink(file="/tmp/none")
fdbabf28d095 Uploaded
ning
parents:
diff changeset
2 sink("/dev/null")
fdbabf28d095 Uploaded
ning
parents:
diff changeset
3 options(warn=-1)
fdbabf28d095 Uploaded
ning
parents:
diff changeset
4 options(echo=F)
fdbabf28d095 Uploaded
ning
parents:
diff changeset
5
fdbabf28d095 Uploaded
ning
parents:
diff changeset
6 #invisible("EBSeq")
fdbabf28d095 Uploaded
ning
parents:
diff changeset
7 #suppressMessages(library("EBSeq")) ##cms - changed on 11/11/13. Don't need EBSeq package.
fdbabf28d095 Uploaded
ning
parents:
diff changeset
8
fdbabf28d095 Uploaded
ning
parents:
diff changeset
9 args <- commandArgs(trailingOnly = T)
fdbabf28d095 Uploaded
ning
parents:
diff changeset
10 inputfile <- args[1]
fdbabf28d095 Uploaded
ning
parents:
diff changeset
11 Idx <- args[2]
fdbabf28d095 Uploaded
ning
parents:
diff changeset
12 outputfile <- args[3]
fdbabf28d095 Uploaded
ning
parents:
diff changeset
13
fdbabf28d095 Uploaded
ning
parents:
diff changeset
14 print(args)
fdbabf28d095 Uploaded
ning
parents:
diff changeset
15
fdbabf28d095 Uploaded
ning
parents:
diff changeset
16 ReadIn=read.table(inputfile,stringsAsFactors=F,header=T, sep="\t")
fdbabf28d095 Uploaded
ning
parents:
diff changeset
17
fdbabf28d095 Uploaded
ning
parents:
diff changeset
18 IndexIn=strsplit(Idx,split=",")[[1]]
fdbabf28d095 Uploaded
ning
parents:
diff changeset
19 Index=as.numeric(IndexIn)
fdbabf28d095 Uploaded
ning
parents:
diff changeset
20
fdbabf28d095 Uploaded
ning
parents:
diff changeset
21 #Mat=data.matrix(ReadIn)
fdbabf28d095 Uploaded
ning
parents:
diff changeset
22 Mat=data.matrix(ReadIn[,-1]) ##cms - changed on 11/11/13. Otherwise pattern IDs are replaced with NA.
fdbabf28d095 Uploaded
ning
parents:
diff changeset
23 rownames(Mat)=ReadIn[,1] ##cms - also added on 11/11/13 to add pattern IDs back in.
fdbabf28d095 Uploaded
ning
parents:
diff changeset
24
fdbabf28d095 Uploaded
ning
parents:
diff changeset
25 Out=Mat[Index,]
fdbabf28d095 Uploaded
ning
parents:
diff changeset
26
fdbabf28d095 Uploaded
ning
parents:
diff changeset
27
fdbabf28d095 Uploaded
ning
parents:
diff changeset
28 #write.table(Out,file=outputfile,quote=F,col.names=T,row.names=T,sep = "\t")
fdbabf28d095 Uploaded
ning
parents:
diff changeset
29 write.table(Out,file=outputfile,quote=F,col.names=NA,row.names=T,sep = "\t") ##cms - changed on 11/11/13
fdbabf28d095 Uploaded
ning
parents:
diff changeset
30