Advanced Usage
Run Inference With a Bash Script
This example uses a bash script to run inference from two local files and write the generated poses to the output folder.
- Create a file named
diffdock.shin the same folder and 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 supports batch docking, which docks a group of ligand molecules against the same protein receptor in one inference request when you submit a multi-molecule SDF file. Batch docking is more efficient than separate inference requests. The example docks one protein PDB file against five ligand SDF files from the RCSB.
- 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.
Run Batch Docking With SMILES
Besides the SDF format for ligand molecules, DiffDock also supports 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 run 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.