A pipeline for rescoring OpenBind compounds generated from placed Fragmenstein merges or Syndirella elaborations via BulkDock, using GNINA for structure minimization and rescoring.
The pipeline groups ligands by reference protein structure, runs GNINA minimization, and aggregates rescoring outputs into summary tables for downstream analysis.
The standard pipeline has the following steps:
- Loads ligands from an input SDF
- Groups ligands by their
ref_pdbproperty - Perform a rescore on the exact input pose
- Runs GNINA minimization and rescoring per reference structure
- Aggregates GNINA outputs into a CSV summary
- Produces a brief overview of basic data metrics
Input data typically originates from other tools frequently used at the OpenBind project:
This pipeline depends on GNINA for minimization and rescoring.
- GNINA is not distributed with this repository
- GNINA v1.3.2 is recommended for reproducibility
- The executable is expected at:
gnina/gnina
Installation, troubleshooting, and optional Singularity/Apptainer runtime environment instructions are provided in gnina/README.md.
- RDKit
- pandas
A typical conda environment:
conda create -n openbind-rescore python=3.10 rdkit pandas
conda activate openbind-rescore
Ligands are provided as an SDF file and should include:
ref_pdb: reference PDB identifier (matching the PDB filename stem)- Optional metadata from Fragmenstein, BulkDock, or HIPPO
- GNINA output fields are added during minimization and rescoring
Ligands without a valid ref_pdb are skipped.
Reference protein structures may be supplied as either:
- a directory containing
.pdbfiles, or - a
.ziparchive containing.pdbfiles
The ref_pdb ligand property must match the reference PDB filename stem.
Basic usage:
python gnina_rescore.py --input_ligands ligands.sdf --ref_pdbs reference_pdbs/ --output_path results/
Optional arguments include:
--cpu_cores: Number of parallel GNINA subprocesses (default: 1)--seed: Random seed for reproducibility (default: 42)--only_acceptable: Only keep ligands withfragmenstein_outcome == acceptable--gnina_path: Path to GNINA executable--device: CUDA device ID to use (e.g.0)--no_gpu/--cpu_only: Force CPU-only execution--cnn_model: One or more GNINA CNN model.ptfiles (ensemble rescoring supported)--cnn_scoring: CNN scoring mode (rescoreorrefinement, default:rescore)--score_only: Only score poses (GNINA--score_only, no minimization)--no_prescore: Skip prescoring; minimize and score only the minimized pose--no_csv: Do not write the CSV summary file--no_log: Do not write GNINA log files
The pipeline supports three GNINA workflows, controlled by command-line flags:
This is the default behavior when no mode flags are provided.
- GNINA first scores the input pose (
--score_only) - Ligands are then minimized
- The minimized pose is rescored
Scores from the initial pose are retained with a _pre suffix in the output.
- Runs GNINA scoring on the input pose only
- No minimization is performed
- Useful for fast rescoring of pre-aligned or fixed poses
- Skips scoring of the input pose
- Ligands are minimized directly
- Only the minimized pose is scored
results/
+-- grouped_sdf/ # Ligands grouped by reference PDB
+-- output_sdfs/ # GNINA output SDFs
+-- logs/ # GNINA log files (unless --no_log)
+-- output_ligand_summary.csv # Per-ligand scores and metadata
+-- rescore_analysis_summary.txt
minimized_ligand_summary.csv: per-ligand GNINA scores and propertiesminimized_analysis_summary.txt: basic aggregate metrics
- Ligands without a valid
ref_pdbare skipped - Ligands referencing missing PDBs are skipped
- GNINA failures are logged but do not halt the pipeline
- Intended for rescoring and minimization after placement, not docking