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.
From the repository root:
bash scripts/create_env.sh
conda deactivate && conda activate structdivdockNotes:
scripts/create_env.shcreates the conda env (if needed) and runs one-time reduce2/geostd setup for that env.- By default,
geostdis cloned to./geostdin the repository root and ignored by Git. - To use a custom location, set
STRUCTDIVDOCK_GEOSTD_DIRbefore running bootstrap.
export STRUCTDIVDOCK_GEOSTD_DIR="$HOME/data/geostd"
bash scripts/create_env.shto 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=Trueafter 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 4Use 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.
structdivdock download \
--pdb-ids 1ABC 2DEF 3GHI \
--out-dir data/pdb \
--format pdbCreate 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,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.csvstructdivdock select \
--matrix-csv results/pocket_rmsd_matrix.csv \
--threshold 1.5 \
--clusters-out results/structure_clusters.csv \
--representatives-out results/representatives.csvthreshold is in angstroms and controls clustering granularity.
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_posesstructdivdock compare \
--scores-csv results/docking_scores.csv \
--summary-out results/docking_score_summary.csvThe summary reports mean/std/min/max affinities per ligand and the spread (max - min), which is a simple measure of structure sensitivity.
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/figuresEquivalent 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- Heatmap of
results/pocket_rmsd_matrix.csv. - Dendrogram + cluster representatives.
- Bar/box plots of docking scores per ligand across structures.
- 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.