forked from rizzolab/DOCK6_Screening_Protocols
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.006a.dock_to_grid.csh
executable file
·207 lines (173 loc) · 8.12 KB
/
run.006a.dock_to_grid.csh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
#!/bin/tcsh -fe
#
# Run this script on Cluster when you are ready to dock to the grid. Assumes receptor / grids
# and ligand library have already been prepared.
#
### Set some paths
set dockdir = "${DOCKHOMEWORK}/bin"
set amberdir = "${AMBERHOMEWORK}/bin"
set moedir = "${MOEHOMEWORK}/bin"
set rootdir = "${VS_ROOTDIR}"
set mpidir = "${VS_MPIDIR}/bin"
set masterdir = "${rootdir}/zzz.master"
set paramdir = "${rootdir}/zzz.parameters"
set scriptdir = "${rootdir}/zzz.scripts"
set zincdir = "${rootdir}/zzz.zinclibs"
set system = "${VS_SYSTEM}"
set vendor = "${VS_VENDOR}"
### Compile with intel 2013 compiler in case this is not default for some system
### Choose parameters for cluster
### LIRED 24 ppn
### SeaWulf 28 ppn
### Rizzo 24 ppn
set wcl = 48:00:00
set nodes = 8
set ppn = 28
set queue = "long"
@ numprocs = (${nodes} * ${ppn})
### Make the appropriate directory. If it already exists, remove previous dock results from only
### the same vendor.
if (! -e ${rootdir}/${system}/006.dock-to-grid) then
mkdir -p ${rootdir}/${system}/006.dock-to-grid/
endif
rm -rf ${rootdir}/${system}/006.dock-to-grid/${vendor}
mkdir -p ${rootdir}/${system}/006.dock-to-grid/${vendor}
cd ${rootdir}/${system}/006.dock-to-grid/${vendor}
### Count the number of chunks
set num_chunks = `ls -l ${rootdir}/${system}/005.zinclibs/${vendor}/ | grep chunk | grep mol2 | wc -l`
echo "num_chunks = ${num_chunks}"
set chunk = "0"
### Iterate over each chunk
while (${chunk} < ${num_chunks})
mkdir chunk${chunk}/
cd chunk${chunk}/
echo "Docking chunk named chunk${chunk}_scored.mol2"
### Write the dock.in file
##################################################
cat <<EOF >${system}.${vendor}.${chunk}.dock_to_grid.in
conformer_search_type flex
user_specified_anchor no
limit_max_anchors no
min_anchor_size 5
pruning_use_clustering yes
pruning_max_orients 1000
pruning_clustering_cutoff 100
pruning_conformer_score_cutoff 100.0
pruning_conformer_score_scaling_factor 1.0
use_clash_overlap no
write_growth_tree no
use_internal_energy yes
internal_energy_rep_exp 12
internal_energy_cutoff 100.0
ligand_atom_file ${rootdir}/${system}/005.zinclibs/${vendor}/chunk${chunk}_scored.mol2
limit_max_ligands no
skip_molecule no
read_mol_solvation no
calculate_rmsd no
use_database_filter no
orient_ligand yes
automated_matching yes
receptor_site_file ${rootdir}/${system}/003.spheres/${system}.rec.clust.close.sph
max_orientations 1000
critical_points no
chemical_matching no
use_ligand_spheres no
bump_filter no
score_molecules yes
contact_score_primary no
contact_score_secondary no
grid_score_primary yes
grid_score_secondary no
grid_score_rep_rad_scale 1
grid_score_vdw_scale 1
grid_score_es_scale 1
grid_score_grid_prefix ${rootdir}/${system}/004.grid/${system}.rec
multigrid_score_secondary no
dock3.5_score_secondary no
continuous_score_secondary no
footprint_similarity_score_secondary no
pharmacophore_score_secondary no
descriptor_score_secondary no
gbsa_zou_score_secondary no
gbsa_hawkins_score_secondary no
SASA_score_secondary no
amber_score_secondary no
minimize_ligand yes
minimize_anchor yes
minimize_flexible_growth yes
use_advanced_simplex_parameters no
simplex_max_cycles 1
simplex_score_converge 0.1
simplex_cycle_converge 1.0
simplex_trans_step 1.0
simplex_rot_step 0.1
simplex_tors_step 10.0
simplex_anchor_max_iterations 500
simplex_grow_max_iterations 500
simplex_grow_tors_premin_iterations 0
simplex_random_seed 0
simplex_restraint_min no
atom_model all
vdw_defn_file ${paramdir}/vdw_AMBER_parm99.defn
flex_defn_file ${paramdir}/flex.defn
flex_drive_file ${paramdir}/flex_drive.tbl
ligand_outfile_prefix ${vendor}.${chunk}.output
write_orientations no
num_scored_conformers 1
rank_ligands no
EOF
##################################################
### Write the Cluster submit file for Maui
##################################################
if (`hostname -f` == "login1.cm.cluster" || `hostname -f` == "login2.cm.cluster" ) then
cat <<EOF >${system}.${vendor}.${chunk}.qsub.csh
#!/bin/tcsh
#PBS -l walltime=${wcl}
#PBS -l nodes=${nodes}:ppn=${ppn}
#PBS -N ${system}.${vendor}.${chunk}
#PBS -V
#PBS -q ${queue}
echo "Job started on"
date
cd ${rootdir}/${system}/006.dock-to-grid/${vendor}/chunk${chunk}/
${mpidir}/mpirun -np ${numprocs} \
${dockdir}/dock6.mpi -v \
-i ${system}.${vendor}.${chunk}.dock_to_grid.in \
-o ${system}.${vendor}.${chunk}.dock_to_grid.out
echo "Job finished on"
date
EOF
##################################################
### Write the Cluster submit file for slurm
##################################################
###(`hostname -f` == "rizzo.cm.cluster" )
else
cat <<EOF >${system}.${vendor}.${chunk}.qsub.csh
#!/bin/tcsh
#SBATCH --time=${wcl}
#SBATCH --nodes=${nodes}
#SBATCH --ntasks=${ppn}
#SBATCH --job-name=${system}.${vendor}.${chunk}
#SBATCH --output=${system}.${vendor}.${chunk}.out
#SBATCH -p ${queue}
echo "Job started on"
date
cd ${rootdir}/${system}/006.dock-to-grid/${vendor}/chunk${chunk}/
${mpidir}/mpirun -np ${numprocs} \
${dockdir}/dock6.mpi -v \
-i ${system}.${vendor}.${chunk}.dock_to_grid.in \
-o ${system}.${vendor}.${chunk}.dock_to_grid.out
echo "Job finished on"
date
EOF
endif
##################################################
### Submit the job
echo "Submitting ${system}.${vendor}.${chunk}.dock_to_grid " >> ../zzz.submit.log
qsub ${system}.${vendor}.${chunk}.qsub.csh > & ${system}.${vendor}.${chunk}.qsub.log
sleep 2 # so the queue is not overwhelmed
date >> ../zzz.submit.log
@ chunk++
cd ../
end
exit