The AutoDock Suite is a growing collection of methods for computational docking and virtual screening, for use in structure-based drug discovery and exploration of the basic mechanisms of biomolecular structure and function.
AutoDock-GPU
The AutoDock-GPU Suite is a growing collection of methods for computational docking and virtual screening, for use in structure-based drug discovery and exploration of the basic mechanisms of biomolecular structure and function. More info on AutoDock-GPU be located at https://ccsb.scripps.edu/autodock/ and official github page
See here for a document describing prerequisites and setup steps for all HPC containers and instructions for pulling NGC containers.
System requirements
Before running the NGC AutoDock-GPU container please ensure your system meets the following requirements.
- One of the following container runtimes
- nvidia-docker
- Singularity >= 3.1
x86_64
- Pascal(sm60), Volta(sm70), or Ampere (sm80) NVIDIA GPU(s)
- CUDA driver version >= r450, -or- r418, -or- r440
arm64
- Pascal(sm60), Volta(sm70), or Ampere (sm80) NVIDIA GPU(s)
- CUDA driver version >= r450
Running AutoDock-GPU
Executables
autodock_gpu_128wi: primary autodock executable
Command invocation
An example command is:
autodock_gpu_128wi -ffile protein.maps.fld -lfile rand-example.pdbqt -nrun 100 -lsmet ad -resnam CUDAout
Examples
The following examples demonstrate how to run the NGC AutoDock-GPU container under the supported runtimes.
Running with docker
Once authenticated the following modes of running are supported:
Command line execution with docker
In order to run the water benchmark: download and permission, the dataset from the AD-GPU_set_of_42.
Copy and paste the following script, called check.py into your working directory.
#!/usr/bin/env python3
import csv
import glob
import os
import re
import subprocess
import sys
def run_all(executable):
dirlist = glob.glob("data/*")
for d in dirlist:
os.chdir(d)
# There's potentially 3 runs to do here, doing 1 to save time.
for i in range(1):
subprocess.run("{} -ffile protein.maps.fld -lfile rand-{}.pdbqt -nrun 100 -lsmet ad -heuristics 1 -autostop 1 -maxnev 8000000 -resnam CUDAout-{}".format(executable, i, i), shell=True).check_returncode()
os.chdir("../..")
def process_file(filename):
re_ligandname = re.compile(r'^Ligand name: (.+)')
re_intermolecular = re.compile(r'^(?=.*\bIntermolecular\b).*=(.*)')
re_internal = re.compile(r'^(?=.*\bInternal\b).*=(.*)')
ligand = ''
curr_energy = sys.float_info.max
best_energy = sys.float_info.max
with open(filename) as f:
for line in f:
match = re_ligandname.search(line)
if match:
ligand = match.group(0).split()[2]
continue
match = re_intermolecular.search(line)
if match:
curr_energy = float(match.group(1).split()[0])
continue
match = re_internal.search(line)
if match:
curr_energy = curr_energy + float(match.group(1).split()[0])
if (curr_energy < best_energy):
best_energy = curr_energy
continue
return best_energy
def check_output(reference_energies):
results = {}
err = 0.0
cnt = 0
for key, val in reference_energies.items():
for dlgfile in glob.glob('data/*/CUDAout-*.dlg'):
best_energy = process_file(dlgfile)
diff = val - best_energy
err = err + diff
cnt = cnt + 1
try:
results[key].append(diff)
except KeyError:
results[key] = [diff]
return (err/cnt)
reference_energies = {}
with open('ligand_properties.csv') as f:
reader = csv.reader(f)
cnt = 0
for row in reader:
cnt = cnt + 1
if cnt == 1:
continue
# There are some bad ligands for which we have no reference energy
if row[4] == '':
continue
reference_energies[row[1]] = float(row[4])
for numwi in [128]:
run_all("autodock_gpu_{}wi".format(numwi))
meandiff = check_output(reference_energies)
print('{} : Mean Error: {:.3f}'.format(numwi, meandiff))
if meandiff > 0.5:
exit(1)
print("Checks passed.")
$ git clone https://github.com/diogomart/AD-GPU_set_of_42.git
$ gunzip AD-GPU_set_of_42/data/*/*map.gz
$ docker run -ti --gpus all -v :workdir --workdir /workdir nvcr.io/hpc/autodock:2020.06 sh -c "./check.py"
Example of successful AutoDock-GPU output:
AutoDock-GPU version: 09773678fc7e39677061d765b767f4bae8930fb7-dirty
CUDA Setup time 2.031275s
(Thread 0 is setting up Job 0)
Running Job #0:
Using heuristics: -lsmet sw -nev 7468504
Local-search chosen method is: swSolis-Wets (sw)
Rest of Setup time 0.037800s
Executing docking runs, stopping automatically after either reaching 0.15 kcal/mol standard deviation of
the best molecules of the last 4 * 5 generations, 27000 generations, or 7468504 evaluations:
Generations | Evaluations | Threshold | Average energy of best 10% | Samples | Best energy
------------+--------------+------------------+------------------------------+---------+-------------------
0 | 150 | -2.91 kcal/mol | -4.10 +/- 0.40 kcal/mol | 5 | -4.82 kcal/mol
5 | 125155 | -2.91 kcal/mol | -5.70 +/- 1.40 kcal/mol | 8066 | -11.91 kcal/mol
10 | 250790 | -5.69 kcal/mol | -9.55 +/- 0.83 kcal/mol | 490 | -12.35 kcal/mol
15 | 377698 | -9.53 kcal/mol | -11.80 +/- 0.42 kcal/mol | 52 | -12.62 kcal/mol
20 | 505556 | -11.68 kcal/mol | -12.42 +/- 0.18 kcal/mol | 14 | -12.67 kcal/mol
25 | 633659 | -12.23 kcal/mol | -12.48 +/- 0.19 kcal/mol | 16 | -12.74 kcal/mol
30 | 762773 | -12.30 kcal/mol | -12.59 +/- 0.14 kcal/mol | 16 | -12.83 kcal/mol
35 | 892173 | -12.46 kcal/mol | -12.73 +/- 0.15 kcal/mol | 14 | -13.02 kcal/mol
40 | 1021489 | -12.57 kcal/mol | -12.81 +/- 0.13 kcal/mol | 14 | -13.05 kcal/mol
45 | 1151059 | -12.68 kcal/mol | -12.83 +/- 0.11 kcal/mol | 19 | -13.06 kcal/mol
50 | 1280984 | -12.74 kcal/mol | -12.84 +/- 0.10 kcal/mol | 13 | -13.07 kcal/mol
Docking time 3.916151s
------------+--------------+------------------+------------------------------+---------+-------------------
Finished evaluation after reaching
-12.80 +/- 0.13 kcal/mol combined.
60 samples, best energy -13.07 kcal/mol.
Shutdown time 0.000570s
Job #0 took 3.955 sec after waiting 3.373 sec for setup
(Thread 0 is processing Job 0)
Run time of entire job set (1 files): 8.413 sec
Savings from multithreading: -2.039 sec
Idle time of execution thread: 4.458 sec
All jobs ran without errors.
Interactive shell with docker
The following command will launch an interactive shell in the AutoDock-GPU
container using docker mounting $HOME/data from the underlying
system as /data in the container:
$ docker run -it --rm --gpus all -v $HOME/data:/data --workdir /data nvcr.io/hpc/autodock:2020.06
Where:
-it: start the container with an interactive terminal (short for --interactive --tty)--rm: make container ephemeral (removes container on exit)-v $(pwd):/host_pwd: bind mount the current working directory into the container as/host_pwd--gpus all: vanilla docker GPU provisioning--workdir /data: sets working directory inside the container
This should produce a root prompt within the container:
root@3a8c8b7c3a88:/data#
Running with Singularity
Pull the image
Save the NGC AutoDock-GPU container as a local Singularity image file:
$ singularity build autodock.simg docker://nvcr.io/hpc/autodock:2020.06
The AutoDock-GPU Singularity image is now saved in the current directory as autodock.simg
Note: Singularity/2.x
In order to pull NGC images with singularity version 2.x and earlier, NGC container registry authentication credentials are required.
To set your NGC container registry authentication credentials:
$ export SINGULARITY_DOCKER_USERNAME='$oauthtoken'
$ export SINGULARITY_DOCKER_PASSWORD=
More information describing how to obtain and use your NVIDIA NGC Cloud Services API key can be found here.
Note: Singularity 3.1.x - 3.2.x
There is currently a bug in Singularity 3.1.x and 3.2.x causing the LD_LIBRARY_PATH to be incorrectly set within the container environment.
As a workaround The LD_LIBRARY_PATH must be unset before invoking Singularity:
$ LD_LIBRARY_PATH="" singularity exec ...
Command line execution
In order to run a test benchmark: download, permission, and run the example script from the NGC Examples Repository.
wget ...
chmod +x check.py
singularity run --nv -B ${PWD}:/host_pwd --pwd /host_pwd ./check.py
Example of successful AutoDock-GPU output:
AutoDock-GPU version: 09773678fc7e39677061d765b767f4bae8930fb7-dirty
CUDA Setup time 2.031275s
(Thread 0 is setting up Job 0)
Warning: unknown argument '-maxnev'.
Running Job #0:
Using heuristics: -lsmet sw -nev 7468504
Local-search chosen method is: swSolis-Wets (sw)
Rest of Setup time 0.037800s
Executing docking runs, stopping automatically after either reaching 0.15 kcal/mol standard deviation of
the best molecules of the last 4 * 5 generations, 27000 generations, or 7468504 evaluations:
Generations | Evaluations | Threshold | Average energy of best 10% | Samples | Best energy
------------+--------------+------------------+------------------------------+---------+-------------------
0 | 150 | -2.91 kcal/mol | -4.10 +/- 0.40 kcal/mol | 5 | -4.82 kcal/mol
5 | 125155 | -2.91 kcal/mol | -5.70 +/- 1.40 kcal/mol | 8066 | -11.91 kcal/mol
10 | 250790 | -5.69 kcal/mol | -9.55 +/- 0.83 kcal/mol | 490 | -12.35 kcal/mol
15 | 377698 | -9.53 kcal/mol | -11.80 +/- 0.42 kcal/mol | 52 | -12.62 kcal/mol
20 | 505556 | -11.68 kcal/mol | -12.42 +/- 0.18 kcal/mol | 14 | -12.67 kcal/mol
25 | 633659 | -12.23 kcal/mol | -12.48 +/- 0.19 kcal/mol | 16 | -12.74 kcal/mol
30 | 762773 | -12.30 kcal/mol | -12.59 +/- 0.14 kcal/mol | 16 | -12.83 kcal/mol
35 | 892173 | -12.46 kcal/mol | -12.73 +/- 0.15 kcal/mol | 14 | -13.02 kcal/mol
40 | 1021489 | -12.57 kcal/mol | -12.81 +/- 0.13 kcal/mol | 14 | -13.05 kcal/mol
45 | 1151059 | -12.68 kcal/mol | -12.83 +/- 0.11 kcal/mol | 19 | -13.06 kcal/mol
50 | 1280984 | -12.74 kcal/mol | -12.84 +/- 0.10 kcal/mol | 13 | -13.07 kcal/mol
Docking time 3.916151s
------------+--------------+------------------+------------------------------+---------+-------------------
Finished evaluation after reaching
-12.80 +/- 0.13 kcal/mol combined.
60 samples, best energy -13.07 kcal/mol.
Shutdown time 0.000570s
Job #0 took 3.955 sec after waiting 3.373 sec for setup
(Thread 0 is processing Job 0)
Run time of entire job set (1 files): 8.413 sec
Savings from multithreading: -2.039 sec
Idle time of execution thread: 4.458 sec
All jobs ran without errors.
Interactive shell
The following command will launch an interactive shell in the AutoDock-GPU
container using singularity shell:
$ singularity shell --nv -B
Where:
--nv: expose the host GPU(s) to the container-B: bind user-defined directory into the container
This should produce a Singularity shell prompt within the container:
Singularity: Invoking an interactive shell within container...
Singularity Autodock.simg:~/example>
Suggested Reading
Autodock main page Autodock wiki Autodock officional github page