annotate PLIDflow/scripts/vinafilemarkerclusters.R @ 4:b9e7ec4e3cde draft

Uploaded
author bitlab
date Mon, 27 Jan 2020 07:12:19 -0500
parents 6fcfa4756040
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
1 #!/usr/bin/env Rscript # siempre va comentado, la consola lo interpreta asi.
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
2 args = commandArgs(trailingOnly=TRUE) # siempre es asi, no cambia.
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
3
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
4 if(length(args) < 10){
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
5 # stop("USE: Rscript.exe vinafilemarkerclusters.R <receptor_PDBQT> <ligand_PDBQT> <out_PDBQT> <log_file> <coo_x > <coo_y> <coo_z> <eboxsizedata> <galaxy_output> <v>")
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
6 stop("USE: Rscript vinafilemarkerclusters.R <receptor_PDBQT> <ligand_PDBQT> <out_PDBQT> <log_file> <coo_x > <coo_y> <coo_z> <eboxsizedata> <v> <session_dir>")
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
7 }
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
8
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
9
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
10 receptor_PDBQT <- args[1]
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
11 ligand_PDBQT <- args[2]
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
12 out_PDBQT <- args[3]
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
13 log_file <- args[4]
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
14 eboxsizedata <- args[8]
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
15 v <- args[9]
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
16 session_dir <- args[10]
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
17
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
18 setwd(session_dir)
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
19
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
20 receptor_data <- paste("receptor =", args[1], sep = " ")
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
21 ligando_data <- paste("ligand =" , args[2], sep = " ")
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
22 out_data <- paste("out =" , args[3], sep = " ")
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
23 log_file <- paste("log =", args[4], sep = " ")
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
24 center_x_data <- paste("center_x =", args[5], sep =" ")
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
25 center_y_data <- paste("center_y =", args[6], sep =" ")
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
26 center_z_data <- paste("center_z =", args[7], sep =" ")
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
27 aux <- as.numeric(scan(args[8], what="character", quiet=TRUE), quiet=TRUE)
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
28 size_x_data <- paste("size_x =", aux, sep = " ")
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
29 size_y_data <- paste("size_y =", aux, sep = " ")
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
30 size_z_data <- paste("size_z =", aux, sep = " ")
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
31
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
32 campos <- c(receptor_data,ligando_data, out_data, log_file, center_x_data, center_y_data, center_z_data, size_x_data, size_y_data, size_z_data)
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
33
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
34 datos <- c()
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
35 for(i in 1:length(campos)){
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
36 datos <-paste(c(datos, campos[i], sep="\n"))
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
37 }
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
38
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
39 write(datos, file=paste(v, "_vinaconfig", sep = ""), append=FALSE)
6fcfa4756040 Uploaded
bitlab
parents:
diff changeset
40