-
Notifications
You must be signed in to change notification settings - Fork 7
/
run.001.lig_clean_am1bcc.csh
executable file
·115 lines (89 loc) · 4.48 KB
/
run.001.lig_clean_am1bcc.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
#!/bin/tcsh -fe
#
# This script prepares the ligand that will be used as a footprint reference. Input required is:
# ${system}.lig.moe.mol2, which is the ligand prepared in MOE by adding hydrogens and computing
# gasteiger charges.
#
# Note that the environment variable $AMBERHOME should be set externally to this script.
#
### Set some paths
set dockdir = "${DOCKHOMEWORK}/bin"
set amberdir = "${AMBERHOMEWORK}/bin"
set moedir = "${MOEHOMEWORK}/bin"
set rootdir = "${VS_ROOTDIR}"
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}"
### Check to see if the ligfile exists
if ( ! -e ${masterdir}/${system}.lig.moe.mol2 ) then
echo "Ligand file does not seem to exist. Exiting.";
exit
endif
### Make the lig-prep directory
rm -fr ${rootdir}/${system}/001.lig-prep/
mkdir -p ${rootdir}/${system}/001.lig-prep/
cd ${rootdir}/${system}/001.lig-prep/
##################################################
cat <<EOF >dock.lig.in
conformer_search_type rigid
use_internal_energy no
ligand_atom_file temp2.mol2
limit_max_ligands no
skip_molecule no
read_mol_solvation no
calculate_rmsd no
use_database_filter no
orient_ligand no
bump_filter no
score_molecules no
ligand_outfile_prefix lig
write_orientations no
num_scored_conformers 1
rank_ligands no
EOF
##################################################
### Pre-process the ligand with DOCK
echo -n "$system LIG : "
perl -pe 's/\r\n/\n/g' ${masterdir}/${system}.lig.moe.mol2 > temp1.mol2
perl ${scriptdir}/lig_unique_name.pl temp1.mol2 ${system} yes > temp2.mol2
${dockdir}/dock6 -i dock.lig.in -o dock.lig.out
mv lig_scored.mol2 ${system}.lig.processed.mol2
### If it exists, also pre-process the cofactor with DOCK
if ( -e ${masterdir}/${system}.cof.moe.mol2 ) then
echo -n "$system COF : "
perl -pe 's/\r\n/\n/g' ${masterdir}/${system}.cof.moe.mol2 > temp1.mol2
perl ${scriptdir}/lig_unique_name.pl temp1.mol2 ${system} yes > temp2.mol2
${dockdir}/dock6 -i dock.lig.in -o dock.cof.out
sed -e s/LIG/COF/ -e s/lig/cof/ lig_scored.mol2 > ${system}.cof.processed.mol2
endif
rm -f temp1.mol2 temp2.mol2 lig_scored.mol2 dock.lig.in
### Compute ligand charges with antechamber
${amberdir}/acdoctor -i ${system}.lig.processed.mol2 -f mol2 >& ac.lig.log
if ( `grep "Fatal Error" ac.lig.log | wc -l` ) then
echo "Fatal Error occurred in ligand preparation. Check ./${system}/001.lig-prep/ac.lig.log for more information."
exit
endif
${amberdir}/antechamber -fi mol2 -fo mol2 -c bcc -j 5 -at sybyl -s 2 -pf y -i ${system}.lig.processed.mol2 -o ${system}.lig.am1bcc.mol2 -dr n
if ( `grep "No convergence in SCF" sqm.out | wc -l` ) then
${amberdir}/antechamber -fi mol2 -fo mol2 -c bcc -j 5 -at sybyl -s 2 -pf y -ek "itrmax=100000, qm_theory='AM1', grms_tol=0.0002, tight_p_conv=0, scfconv=1.d-8" -i $system.lig.processed.mol2 -o $system.lig.am1bcc.mol2
endif
mv sqm.out sqm.lig.out
mv sqm.in sqm.lig.in
### If it exists, also compute cofactor charges
if ( -e ${masterdir}/${system}.cof.moe.mol2 ) then
${amberdir}/acdoctor -i ${system}.cof.processed.mol2 -f mol2 >& ac.cof.log
if ( `grep "Fatal Error" ac.cof.log | wc -l` ) then
echo "Fatal Error occurred in cofactor preparation. Check ./${system}/001.lig-prep/ac.cof.log for more information."
exit
endif
${amberdir}/antechamber -fi mol2 -fo mol2 -c bcc -j 5 -at sybyl -s 2 -pf y -i ${system}.cof.processed.mol2 -o ${system}.cof.am1bcc.mol2
if ( `grep "No convergence in SCF" sqm.out | wc -l` ) then
${amberdir}/antechamber -fi mol2 -fo mol2 -c bcc -j 5 -at sybyl -s 2 -pf y -ek "itrmax=100000, qm_theory='AM1', grms_tol=0.0002, tight_p_conv=0, scfconv=1.d-8" -i $system.cof.processed.mol2 -o $system.cof.am1bcc.mol2
endif
mv sqm.out sqm.cof.out
mv sqm.in sqm.cof.in
endif
exit