<?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=Model_ensemble_setup</id>
	<title>Model ensemble setup - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.docking.org/index.php?action=history&amp;feed=atom&amp;title=Model_ensemble_setup"/>
	<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Model_ensemble_setup&amp;action=history"/>
	<updated>2026-05-05T20:20:00Z</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=Model_ensemble_setup&amp;diff=15806&amp;oldid=prev</id>
		<title>Frodo: asdf</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Model_ensemble_setup&amp;diff=15806&amp;oldid=prev"/>
		<updated>2024-05-02T18:29:59Z</updated>

		<summary type="html">&lt;p&gt;asdf&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:29, 2 May 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l142&quot;&gt;Line 142:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 142:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Note that as written, the first script takes a list of &amp;#039;&amp;#039;model files&amp;#039;&amp;#039; as input (i.e. &amp;quot;model1.pdb&amp;quot;, etc) and the second takes a list of &amp;#039;&amp;#039;directory names&amp;#039;&amp;#039;, which are by default the names of the models (&amp;quot;model1&amp;quot;, etc). This is because you may want to run the analysis over only a subset of models, or over an ensemble generated by a different method, etc.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Note that as written, the first script takes a list of &amp;#039;&amp;#039;model files&amp;#039;&amp;#039; as input (i.e. &amp;quot;model1.pdb&amp;quot;, etc) and the second takes a list of &amp;#039;&amp;#039;directory names&amp;#039;&amp;#039;, which are by default the names of the models (&amp;quot;model1&amp;quot;, etc). This is because you may want to run the analysis over only a subset of models, or over an ensemble generated by a different method, etc.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:DOCK]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Tutorials]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wikidb:diff::1.12:old-10127:rev-15806 --&gt;
&lt;/table&gt;</summary>
		<author><name>Frodo</name></author>
	</entry>
	<entry>
		<id>http://wiki.docking.org/index.php?title=Model_ensemble_setup&amp;diff=10127&amp;oldid=prev</id>
		<title>Kstafford: model ensemble scripts, since this came up today</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=Model_ensemble_setup&amp;diff=10127&amp;oldid=prev"/>
		<updated>2017-06-02T20:50:36Z</updated>

		<summary type="html">&lt;p&gt;model ensemble scripts, since this came up today&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This is a really simple script to facilitate automated setup and docking for an ensemble of models. It is intended to be used to screen a set of models for which performs best at enriching known ligands from a relatively small set of decoys/inactives (e.g. the Roth lab collection). It submits a series of jobs for each model in an input list and then submits a predefined docking job for each model after it has been prepared using blastermaster. This means that it requires each of the nodes in the first set of jobs (blastermaster, etc.) to in turn act as a submit host for the second set (docking). It should &amp;#039;&amp;#039;not&amp;#039;&amp;#039; be used for large screens.&lt;br /&gt;
&lt;br /&gt;
Copied from /nfs/home/kstafford/scripts/model_ensemble_setup.py: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#! /usr/bin/env python&lt;br /&gt;
&lt;br /&gt;
import os, sys&lt;br /&gt;
&lt;br /&gt;
def model_ensemble_setup(modellist,xtal,dirstring):&lt;br /&gt;
	f = open(modellist)&lt;br /&gt;
	g = f.readlines()&lt;br /&gt;
	f.close()&lt;br /&gt;
&lt;br /&gt;
	pwd = os.getcwd()&lt;br /&gt;
	dirlist = []&lt;br /&gt;
