-
Notifications
You must be signed in to change notification settings - Fork 0
/
param_script.sh
45 lines (39 loc) · 1 KB
/
param_script.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
#!/bin/bash
ml Amber
while getopts "m:n:" opt; do
case $opt in
m)
if [ "$OPTARG" == "1" ] || [ "$OPTARG" == "2" ]; then
mode="$OPTARG"
else
echo "Invalid mode: $OPTARG. Please use 1 or 2."
exit 1
fi
;;
n)
name="$OPTARG"
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
esac
done
shift $((OPTIND - 1))
if [ -z "$mode" ] || [ -z "$name" ]; then
echo "Usage: $0 -m [1 or 2] -n [name]"
exit 1
fi
case $mode in
1)
antechamber -dr no -i "${name}.pdb" -fi pdb -o "${name}.com" -fo gcrt -gv 1
echo "Sent *com file to Gaussian"
;;
2)
espgen -i "${name}.gesp" -o "${name}.esp"
antechamber -i "${name}.log" -fi gout -o "${name}.ac" -fo ac -c esp -cf "${name}.esp"
parmchk2 -i "${name}.ac" -f ac -o "${name}.frcmod" -a y -w y -s 2
antechamber -i "${name}.ac" -fi ac -o "${name}.prepi" -fo prepi
antechamber -i "${name}.ac" -fi ac -o "${name}.mol2" -fo mol2
;;
esac