-
Notifications
You must be signed in to change notification settings - Fork 4
/
create_Vina_config_file
executable file
·41 lines (33 loc) · 1.38 KB
/
create_Vina_config_file
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
# Input parameters: ligand index, complex index, config file index
# Output parameter: Vina config file
lig_index=$1
comp_index=$2
conf_index=$3
source $vini_dir/sourceme
$MGLBIN/pythonsh $MGLUTILS/prepare_gpf4.py -l ligand_${lig_index}.pdbqt -r complex_${comp_index}.pdbqt -o complex_${comp_index}.gpf
sed -i '1s/^/parameter_file AD4_parameters.dat\n/' complex_${comp_index}.gpf #Add <parameter_file AD4_parameters.dat> as the 1st line in *.gpf
#$vini_dir/autogrid4 -p complex_${comp_index}.gpf -l complex_${comp_index}.glg 2> /dev/null | tee -a $WORKDIR/${comp_index}/stats #Create grid maps and redirects standard error to device null
$vini_dir/autogrid4 -p complex_${comp_index}.gpf -l complex_${comp_index}.glg #Create grid maps
if [ -e complex_${comp_index}.maps.fld ]
then
line=`head -n 9 complex_${comp_index}.maps.fld | tail -1` #get xyz coordinates
echo $line > tempor1
grep CENTER tempor1 > tempor2
count=`wc -c < tempor2`
one=1
if [ $count -eq $NULL ]
then
center_x=0
center_y=0
center_z=0
else
center_x=`echo $line | awk '{print $2}'`
center_y=`echo $line | awk '{print $3}'`
center_z=`echo $line | awk '{print $4}'`
fi
else
center_x=0
center_y=0
center_z=0
fi
printf "%s%s\n\n%s%s\n\n%s%s\n" "center_x = " "$center_x" "center_y = " "$center_y" "center_z = " "$center_z" > conf_${conf_index}.txt