Advanced Usage
Run Inference with Bash Script
In this example, we create a simple bash script to launch inference using two local files as input and dump the generated poses in the output folder.
- Create a new blank file in the same folder, name it as
diffdock.shand copy the content below into it.
- Make the script executable.
- Download the input files from RCSB database and launch the inference.
- Dump the output using the python script created in
Getting Started.
- Example of output
Run Inference for Batch-Docking
DiffDock NIM allows for a Batch-Docking mode, which docks a group of ligand molecules against the same protein receptor through a single inference request if a multi-molecule SDF file is submitted in this request. Batch-docking mode is much more efficient than running separate inference requests. The example below illustrates batch-docking using a protein PDB file with five molecule SDF files downloaded from RSCB.
- Prepare the SDF input file with multiple ligand molecules. Create a new blank file, name it as
make-multiligand.sh, and copy the content below into it.
- Run the commands below to generate the
multi_ligands.sdffor input.
- Download the protein PDB file and launch the inference.
- Dump the result and an example of output is below.
Batch-Docking using SMILES
Besides the SDF format for ligand molecules, DiffDock also support SMILES text strings as the input. DiffDock uses RDKit to generate random molecular conformers from the SMILES information. A plain text file can be used as the ligand input with multiple lines, each of which is a SMILES formula representing a molecule, to conduct batch-docking.
- Create a new blank file, name it as
ligands.txtand copy the content below into it.
- Run the commands below to invoke the DiffDock model. The script generates an input JSON file and returns the inference result in JSON format in the file
output.json.
- Dump the result and check the output folder.