-
Notifications
You must be signed in to change notification settings - Fork 1
/
vina-ssh
executable file
·49 lines (44 loc) · 1.18 KB
/
vina-ssh
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
#! /usr/bin/env bash
ip=''
user=''
shift
payload_create() {
while true; do
case $1 in
receptor ) receptor=$(basename "$3"); vina_cache=$(dirname $3); shift 3;;
ligand ) ligand=$(basename "$3"); shift 3;;
center_x ) center_x="$3"; shift 3;;
center_y ) center_y="$3"; shift 3;;
center_z ) center_z="$3"; shift 3;;
size_x ) size_x="$3"; shift 3;;
size_y ) size_y="$3"; shift 3;;
size_z ) size_z="$3"; shift 3;;
out ) out=$(basename "$3"); shift 3;;
log ) log=$(basename "$3"); shift 3;;
num_modes ) num_modes="$3"; shift 3;;
'' ) break;;
* ) echo hi $1; shift 1;;
esac
done
}
payload_create $(cat $@)
payload="receptor = $receptor
ligand = $ligand
center_x = $center_x
center_y = $center_y
center_z = $center_z
size_x = $size_x
size_y = $size_y
size_z = $size_z
out = $out
log = $log
num_modes = $num_modes"
scp $vina_cache/$receptor $vina_cache/$ligand $user@$ip:/tmp/
echo "$payload" | ssh $user@$ip "mkdir ~/.vina_ssh &> /dev/null
cd ~/.vina_ssh
cp /tmp/$receptor /tmp/$ligand . &> /dev/null
cat > ~/.vina_ssh/config_ssh.txt
vina --config ~/.vina_ssh/config_ssh.txt &> /dev/null
cat $out
rm -rf ~/.vina_ssh &> /dev/null
" > $vina_cache/$out