annotate select_compound.R @ 1:843adfe71ce2 draft

planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272-dirty
author anmoljh
date Sun, 03 Jun 2018 01:35:07 -0400
parents 639d350de274
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
639d350de274 planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272-dirty
anmoljh
parents:
diff changeset
1 args <- commandArgs(T)
639d350de274 planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272-dirty
anmoljh
parents:
diff changeset
2 arg1 <- args[1] ## Reae Input prediction file
639d350de274 planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272-dirty
anmoljh
parents:
diff changeset
3 arg2 <- args[2] ## Less Than
639d350de274 planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272-dirty
anmoljh
parents:
diff changeset
4 arg3 <- args[3] ## Greater Than or equal too
639d350de274 planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272-dirty
anmoljh
parents:
diff changeset
5 arg4 <- args[4] ## Active / Inactive
639d350de274 planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272-dirty
anmoljh
parents:
diff changeset
6 arg5 <- args[5] ## define output file name
639d350de274 planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272-dirty
anmoljh
parents:
diff changeset
7 asd <- read.table(arg1,row.names=1,header=T)
639d350de274 planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272-dirty
anmoljh
parents:
diff changeset
8 if (arg4 == "Active") {
639d350de274 planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272-dirty
anmoljh
parents:
diff changeset
9 refined <- asd[asd[,1] >= as.numeric(arg3) & asd[,1] <= as.numeric(arg2),]
639d350de274 planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272-dirty
anmoljh
parents:
diff changeset
10 compound <- rownames(refined)
639d350de274 planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272-dirty
anmoljh
parents:
diff changeset
11 refined <- cbind(compound,refined)
639d350de274 planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272-dirty
anmoljh
parents:
diff changeset
12 } else if((arg4 == "Inactive") ){
639d350de274 planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272-dirty
anmoljh
parents:
diff changeset
13 #refined <- asd[asd[,1] <= as.numeric(arg2),]
639d350de274 planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272-dirty
anmoljh
parents:
diff changeset
14 refined <- asd[asd[,2] >= as.numeric(arg3) & asd[,2] <= as.numeric(arg2),]
639d350de274 planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272-dirty
anmoljh
parents:
diff changeset
15 compound <- rownames(refined)
639d350de274 planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272-dirty
anmoljh
parents:
diff changeset
16 refined <- cbind(compound,refined)}
639d350de274 planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272-dirty
anmoljh
parents:
diff changeset
17 ###write.table(dw,file=args3,row.names=FALSE,sep="\t")
639d350de274 planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272-dirty
anmoljh
parents:
diff changeset
18 write.table(refined,file=arg5,row.names=FALSE,sep="\t")
639d350de274 planemo upload commit a1f4dd8eb560c649391ada1a6bb9505893a35272-dirty
anmoljh
parents:
diff changeset
19