&lt;br /&gt;
	for i in range(0,len(g)):&lt;br /&gt;
		m = g[i].strip().split(&amp;#039;.pdb&amp;#039;)[0]&lt;br /&gt;
		print m&lt;br /&gt;
		if not os.path.exists(m):&lt;br /&gt;
			os.mkdir(m)&lt;br /&gt;
	&lt;br /&gt;
		os.chdir(m)&lt;br /&gt;
		os.system(&amp;#039;ln -s ../%s m.pdb&amp;#039; % g[i].strip())&lt;br /&gt;
		os.system(&amp;#039;ln -s %s xtal-lig.pdb&amp;#039; % xtal.strip())&lt;br /&gt;
&lt;br /&gt;
		# simple, obvious way to build dirlist&lt;br /&gt;
		dirlist.append(m+&amp;#039;\n&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
		os.chdir(pwd)&lt;br /&gt;
&lt;br /&gt;
	f = open(&amp;#039;dirlist&amp;#039;,&amp;#039;w+&amp;#039;)&lt;br /&gt;
	f.writelines(dirlist)&lt;br /&gt;
	f.close()&lt;br /&gt;
&lt;br /&gt;
	runtext = &amp;#039;&amp;#039;&amp;#039;#$ -S /bin/csh&lt;br /&gt;
#$ -cwd&lt;br /&gt;
#$ -j yes&lt;br /&gt;
#$ -o test.out&lt;br /&gt;
#$ -e test.err&lt;br /&gt;
#$ -q all.q&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;Starting dock in directory: $PWD&amp;quot;&lt;br /&gt;
set dirarray=`cat dirlist`&lt;br /&gt;
set pth=$dirarray[$SGE_TASK_ID]&lt;br /&gt;
cd $pth&lt;br /&gt;
echo $pth&lt;br /&gt;
&lt;br /&gt;
$DOCKBASE/bin/blastermaster -v&lt;br /&gt;
$DOCKBASE/bin/setup_db2_lots 20 d &amp;quot;%s&amp;quot;&lt;br /&gt;
$DOCKBASE/bin/submit_dock &lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039; % dirstring&lt;br /&gt;
&lt;br /&gt;
	f = open(&amp;#039;run_all_models.csh&amp;#039;,&amp;#039;w+&amp;#039;)&lt;br /&gt;
	f.write(runtext)&lt;br /&gt;
	f.close()&lt;br /&gt;
&lt;br /&gt;
#	os.system(&amp;#039;qsub -t 1-%d run_all_models.csh&amp;#039; % len(g))&lt;br /&gt;
&lt;br /&gt;
	return&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	if len(sys.argv) != 4:&lt;br /&gt;
		print &amp;quot;Usage: [file containing a list of models] [full path to xtal-lig] [directory search pa&lt;br /&gt;
th to db2 files]&amp;quot;&lt;br /&gt;
	else:&lt;br /&gt;
		model_ensemble_setup(sys.argv[1],sys.argv[2],sys.argv[3])&lt;br /&gt;
	sys.exit()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the docking is done, you can parallelize the usual analysis steps like so:&lt;br /&gt;
&lt;br /&gt;
Copied from /nfs/home/kstafford/scripts/run_analysis.py:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#! /usr/bin/env python&lt;br /&gt;
&lt;br /&gt;
import os,sys&lt;br /&gt;
&lt;br /&gt;
def run_analysis(dirlist,liglist,decoylist):&lt;br /&gt;
&lt;br /&gt;
	if not os.path.exists(liglist):&lt;br /&gt;
		print &amp;quot;Ligand ID file %s doesn&amp;#039;t exist&amp;quot; % liglist&lt;br /&gt;
		return&lt;br /&gt;
	if not os.path.exists(decoylist):&lt;br /&gt;
		print &amp;quot;Decoy ID file %s doesn&amp;#039;t exist&amp;quot; % decoylist&lt;br /&gt;
		return&lt;br /&gt;
	if not os.path.exists(dirlist):&lt;br /&gt;
		print &amp;quot;Directory list %s doesn&amp;#039;t exist&amp;quot; % dirlist&lt;br /&gt;
&lt;br /&gt;
	submit_text = &amp;#039;&amp;#039;&amp;#039;#$ -S /bin/csh&lt;br /&gt;
#$ -cwd&lt;br /&gt;
#$ -j yes&lt;br /&gt;
#$ -o test.out&lt;br /&gt;
#$ -e test.err&lt;br /&gt;
#$ -q all.q&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;Starting dock in directory: $PWD&amp;quot;&lt;br /&gt;
set dirarray=`cat %s`&lt;br /&gt;
set pth=$dirarray[$SGE_TASK_ID]&lt;br /&gt;
cd $pth&lt;br /&gt;
echo $pth&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$DOCKBASE/analysis/extract_all.py&lt;br /&gt;
$DOCKBASE/analysis/enrich.py -l %s -d %s&lt;br /&gt;
$DOCKBASE/analysis/getposes.py&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;started task&amp;quot;&lt;br /&gt;
echo $SGE_TASK_ID&lt;br /&gt;
&lt;br /&gt;
exit $status&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039; % (dirlist,liglist,decoylist)&lt;br /&gt;
&lt;br /&gt;
	f = open(dirlist)&lt;br /&gt;
	dirs = f.readlines()&lt;br /&gt;
	f.close()&lt;br /&gt;
	ndirs = len(dirs)	&lt;br /&gt;
&lt;br /&gt;
	f = open(&amp;#039;run_analysis.csh&amp;#039;,&amp;#039;w+&amp;#039;)&lt;br /&gt;
	print &amp;gt;&amp;gt;f, submit_text&lt;br /&gt;
	f.close()&lt;br /&gt;
&lt;br /&gt;
	os.system(&amp;#039;qsub -t 1-%d run_analysis.csh&amp;#039; % ndirs)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	return&lt;br /&gt;
	&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	if len(sys.argv) != 4:&lt;br /&gt;
		print &amp;quot;Usage: [directory list] [ligand ID list] [decoy ID list]&amp;quot;&lt;br /&gt;
	else:&lt;br /&gt;
		run_analysis(sys.argv[1],sys.argv[2],sys.argv[3])&lt;br /&gt;
	sys.exit()&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that as written, the first script takes a list of &amp;#039;&amp;#039;model files&amp;#039;&amp;#039; as input (i.e. &amp;quot;model1.pdb&amp;quot;, etc) and the second takes a list of &amp;#039;&amp;#039;directory names&amp;#039;&amp;#039;, which are by default the names of the models (&amp;quot;model1&amp;quot;, etc). This is because you may want to run the analysis over only a subset of models, or over an ensemble generated by a different method, etc.&lt;/div&gt;</summary>
		<author><name>Kstafford</name></author>
	</entry>
</feed>