forked from isayevlab/AIMNet2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aimnet2_docker_run
executable file
·49 lines (41 loc) · 1.25 KB
/
aimnet2_docker_run
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
#!/bin/bash
# Script to simplify the usage of the 'docker run' command for AIMNet
# Example:
# > bash aimnet2 input.sdf --charge 0 --model aimnet2_b973c_ens.jpt
# Function to show usage
usage() {
echo "Usage: $0 input_file [--charge <charge>] [--model <model_file>]"
exit 1
}
# Check if at least one argument is provided
[ $# -lt 1 ] && usage
# Default values for optional arguments
charge=0
model_name="aimnet2_wb97m-d3_ens.jpt"
input_file_set=false
# Process command line arguments
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
--charge)
charge="$2"
shift 2
;;
--model_name)
model_name="$2"
shift 2
;;
*)
if [ "$input_file_set" = false ]; then
input_file="$1"
input_file_set=true
fi
shift
;;
esac
done
# Run Docker command, mount data directory into container
aimnet2_path=$(dirname "$(realpath "$BASH_SOURCE")")
data_dir=$(dirname "$(realpath "$input_file")")
input_file=$(basename "$input_file")
docker run -it --rm -v $aimnet2_path:/app/ -v $data_dir:/data aimnet-box models/$model_name /data/$input_file /data/output.xyz --charge "$charge" --traj /data/output.traj