-
Notifications
You must be signed in to change notification settings - Fork 1
/
cfold.sh
87 lines (74 loc) · 2.11 KB
/
cfold.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
CURRENTPATH=$(pwd)
usage() {
echo ""
echo "Please make sure msa_mode and fasta_path are passed (in that order)"
echo "Usage: [msa_mode] [fasta_path] -a -t -m"
echo "---------------------------------------------------------------------------"
echo "require arguments"
echo "msa_mode: mmseqs2 (fast) or jackhmmer (slow)"
echo "fasta_path: path to input sequence file in fasta format"
echo "optional arguments"
echo "-a | --amber_relax use amber relaxation (slow)"
echo "-t | --template use templates"
echo "-d | --max_template_date: <date> date for template use cutoff in format YYYY-MM-DD"
exit 1
}
DATADIR=""
AMBER=0
TEMPLATE=0
MAX_TEMPLATE_DATE="2100-01-01"
PARAMS=""
while (( "$#" )); do
case "$1" in
-a|--amber_relax)
AMBER=1
shift
;;
-t|--template)
TEMPLATE=1
shift
;;
-d|--max_template_date)
if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
MAX_TEMPLATE_DATE=$2
shift 2
else
echo "Error: Argument for $1 is missing" >&2
exit 1
fi
;;
-*|--*=)
echo "Error: Unsupported flag $1" >&2
exit 1
;;
*)
PARAMS="$PARAMS $1"
shift
;;
esac
done
eval set -- "$PARAMS"
if [[ "$1" == "" || "$2" == "" ]] ; then
usage
fi
if [[ "$2" == "" ]] ; then
echo "Error: pass a path to a input fasta file"
exit 1
else
JOBNAME=$(basename "$2")
fi
if [[ "$DATADIR" == "" && "$1" == "jackhmmer" ]] ; then
echo "Error: jackhmmer alphafold dataset directory not set. Edit line 20 of cfold.sh to path to data directory"
exit 1
fi
if [[ "$1" == "mmseqs2" ]] ; then
sbatch $CURRENTPATH/cfold_mmseqs2_slurm.sh $2 $AMBER $TEMPLATE $MAX_TEMPLATE_DATE $JOBNAME
exit 0
fi
if [[ "$1" == "jackhmmer" ]] ; then
sbatch $CURRENTPATH/cfold_jackhmmer_slurm.sh $2 $AMBER $TEMPLATE $MAX_TEMPLATE_DATE $DATADIR $JOBNAME
exit 0
fi
echo "Error: msa mode not regonized: $1. accepted values are mmseqs2 or jackhmmer"
exit 1