Mercurial > repos > anmoljh > candidate_compound_select
annotate select_compound.R @ 1:3bd5537cc516 draft default tip
planemo upload commit 6cabcd537575539c1428b3c5e1780c14a5f36b6e-dirty
| author | anmoljh |
|---|---|
| date | Wed, 25 Oct 2017 04:39:07 -0400 |
| parents | 557baa97ed72 |
| children |
| rev | line source |
|---|---|
|
0
557baa97ed72
planemo upload commit e713bcfa1b1690f9a21ad0bd796c2d385f646e66-dirty
anmoljh
parents:
diff
changeset
|
1 args <- commandArgs(T) |
|
557baa97ed72
planemo upload commit e713bcfa1b1690f9a21ad0bd796c2d385f646e66-dirty
anmoljh
parents:
diff
changeset
|
2 arg1 <- args[1] ## Reae Input prediction file |
|
557baa97ed72
planemo upload commit e713bcfa1b1690f9a21ad0bd796c2d385f646e66-dirty
anmoljh
parents:
diff
changeset
|
3 arg2 <- args[2] ## Less Than |
|
557baa97ed72
planemo upload commit e713bcfa1b1690f9a21ad0bd796c2d385f646e66-dirty
anmoljh
parents:
diff
changeset
|
4 arg3 <- args[3] ## Greater Than or equal too |
|
557baa97ed72
planemo upload commit e713bcfa1b1690f9a21ad0bd796c2d385f646e66-dirty
anmoljh
parents:
diff
changeset
|
5 arg4 <- args[4] ## Active / Inactive |
|
557baa97ed72
planemo upload commit e713bcfa1b1690f9a21ad0bd796c2d385f646e66-dirty
anmoljh
parents:
diff
changeset
|
6 arg5 <- args[5] ## define output file name |
|
557baa97ed72
planemo upload commit e713bcfa1b1690f9a21ad0bd796c2d385f646e66-dirty
anmoljh
parents:
diff
changeset
|
7 asd <- read.table(arg1,row.names=1,header=T) |
|
557baa97ed72
planemo upload commit e713bcfa1b1690f9a21ad0bd796c2d385f646e66-dirty
anmoljh
parents:
diff
changeset
|
8 if (arg4 == "Active") { |
|
557baa97ed72
planemo upload commit e713bcfa1b1690f9a21ad0bd796c2d385f646e66-dirty
anmoljh
parents:
diff
changeset
|
9 refined <- asd[asd[,1] >= as.numeric(arg3) & asd[,1] <= as.numeric(arg2),] |
|
557baa97ed72
planemo upload commit e713bcfa1b1690f9a21ad0bd796c2d385f646e66-dirty
anmoljh
parents:
diff
changeset
|
10 compound <- rownames(refined) |
|
557baa97ed72
planemo upload commit e713bcfa1b1690f9a21ad0bd796c2d385f646e66-dirty
anmoljh
parents:
diff
changeset
|
11 refined <- cbind(compound,refined) |
|
557baa97ed72
planemo upload commit e713bcfa1b1690f9a21ad0bd796c2d385f646e66-dirty
anmoljh
parents:
diff
changeset
|
12 } else if((arg4 == "Inactive") ){ |
|
557baa97ed72
planemo upload commit e713bcfa1b1690f9a21ad0bd796c2d385f646e66-dirty
anmoljh
parents:
diff
changeset
|
13 #refined <- asd[asd[,1] <= as.numeric(arg2),] |
|
557baa97ed72
planemo upload commit e713bcfa1b1690f9a21ad0bd796c2d385f646e66-dirty
anmoljh
parents:
diff
changeset
|
14 refined <- asd[asd[,2] >= as.numeric(arg3) & asd[,2] <= as.numeric(arg2),] |
|
557baa97ed72
planemo upload commit e713bcfa1b1690f9a21ad0bd796c2d385f646e66-dirty
anmoljh
parents:
diff
changeset
|
15 compound <- rownames(refined) |
|
557baa97ed72
planemo upload commit e713bcfa1b1690f9a21ad0bd796c2d385f646e66-dirty
anmoljh
parents:
diff
changeset
|
16 refined <- cbind(compound,refined)} |
|
557baa97ed72
planemo upload commit e713bcfa1b1690f9a21ad0bd796c2d385f646e66-dirty
anmoljh
parents:
diff
changeset
|
17 ###write.table(dw,file=args3,row.names=FALSE,sep="\t") |
|
557baa97ed72
planemo upload commit e713bcfa1b1690f9a21ad0bd796c2d385f646e66-dirty
anmoljh
parents:
diff
changeset
|
18 write.table(refined,file=arg5,row.names=FALSE,sep="\t") |
|
557baa97ed72
planemo upload commit e713bcfa1b1690f9a21ad0bd796c2d385f646e66-dirty
anmoljh
parents:
diff
changeset
|
19 |
