Global Matching Sphere Optimization

From DISI
Revision as of 22:18, 17 April 2026 by Iamkaant (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Goal

To optimize your matching sphere (MS) setups getting faster docking and more high-scoring ligands with fewer spheres.

Description

The program performs optimization of matching spheres by pruning and stochastic optimization. It selects spheres from two sets:

  • heavy atoms of xtal-lig
  • spheres prepared by SPHGEN program

Juggler generates an initial MS set consisting of 100 spheres (maximum in DOCK 3.8). This set is used for retrospective docking, and then KDTree algorithm is used to prune the set to the required number of spheres by discarding all spheres that were not used in generation of the poses of the known binders ("actives"). This procedure is repeated to account for any differences in matching produced by reducing the MS set.

After this, the resulting set is transferred to the stepwise optimization procedure which conducts random perturbations of the sphere sets. Retrospective docking is done for each set, and sets are ranked by the

  • enrichment (normalized logAUC, see Ian's paper),
  • the average score of the top 1% of ligands.

The program consists of two main modules:

  • a Python script (juggler.py) that performs MS generation, optimization, and ranking.
  • a Bash script (rundockd.sh), that watches created directory structure, runs docking and processes docking results.

Setup & Running

Setup

Dependencies:

Preparation

What you need to prepare:

  • dockfiles directory with any tools of your liking (blastermaster, dockopt etc).
  • rec.crg.pdb
  • xtal-lig.pdb: To get RMSD of xtal-lig docked poses to the experimental pose, your xtal-lig.pdb must have correct bond orders and atom valences. You can edit it in Schrodinger and save as xtal-lig.pdb.
  • ligands.names
  • decoys.names
  • sdi file with the paths to ligand .tgz files.

Prepare juggler_config.yml file. Put the config into an empty directory.

################################################
# Paths for your target
receptor_file_path: "/test/rec.crg.pdb"
xtal_lig_file_path: "/test/xtal-lig.pdb"
dock_files_dir_path: "/test/dockfiles"
lig_names_file_path: "/test/ligands.names"
dec_names_file_path: "/test/decoys.names"
sdi_file_path: "test/ligands_sdi"

################################################
# Executables and running
dockbase: "/path/to/DOCK"
dock64_bin: "path/to/dock64"
subdock_bash_file_path: "/path/to/subdock.bash"
queue_type: "sge" # "slurm" or "sge"

###############################################
# Max and min number of spheres
min_sph: 4 # min is 4
max_sph: 10 # max is 100

The dock64_bin parameter is optional; if absent, {dockbase}/docking/DOCK/bin/dock64 will be used.

Running

You can either:

  • Enter a screen environment so your run is not interrupted if you disconnect your SSH session, or
  • Run Juggler using a queuing system. See example files for the slurm and sge below.

In both cases you need to launch Juggler and the docking daemon simultaneously.

In a screen

source /path/to/python/env
# or
conda activate pydock3
# rundockd should run in the background to manage docking jobs
sh rundockd.sh 2>&1 > rundockd.log &
python juggler.py 2>&1 > juggler.log

Via a queue

SGE
#! /bin/bash
#$ -cwd
#$ -q long.q
#$ -o stdout_juggler
#$ -e stdout_juggler
#$ -l s_rt=72:58:00
#$ -l h_rt=73:00:00
#$ -l mem_free=10G
#$ -pe smp 2
source /path/to/pydock3/env.sh
# or conda activate pydock3
sh /path/to/juggler/rundockd.sh 2>&1 > rundockd.log &
python /path/to/juggler/juggler.py 2>&1 > juggler.log
SLURM
#! /bin/bash
#$ -cwd
#$ -q long.q
#$ -o stdout_juggler
#$ -e stdout_juggler
#$ -l s_rt=23:58:00
#$ -l h_rt=24:00:00
#$ -l mem_free=10G
source /path/to/pydock3/env.sh
# or conda activate pydock3
sh /path/to/juggler/rundockd.sh 2>&1 > rundockd.log &
python /path/to/juggler/juggler.py 2>&1 > juggler.log

Processing results

At the end of a run you will get a message that convergence was reached. You will see the directory best_set that contains dockfiles and docking results for the best matching sphere set found. This directory is updated at each step, so if the run fails or convergence is not reached, you can still access the optimal set.

Other output files:

  • stepwise_opt_best_sets.dat — lists the IDs and the nlogAUC values for the best set in each stepwise optimization round.
  • stepwise_opt_metrics.dat — lists IDs, nlogAUC, RMSD and average scores for the top 1% ligands for all sets tested during the stepwise optimization.
  • optional: juggler.log or stdout — contains the log of the run.

For BKS lab users

Gimel

Juggler is in /mnt/nfs/exa/work/ak87/UCSF/JUGGLER/SCRIPTS/JUGGLER

Subdock is in /mnt/nfs/exa/work/ak87/PROGRAM/SUBDOCK/SUBDOCK

You can use this file to submit to SLURM queue

#! /bin/bash
#$ -cwd
#$ -q long.q
#$ -o stdout_juggler
#$ -e stdout_juggler
#$ -l s_rt=23:58:00
#$ -l h_rt=24:00:00
#$ -l mem_free=10G
source /nfs/soft/ian/python3.8.5.sh
sh /mnt/nfs/exa/work/ak87/UCSF/JUGGLER/SCRIPTS/JUGGLER/rundockd.sh 2>&1 > rundockd.log & #/dev/null &
python /mnt/nfs/exa/work/ak87/UCSF/JUGGLER/SCRIPTS/JUGGLER/juggler.py 2>&1 > orbebb.log

Wynton

Juggler is in /wynton/group/bks/work/ak87/UCSF/JUGGLER/SCRIPTS/JUGGLER

Subdock is in /wynton/group/bks/work/ak87/UCSF/JUGGLER/SCRIPTS/SUBDOCK

You can use this file to submit to SLURM queue

#! /bin/bash
#$ -cwd
#$ -q long.q
#$ -o stdout_juggler
#$ -e stdout_juggler
#$ -l s_rt=72:58:00
#$ -l h_rt=73:00:00
#$ -l mem_free=10G
#$ -pe smp 2
source /wynton/group/bks/soft/python_envs/env.sh
sh /wynton/group/bks/work/ak87/UCSF/JUGGLER/SCRIPTS/JUGGLER/rundockd.sh 2>&1 > rundockd.log & #/dev/null &
python /wynton/group/bks/work/ak87/UCSF/JUGGLER/SCRIPTS/JUGGLER/juggler.py 2>&1 > orbebb.log