comparison PLIDflow/scripts/gpffilemaker.R @ 0:6fcfa4756040 draft

Uploaded
author bitlab
date Tue, 14 Jan 2020 06:09:42 -0500
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:6fcfa4756040
1 #gpffilemaker makes the GPF file
2
3 #!/usr/bin/env Rscript
4 args = commandArgs(trailingOnly=TRUE)
5
6 if(length(args) < 1){
7 stop("USE: Rscript gpffilemaker.R <receptor_name> <session_dir>")
8 }
9
10 #Read file containing PDB geometric center and number of points x, y ,z
11 #archivo_center_npts <- scan("/home/galaxy/galaxy/tools/proteindocking/scripts/pdbcenter_npts.txt", what = character(), quiet = TRUE)
12 archivo_center_npts <- scan("pdbcenter_npts.txt", what = character(), quiet = TRUE)
13
14 #Read file containing receptor atom types
15 ver <- scan("receptor_atm_types.txt", what = character(), quiet = TRUE, na.strings = "NULLAJSKAJSFL")
16
17
18 #Arguments definition
19 receptor_name <- args[1]
20 session_dir <- args[2]
21 aux_receptor_name <- basename(args[1])
22 #aux_receptor_name <- paste("/home/galaxy/galaxy/tools/proteindocking/scripts/", basename(args[1]), sep="")
23 npts_x <- archivo_center_npts[4]
24 npts_y <- archivo_center_npts[5]
25 npts_z <- archivo_center_npts[6]
26 gridcenter_x <- archivo_center_npts[1]
27 gridcenter_y <- archivo_center_npts[2]
28 gridcenter_z <- archivo_center_npts[3]
29
30 #Creation of the GPF file
31 #Row 1
32 fila_1_e1 <- paste("npts", npts_x, sep = " ")
33 fila_1_e2 <- paste(fila_1_e1, npts_y, sep = " ")
34 fila_1_e3 <- paste(fila_1_e2, npts_z, sep = " ")
35 fila_1 <- paste(fila_1_e3, "# num.grid points in xyz", sep = " ")
36
37 #Row 2
38 fila_2_e2 <- paste(aux_receptor_name, ".maps.fld", sep = "")
39 fila_2_e1 <- paste("gridfld", fila_2_e2, sep = " " )
40 fila_2 <- paste(fila_2_e1, "# grid_data_file", sep = " ")
41
42 #Row 3
43 fila_3 <- paste("spacing 1.0", "# spacing(A)", sep = " ")
44
45 #Row 4
46 #fila_4 <- paste("receptor_types A C HD N NA OA S SA", "# receptor atom types", sep = " ")
47 cabecera_f4 <- ver[1]
48 vector_f4 <- c()
49 for(f4 in 2:length(ver)){
50 cabecera_f4 <- paste(cabecera_f4, ver[f4], sep = " ")
51 }
52
53 fila_4 <- paste("receptor_types", cabecera_f4, "# receptor atom types", sep = " ")
54 #print(fila_4)
55
56 #Row 5
57 fila_5 <- paste("ligand_types C HD OA", "# ligand atom types", sep = " ")
58
59 #Row 6
60 fila_6_e2 <- paste(aux_receptor_name, ".pdbqt", sep = "")
61 fila_6_e1 <- paste("receptor", fila_6_e2, sep = " ")
62 fila_6 <- paste(fila_6_e1, "# macromolecule", sep = " ")
63
64 #Row 7
65 fila_7_e1 <- paste("gridcenter",gridcenter_x, sep = " ")
66 fila_7_e2 <- paste(fila_7_e1, gridcenter_y, sep = " ")
67 fila_7_e3 <- paste(fila_7_e2, gridcenter_z, sep = " ")
68 fila_7 <- paste(fila_7_e3, "# xyz-coordinates or auto", sep = " ")
69
70 #Row 8
71 fila_8 <- paste("smooth 0.5", "# store minimum energy w/in rad(A)", sep = " ")
72
73 #Row 9
74 fila_9_e2 <- paste(aux_receptor_name, ".C.map", sep = "")
75 fila_9_e1 <- paste("map", fila_9_e2, sep = " ")
76 fila_9 <- paste(fila_9_e1, "# atom-specific affinity map", sep = " ")
77
78 #Row 10
79 fila_10_e2 <- paste(aux_receptor_name, ".HD.map", sep = "")
80 fila_10_e1 <- paste("map",fila_10_e2, sep = " ")
81 fila_10 <- paste(fila_10_e1, "# atom-specific affinity map", sep = " ")
82
83 #Row 11
84 fila_11_e2 <- paste(aux_receptor_name, ".OA.map", sep = "")
85 fila_11_e1 <- paste("map", fila_11_e2, sep = " ")
86 fila_11 <- paste(fila_11_e1, "# atom-specific affinity map", sep = " ")
87
88 #Row 12
89 fila_12_e2 <- paste(aux_receptor_name, ".e.map", sep = "")
90 fila_12_e1 <- paste("elecmap", fila_12_e2, sep = " ")
91 fila_12 <- paste(fila_12_e1, "# electrostatic potential map", sep = " ")
92
93 #Row 13
94 fila_13_e2 <- paste(aux_receptor_name, ".d.map", sep = "")
95 fila_13_e1 <- paste("dsolvmap", fila_13_e2, sep = " ")
96 fila_13 <- paste(fila_13_e1, "# desolvation potential map", sep = " ")
97
98 #Row 14
99 fila_14 <- paste("dielectric -0.1465", "# <0, AD4 distance-dep.diel;>0, constant", sep = " ")
100
101 #Paste all rows with a line jump for separation
102 filas <- c(fila_1, fila_2, fila_3, fila_4, fila_5, fila_6, fila_7, fila_8, fila_9, fila_10, fila_11, fila_12, fila_13, fila_14)
103
104 datos<- c()
105 for(i in 1:14){
106 datos <- paste(c(datos, filas[i]))
107 }
108
109 #nombre_final <- paste("/home/galaxy/galaxy/tools/proteindocking/scripts/", basename(args[1]), ".gpf", sep="")
110 nombre_final <- paste(basename(args[1]), ".gpf", sep="")
111
112 write(datos, file=nombre_final, append = FALSE)
113
114 #write(basename(args[1]), file= paste("/home/galaxy/galaxy/tools/proteindocking/scripts/", basename(args[1]), ".txt", sep="")) #parte añadida 18jun2018
115 write(basename(args[1]), file= paste(basename(args[1]), ".txt", sep="")) #parte añadida 18jun2018
116