-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflexpepdock.sh
72 lines (65 loc) · 1.69 KB
/
flexpepdock.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
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
#!/bin/bash
if [ $# -ne 4 ] && [ $# -ne 5 ]
then
echo "Usage: bash flexpepdock.sh RECEPTOR_NAME NAME ROOT_DIR RECEPTOR_LENGTH [ALL|CLUSTER_ONLY]"
exit
fi
RECEPTOR_NAME=$1
NAME=$2
ROOT_DIR=$3
RECEPTOR_LENGTH=$4
MODE=$5
echo "Receptor name: $1"
echo "Peptide name: $2"
echo "Root dir: $3"
echo "Receptor length: $4"
if [ ! -f "$ROOT_DIR/prepack/score.sc" ] || [ ! -f "$ROOT_DIR/fragments/frags.9mers.offset" ]
then
RES=$(sbatch \
--job-name=FPD-fp-${NAME} \
--error=../slurm/FPD-fp-${NAME}.err \
--output=../slurm/FPD-fp-${NAME}.out \
frag_and_prepack.sbatch \
$RECEPTOR_NAME \
$NAME \
$ROOT_DIR \
$RECEPTOR_LENGTH \
)
FP_ID=${RES##* }
echo "Submitted frag_and_prepack under ID $FP_ID"
else
FP_ID=1
echo "Frag and prepack already done"
fi
if [ "$MODE" == "ALL" ] || [ "$MODE" == "" ]
then
# Docking. We use singleton dependency to prevent more than one of these from
# running at a time.
RES=$(sbatch \
--job-name=FPD-dock-${NAME} \
--error=../slurm/FPD-dock-${NAME}.err \
--output=../slurm/FPD-dock-${NAME}.out \
--dependency=afterok:${FP_ID} \
docking.sbatch \
$RECEPTOR_NAME \
$NAME \
$ROOT_DIR \
)
DOCK_ID=${RES##* }
echo "Submitted docking under ID $DOCK_ID"
else
DOCK_ID=1
echo "Skipping docking"
fi
RES=$(sbatch \
--job-name=FPD-cluster-${NAME} \
--error=../slurm/FPD-cluster-${NAME}.err \
--output=../slurm/FPD-cluster-${NAME}.out \
--dependency=afterok:$DOCK_ID \
cluster.sbatch \
$RECEPTOR_NAME \
$NAME \
$ROOT_DIR \
)
CLUSTER_ID=${RES##* }
echo "Submitted cluster under ID $CLUSTER_ID"