<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.docking.org/index.php?action=history&amp;feed=atom&amp;title=Juggler</id>
	<title>Juggler - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.docking.org/index.php?action=history&amp;feed=atom&amp;title=Juggler"/>
	<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Juggler&amp;action=history"/>
	<updated>2026-04-08T05:17:08Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.1</generator>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Juggler&amp;diff=16974&amp;oldid=prev</id>
		<title>Iamkaant: first draft</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Juggler&amp;diff=16974&amp;oldid=prev"/>
		<updated>2025-10-31T22:21:46Z</updated>

		<summary type="html">&lt;p&gt;first draft&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
== Goal ==&lt;br /&gt;
To optimize your matching sphere (MS) setups getting faster docking and more high-scoring ligands with fewer spheres.&lt;br /&gt;
== Description ==&lt;br /&gt;
The program performs optimization of matching spheres by pruning and stochastic optimization. It selects spheres from two sets:&lt;br /&gt;
* heavy atoms of xtal-lig &lt;br /&gt;
* spheres prepared by SPHGEN program&lt;br /&gt;
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.  &lt;br /&gt;
&lt;br /&gt;
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 &lt;br /&gt;
&lt;br /&gt;
* enrichment (normalized logAUC, see [http://arxiv.org/abs/2210.10905 Ian&amp;#039;s paper]),&lt;br /&gt;
* the average score of the top 1% of ligands.&lt;br /&gt;
&lt;br /&gt;
The program consists of two main modules:&lt;br /&gt;
* a Python script (&amp;lt;code&amp;gt;juggler.py&amp;lt;/code&amp;gt;) that performs MS generation, optimization, and ranking.&lt;br /&gt;
* a Bash script (&amp;lt;code&amp;gt;rundockd.sh&amp;lt;/code&amp;gt;), that watches created directory structure, runs docking and processes docking results&lt;br /&gt;
== Setup &amp;amp; Running ==&lt;br /&gt;
=== Setup ===&lt;br /&gt;
Dependencies: rdkit, [https://github.com/docking-org/pydock3 pydock], [https://github.com/docking-org/SUBDOCK subdock].&lt;br /&gt;
&lt;br /&gt;
=== Preparation ===&lt;br /&gt;
What you need to prepare:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; directory with any tools of your liking (blastermaster, dockopt etc).&lt;br /&gt;
* &amp;lt;code&amp;gt;rec.crg.pdb&amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;xtal-lig.pdb&amp;lt;/code&amp;gt;:  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 &amp;lt;code&amp;gt;xtal-lig.pdb&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ligands.names&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;decoys.names&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;sdi&amp;lt;/code&amp;gt; file with the paths to ligand .tgz files..&lt;br /&gt;
&lt;br /&gt;
Prepare &amp;lt;code&amp;gt;juggler_config.yml&amp;lt;/code&amp;gt; file. Put the config into an empty directory.&amp;lt;syntaxhighlight lang=&amp;quot;yaml&amp;quot;&amp;gt;&lt;br /&gt;
################################################&lt;br /&gt;
# Paths for your target&lt;br /&gt;
rec_crg_file_path: &amp;quot;/test/rec.crg.pdb&amp;quot;&lt;br /&gt;
xtal_lig_file_path: &amp;quot;/test/xtal-lig.pdb&amp;quot;&lt;br /&gt;
dock_files_dir_path: &amp;quot;/test/dockfiles&amp;quot;&lt;br /&gt;
lig_names_file_path: &amp;quot;/test/ligands.names&amp;quot;&lt;br /&gt;
dec_names_file_path: &amp;quot;/test/decoys.names&amp;quot;&lt;br /&gt;
sdi_file_path: &amp;quot;test/ligands_sdi&amp;quot;&lt;br /&gt;
&lt;br /&gt;
################################################&lt;br /&gt;
# Executables and running&lt;br /&gt;
dockbase: &amp;quot;/path/to/DOCK&amp;quot;&lt;br /&gt;
dock64_bin: &amp;quot;path/to/dock64&amp;quot; &lt;br /&gt;
subdock_bash_file_path: &amp;quot;/path/to/subdock.bash&amp;quot;&lt;br /&gt;
queue_type: &amp;quot;sge&amp;quot; # &amp;quot;slurm&amp;quot; or &amp;quot;sge&amp;quot;&lt;br /&gt;
&lt;br /&gt;
###############################################&lt;br /&gt;
# Max and min number of spheres&lt;br /&gt;
min_sph: 4 # min is 4&lt;br /&gt;
max_sph: 10 # max is 100&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;code&amp;gt;dock64_bin&amp;lt;/code&amp;gt; parameter is optional, if this parameter is absent, &amp;lt;code&amp;gt;{dockbase}/docking/DOCK/bin/dock64&amp;lt;/code&amp;gt; will be used.&lt;br /&gt;
&lt;br /&gt;
=== Running ===&lt;br /&gt;
You can either &lt;br /&gt;
&lt;br /&gt;
* Enter a screen environment so your run is not interrupted if you disconnect your SSH session, or&lt;br /&gt;
* run Juggler using a queuing system. See example files for the slurm and sge below.&lt;br /&gt;
&lt;br /&gt;
In both cases you need to launch Juggler and docking daemon simultaneously. &lt;br /&gt;
&lt;br /&gt;
==== In a screen ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source /path/to/python/env&lt;br /&gt;
# rundockd should run in the background to manage docking jobs&lt;br /&gt;
sh rundockd.sh 2&amp;gt;&amp;amp;1 &amp;gt; rundockd.log &amp;amp;&lt;br /&gt;
python juggler.py 2&amp;amp;&amp;gt;1 &amp;gt; juggler.log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Via a queue ====&lt;br /&gt;
&lt;br /&gt;
===== SGE (Wynton) =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#! /bin/bash&lt;br /&gt;
#$ -cwd&lt;br /&gt;
#$ -q long.q&lt;br /&gt;
#$ -o stdout_juggler&lt;br /&gt;
#$ -e stdout_juggler&lt;br /&gt;
#$ -l s_rt=72:58:00&lt;br /&gt;
#$ -l h_rt=73:00:00&lt;br /&gt;
#$ -l mem_free=10G&lt;br /&gt;
#$ -pe smp 2&lt;br /&gt;
source /wynton/group/bks/soft/python_envs/env.sh&lt;br /&gt;
sh /wynton/group/bks/work/ak87/UCSF/JUGGLER/SCRIPTS/RELEASE/rundockd.sh 2&amp;gt;&amp;amp;1 &amp;gt; rundockd.log &amp;amp; #/dev/null &amp;amp;&lt;br /&gt;
python /wynton/group/bks/work/ak87/UCSF/JUGGLER/SCRIPTS/RELEASE/juggler.py 2&amp;gt;&amp;amp;1 &amp;gt; juggler.log&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== SLURM (Gimel) =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#! /bin/bash&lt;br /&gt;
#$ -cwd&lt;br /&gt;
#$ -q long.q&lt;br /&gt;
#$ -o stdout_juggler&lt;br /&gt;
#$ -e stdout_juggler&lt;br /&gt;
#$ -l s_rt=23:58:00&lt;br /&gt;
#$ -l h_rt=24:00:00&lt;br /&gt;
#$ -l mem_free=10G&lt;br /&gt;
source /nfs/soft/ian/python3.8.5.sh&lt;br /&gt;
sh /mnt/nfs/exa/work/ak87/UCSF/JUGGLER/SCRIPTS/RELEASE/rundockd.sh 2&amp;gt;&amp;amp;1 &amp;gt; rundockd.log &amp;amp; #/dev/null &amp;amp;&lt;br /&gt;
python /mnt/nfs/exa/work/ak87/UCSF/JUGGLER/SCRIPTS/RELEASE/orbebb.py 2&amp;gt;&amp;amp;1 &amp;gt; juggler.log&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== UCSF clusters ===&lt;br /&gt;
The scripts and example config file are in&lt;br /&gt;
&lt;br /&gt;
Wynton&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/wynton/group/bks/work/ak87/UCSF/JUGGLER/SCRIPTS/RELEASE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gimel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/mnt/nfs/exa/work/ak87/UCSF/JUGGLER/SCRIPTS/RELEASE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Queue type is &amp;lt;code&amp;gt;sge&amp;lt;/code&amp;gt; for Wynton and &amp;lt;code&amp;gt;slurm&amp;lt;/code&amp;gt; for Gimel (newer machines, like gimel5/gimel2/n-1-XXX...). &lt;br /&gt;
&lt;br /&gt;
=== Processing results ===&lt;br /&gt;
At the end of a run you will get a message that convergence was reached. You will see the directory &amp;lt;code&amp;gt;best_set&amp;lt;/code&amp;gt; that contains &amp;lt;code&amp;gt;dockfiles&amp;lt;/code&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
Other files are&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;stepwise_opt_best_sets.dat&amp;lt;/code&amp;gt; lists the IDs and the nlogAUC values for the best set in each stepwise optimization round&lt;br /&gt;
* &amp;lt;code&amp;gt;stepwise_opt_metrics.dat&amp;lt;/code&amp;gt; lists IDs, nlogAUC, RMSD and average scores for the top 1% ligands for all sets tested during the stepwise optimization&lt;br /&gt;
* &amp;lt;code&amp;gt;juggler.log&amp;lt;/code&amp;gt; contains all the data for the run.&lt;/div&gt;</summary>
		<author><name>Iamkaant</name></author>
	</entry>
</feed>