Mercurial > repos > deepakjadmin > r_caret_test3_jan
diff r_caret_test1-revision_toolshed/mayachemtool/condition.R @ 0:1d73537f975f draft default tip
Uploaded
author | deepakjadmin |
---|---|
date | Wed, 06 Jan 2016 03:45:22 -0500 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/r_caret_test1-revision_toolshed/mayachemtool/condition.R Wed Jan 06 03:45:22 2016 -0500 @@ -0,0 +1,19 @@ +args <- commandArgs(T) +arg1 <- args[1] ## Reae Input prediction file +arg2 <- args[2] ## Less Than +arg3 <- args[3] ## Greater Than or equal too +arg4 <- args[4] ## Active / Inactive +arg5 <- args[5] ## define output file name +asd <- read.table(arg1,row.names=1,header=T) +if (arg4 == "Active") { +refined <- asd[asd[,1] >= as.numeric(arg3) & asd[,1] <= as.numeric(arg2),] +compound <- rownames(refined) +refined <- cbind(compound,refined) +} else if((arg4 == "Inactive") ){ +#refined <- asd[asd[,1] <= as.numeric(arg2),] +refined <- asd[asd[,2] >= as.numeric(arg3) & asd[,2] <= as.numeric(arg2),] +compound <- rownames(refined) +refined <- cbind(compound,refined)} +###write.table(dw,file=args3,row.names=FALSE,sep="\t") +write.table(refined,file=arg5,row.names=FALSE,sep="\t") +