annotate PLIDflow/scripts/envelopesmaker.R @ 0:6fcfa4756040 draft

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