Skip to content

Repository files navigation

Protein Structure Diversity Docking Baseline

This project provides a practical baseline to support a blog post on why structure selection matters for docking.

It covers:

  • Downloading candidate structures from PDB.
  • Resolving structures directly from a UniProt target ID.
  • Quantifying pocket diversity using pairwise pocket RMSD.
  • Selecting representative structures from diverse clusters (targeting 4-5 representatives).
  • Docking a ligand set across representative structures.
  • Summarizing structure-dependent differences in docking scores.
  • Generating blog-ready figures.

Install

From the repository root:

bash scripts/create_env.sh
conda deactivate && conda activate structdivdock

Notes:

  • scripts/create_env.sh creates the conda env (if needed) and runs one-time reduce2/geostd setup for that env.
  • By default, geostd is cloned to ./geostd in the repository root and ignored by Git.
  • To use a custom location, set STRUCTDIVDOCK_GEOSTD_DIR before running bootstrap.
export STRUCTDIVDOCK_GEOSTD_DIR="$HOME/data/geostd"
bash scripts/create_env.sh

to run reduce2.py (which adds hydrogens):

conda activate structdivdock
python -c "import site; print(site.getsitepackages()[0])"
# then look inside <that path>/mmtbx/command_line/reduce2.py
find "$(python -c 'import site; print(site.getsitepackages()[0])')/mmtbx/command_line" -name "reduce2.py"
REDUCE2="$(python -c "import site; print(site.getsitepackages()[0])")/mmtbx/command_line/reduce2.py"
python "$REDUCE2" 5UG8.pdb approach=add add_flip_movers=True

after having added hydrogens, one can prepare the receptor:

python ../../scripts/prepare_receptor.py \
  --receptor 5UG8FH.pdb \
  --ligand ../ligands_pdb/cand_1_KXY_A1103.pdb \
  --out receptor \
  --padding 4

Notebook: Single-input UniProt workflow

Use notebooks/uniprot_end_to_end_workflow.ipynb.

In the notebook, the main required input is:

  • UNIPROT_ID

The notebook then automates:

  • fetching available PDB structures for the target,
  • downloading and ranking structures,
  • inferring pocket residues from a co-crystallized ligand in the top-ranked structure,
  • selecting 4-5 diverse representatives,
  • extracting candidate binders from co-crystallized ligands,
  • docking across selected structures,
  • and producing summary tables and blog-ready plots.

1) Download structures from PDB

structdivdock download \
  --pdb-ids 1ABC 2DEF 3GHI \
  --out-dir data/pdb \
  --format pdb

2) Define pocket residues

Create data/pocket_residues.csv (or copy data/pocket_residues.example.csv) with residues that define the binding pocket in your reference numbering:

chain_id,resseq,icode
A,45,
A,47,
A,51,

3) Compute pocket RMSD diversity matrix

structdivdock diversity \
  --structures data/pdb/1ABC.pdb data/pdb/2DEF.pdb data/pdb/3GHI.pdb \
  --pocket-residues-csv data/pocket_residues.csv \
  --out-csv results/pocket_rmsd_matrix.csv

4) Select diverse representatives

structdivdock select \
  --matrix-csv results/pocket_rmsd_matrix.csv \
  --threshold 1.5 \
  --clusters-out results/structure_clusters.csv \
  --representatives-out results/representatives.csv

threshold is in angstroms and controls clustering granularity.

5) Dock inhibitors across selected structures

Prepare receptor and ligand PDBQT files externally (for example with MGLTools/Meeko workflows), then run:

structdivdock dock \
  --receptors data/receptors_pdbqt/1ABC.pdbqt data/receptors_pdbqt/2DEF.pdbqt \
  --ligands data/ligands_pdbqt/inhibA.pdbqt data/ligands_pdbqt/inhibB.pdbqt \
  --center 12.0 6.0 18.0 \
  --size 20.0 20.0 20.0 \
  --scores-out results/docking_scores.csv \
  --out-dir results/docked_poses

6) Compare docking variability across structures

structdivdock compare \
  --scores-csv results/docking_scores.csv \
  --summary-out results/docking_score_summary.csv

The summary reports mean/std/min/max affinities per ligand and the spread (max - min), which is a simple measure of structure sensitivity.

7) Generate blog-ready figures

structdivdock plot \
  --matrix-csv results/pocket_rmsd_matrix.csv \
  --scores-csv results/docking_scores.csv \
  --summary-csv results/docking_score_summary.csv \
  --out-dir results/figures

Equivalent script:

python scripts/make_blog_figures.py \
  --matrix-csv results/pocket_rmsd_matrix.csv \
  --scores-csv results/docking_scores.csv \
  --summary-csv results/docking_score_summary.csv \
  --out-dir results/figures

Suggested blog figures

  • Heatmap of results/pocket_rmsd_matrix.csv.
  • Dendrogram + cluster representatives.
  • Bar/box plots of docking scores per ligand across structures.

Notes

  • Pocket RMSD is based on superposition of CA atoms of user-defined pocket residues.
  • RMSD and docking scores are complementary signals; use both to justify representative selection.
  • For publication-grade results, include receptor protonation, cofactor handling, and redocking validation.

About

This repo contains a platform to verify the importance of ensemble docking in virtual screening

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages