-
Notifications
You must be signed in to change notification settings - Fork 2
/
docking.sh
46 lines (37 loc) · 1.15 KB
/
docking.sh
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
#! /bin/bash
#author: yanhong hong
liganddir=$PWD'/ligands'
receptordir=$PWD'/receptor'
resultdir=$PWD'/results'
logdir=$PWD'/log'
#docking parameters
num_modes=40
exhaustiveness=40
energy_range=10
cpu=7
process_num=2
if [ ! -d "$resultdir" ]; then
mkdir ${resultdir}
fi
if [ ! -d "$logdir" ]; then
mkdir ${logdir}
fi
#blind dock
for ligand in ${liganddir}/pdbqt/*.pdbqt
do
for receptor in ${receptordir}/*/*.pdbqt
do
receptor_prefix=`basename $receptor .pdbqt`
ligand_prefix=`basename $ligand .pdbqt`
echo -e "smina -r "${receptor}" -l "${ligand}" --autobox_ligand "${receptor}" --cpu "${cpu}" --num_modes "${num_modes}" --exhaustiveness "${exhaustiveness}" --energy_range "${energy_range}" -o "${resultdir}/${receptor_prefix}_${ligand_prefix}.pdbqt" --log "${logdir}/${receptor_prefix}_${ligand_prefix}.log
done | xargs -n 1 -I {} -P ${process_num} bash -c '{}'
done
for result in ${resultdir}/*.pdbqt
do
{
result_prefix=`basename $result .pdbqt`
mkdir ${resultdir}/${result_prefix}
mv ${result} ${resultdir}/${result_prefix}
vina_split --input ${resultdir}/${result_prefix}/*.pdbqt
} &
done