-
Notifications
You must be signed in to change notification settings - Fork 0
/
glide_run_setup.local.csh
128 lines (111 loc) · 3.63 KB
/
glide_run_setup.local.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
#!/bin/csh
##########################################################################
#
# Peter M.U. Ung @ MSSM
# v1.0 - 15.06.16
#
# Run Schrodinger's Glide. Optional to choose to prepare protein(s)
# with default settings.
#
# Require all setup files in the home directory
# Dock precision level: HTVS or SP
# Grid file has the extension: .grid.zip
#
##########################################################################
set script = '~/Documents/ASCT2_project/2-Enrichment/1-glide-enrichment/4-glide_enrichment_2020/1-ASCT2_outopen_structure_02-2020/0.8_vdw_scaling_enrichment_glide'
set locald = `pwd`
if ($#argv != 6) then
echo ''
echo ' Usage: x.csh'
echo ' [List of Protein] [List of Ligand Database]'
echo ' [PDB Directory] [Dock Precision (HTVS|SP)]'
echo ' [Prepare Protein? (1|0)]'
echo ' [Start Docking (1|0)]'
echo ''
echo ' e.g.: x.csh top10.list lig.list grid SP 0 1'
echo ''
exit
endif
if (! -e $script/glide-dock.HTVS_SP.template.in) then
echo ''
echo ' Error: Missing glide-dock.HTVS_SP.template.in'
echo ''
exit
endif
#if (! -e 'glide-dock.template.lsf') then
# echo ''
# echo ' Error: Missing glide-dock.template.lsf'
# echo ''
# exit
#endif
set pdb_list = $argv[1]
set lig_list = $argv[2]
set pdb_dir = $argv[3]
set precision = $argv[4]
set prepare = $argv[5]
set docking = $argv[6]
##########################################################################
#module load schrodinger/2015-2
foreach pdb_file (`cat $pdb_list`)
set pdb_name = `basename $pdb_file .pdb`
echo $pdb_name
## Prepare Protein/Grid for Glide
if ($prepare == 1) then
cd $pdb_dir
if (! -e $locald/glide-grid_template.in) then
echo ''
echo ' Error: Missing glide-grid_template.in'
echo ''
exit
endif
if (-e ./glide-grid.$pdb_name.in) then
echo " ## Found existing grid. Skip..."
else
# -fix only do H minimerization
# -f '3' use OPLS3 (default in prepwizard is 2005)
${SCHRODINGER}/utilities/prepwizard -WAIT -SAVE -NOJOBID -NOLOCAL \
-disulfides \
-rehtreat \
-captermini \
-propka_pH '7.0' \
-fix \
-f '3' \
-j $pdb_name.run \
$pdb_file $pdb_name.maegz
sed "s/GNAME/$pdb_name/g" $locald/glide-grid_template.in | \
sed "s/GPROTNAME/$pdb_name.maegz/g" \
> glide-grid.$pdb_name.in
${SCHRODINGER}/glide -WAIT -SAVE -NOJOBID -NOLOCAL -OVERWRITE \
glide-grid.$pdb_name.in
endif
cd ..
endif
#up to here works and iterates.
if ($docking == 1) then
foreach lig_db (`cat $lig_list`)
set lig_name = `basename $lig_db .sdf.gz`
echo $lig_name
if (-e $pdb_name.$lig_name\.sdfgz) then
echo " Found previous dock $pdb_name.$lig_name . Skip..."
else
sed "s/GGRIDNAME/$pdb_name.zip/g" $locald/glide-dock.HTVS_SP.template.in | \
# sed "s/GGRIDNAME/$pdb_name.grid.zip/g" $locald/glide-dock.HTVS_SP.template.in | \
sed "s/HOMEDIR/$pdb_dir/g" | \
sed "s/GDOCKPRECIS/$precision/g" | \
sed "s/GLIGNAME/$lig_db/g" \
> $pdb_name.$lig_name.in
time ${SCHRODINGER}/glide $pdb_name.$lig_name.in \
-WAIT -SUBLOCAL -SAVE \
-noforce \
-OVERWRITE \
-HOST localhost:8 \
-NJOBS 8
# GLIDE stopped supporting .rept writeout since 2016-3
$SCHRODINGER/utilities/glide_sort -norecep -o $pdb_name.$lig_name\_sort.sdf.gz \
-r $pdb_name.$lig_name.rept $pdb_name.$lig_name\_lib.sdfgz
echo "Finished $pdb_name.$lig_name"
endif
end
endif
echo " Looping around..."
end