annotate PLIDflow/scripts/envelopesmaker.R @ 6:795e11fac81b draft default tip

Included new tools for standardization
author bitlab
date Wed, 22 Apr 2020 06:12:00 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
1 #envelopesmaker.R makes FILL_Xout.pdb files where X represents values for envelopes from 10 to 100
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
2
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
3 #!/usr/bin/env Rscript
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
4 args = commandArgs(trailingOnly=TRUE)
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
5
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
6 if(length(args) < 1){
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
7 stop("USE: Rscript envelopesmaker.R <receptor_pdbqt> <session_dir> <pathAutoligand>")
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
8 }
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
9
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
10 #Arguments definition
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
11 receptor_name <- args[1]
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
12 session_dir <- args[2]
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
13 pathLigand <- args[3]
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
14
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
15 #recopy <- paste("/home/galaxy/galaxy/tools/proteindocking/scripts/", basename(args[1]), ".txt", sep="")
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
16 #command <- paste("cp ", args[1], " ", recopy, sep="") #18jun2018
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
17 #system(command) #18jun2018
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
18
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
19 #
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
20
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
21 recopy_2 <- scan(paste(basename(args[1]), ".txt", sep=""), what = character(), quiet = TRUE)
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
22
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
23
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
24 #print(paste("es lo que va a salir",recopy_2[1]))
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
25
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
26 #Ejecute from R a python script for Running Autoligand
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
27 sizes_file <- scan("templateenvelopsizes.txt", what = character(), quiet = TRUE)
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
28
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
29 path_cajonDesastre <- recopy_2[1]
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
30
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
31 segment_paste <- paste("python", pathLigand, "-r", path_cajonDesastre, "-p", sep = " ")
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
32 #segment_paste <- paste("python /home/eugenia/workflowsoftware/mgltools_x86_64Linux2_1.5.6/MGLToolsPckgs/AutoDockTools/AutoLigand.py -r", path_cajonDesastre, "-p", sep = " ")
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
33
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
34 #print(segment_paste)
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
35
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
36 #print(paste("es lo que va a salir",recopy_2[1]))
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
37
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
38 for(i in 1:length(sizes_file)){
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
39 size <- sizes_file[i]
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
40
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
41 ##porcentaje <- (i/length(sizes_file))*100
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
42
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
43 ##print(paste(paste(porcentaje, "%", sep = ""),"completed", sep = " "))
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
44
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
45
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
46 # HEMOS TACHADO ESTE SYSTEM
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
47 print(paste(segment_paste,size, sep = " "))
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
48
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
49 # ENABLE THIS SYSTEM
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
50 #system(paste(segment_paste,size, sep = " "), intern = TRUE)
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
51 write(paste(segment_paste,size, sep = " "), file = "commands", append = TRUE)
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
52 }
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
53
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
54 system("tac commands > rev_commands")
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
55 system("./parallel_launch.sh rev_commands 10")
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
56
795e11fac81b Included new tools for standardization
bitlab
parents:
diff changeset
57