<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.pymol.org/index.php?action=history&amp;feed=atom&amp;title=LoadDir</id>
	<title>LoadDir - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.pymol.org/index.php?action=history&amp;feed=atom&amp;title=LoadDir"/>
	<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=LoadDir&amp;action=history"/>
	<updated>2026-05-10T22:16:13Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=LoadDir&amp;diff=13909&amp;oldid=prev</id>
		<title>Cchem: 13 revisions</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=LoadDir&amp;diff=13909&amp;oldid=prev"/>
		<updated>2017-03-06T06:13:45Z</updated>

		<summary type="html">&lt;p&gt;13 revisions&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 06:13, 6 March 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Cchem</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=LoadDir&amp;diff=13908&amp;oldid=prev</id>
		<title>Speleo3: loadall</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=LoadDir&amp;diff=13908&amp;oldid=prev"/>
		<updated>2017-03-02T15:15:24Z</updated>

		<summary type="html">&lt;p&gt;loadall&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&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 15:15, 2 March 2017&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-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&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: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;== Overview == &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&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;Load all files of the suffix '''suff''' from the directory '''dirName''', where '''suff''' and '''dirName''' are function parameters.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&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;Load all files of the suffix '''suff''' from the directory '''dirName''', where '''suff''' and '''dirName''' are function parameters.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&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;&gt; &lt;/td&gt;&lt;td class='diff-marker'&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;''This script is superseded by the [[loadall]] command, which was added in PyMOL 1.7.2.''&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&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;/td&gt;&lt;td class='diff-marker'&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;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&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;== Install ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&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;== Install ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Speleo3</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=LoadDir&amp;diff=7845&amp;oldid=prev</id>
		<title>Pyadmin: 1 revision</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=LoadDir&amp;diff=7845&amp;oldid=prev"/>
		<updated>2014-03-28T02:16:18Z</updated>

		<summary type="html">&lt;p&gt;1 revision&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:16, 28 March 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Pyadmin</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=LoadDir&amp;diff=7844&amp;oldid=prev</id>
		<title>Newacct at 08:05, 27 November 2009</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=LoadDir&amp;diff=7844&amp;oldid=prev"/>
		<updated>2009-11-27T08:05:39Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Overview == &lt;br /&gt;
Load all files of the suffix '''suff''' from the directory '''dirName''', where '''suff''' and '''dirName''' are function parameters.&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
# copy the source below to the a file called &amp;quot;loadDir.pml&amp;quot; somewhere on your computer&lt;br /&gt;
# load the file with &amp;quot;run /your/path/toLoadDir/loadDir.pml&amp;quot;&lt;br /&gt;
# run loadDir.  See examples below.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# load the script&lt;br /&gt;
run ~/loadDir.pml&lt;br /&gt;
&lt;br /&gt;
# load all SD files from /tmp&lt;br /&gt;
loadDir /tmp, sdf&lt;br /&gt;
loadDir /tmp, .sdf&lt;br /&gt;
loadDir /tmp, *.sdf&lt;br /&gt;
# even stupid stuff works; hopefully as one would want.&lt;br /&gt;
# load all PDBs from /tmp&lt;br /&gt;
loadDir /tmp, foo.woo.pdb&lt;br /&gt;
&lt;br /&gt;
# load all the PDBs in all the directories under ./binders/ERK&lt;br /&gt;
loadDir ./binders/ERK/*, .pdb&lt;br /&gt;
&lt;br /&gt;
# load the PDBs into groups: now we can load all the files in the tree under&lt;br /&gt;
# ./ERK into the group &amp;quot;ERK&amp;quot; and the files from ./SYK into the group &amp;quot;SYK&amp;quot;&lt;br /&gt;
loadDir ./binders/ERK/*, .pdb, group=ERKb&lt;br /&gt;
loadDir ./binders/SYK/*, .pdb, group=SYKb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Code ==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from glob import glob&lt;br /&gt;
from os.path import sep, basename&lt;br /&gt;
&lt;br /&gt;
def loadDir(dirName=&amp;quot;.&amp;quot;, suff=&amp;quot;pdb&amp;quot;, group=None):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        Loads all files with the suffix suff (the input parameter) from the directory dirName).&lt;br /&gt;
&lt;br /&gt;
        dirName:        directory path&lt;br /&gt;
        suff:           file suffix.  Should be simply &amp;quot;pdb&amp;quot; or &amp;quot;sdf&amp;quot; or similar.  Will accept the&lt;br /&gt;
                        wildcard and dot in case the user doesn't read this.  So, &amp;quot;*.pdb&amp;quot;, &amp;quot;.pdb&amp;quot;,&lt;br /&gt;
                        and &amp;quot;pdb&amp;quot; should work.  The suffix can be anything valid that PyMOL knows&lt;br /&gt;
                        how to natively load.&lt;br /&gt;
        group:          groupName to add the files to.&lt;br /&gt;
&lt;br /&gt;
        example:&lt;br /&gt;
                # load all the PDBs in the current directory&lt;br /&gt;
                loadDir&lt;br /&gt;
&lt;br /&gt;
                # load all SD files from /tmp&lt;br /&gt;
                loadDir /tmp, &amp;quot;sdf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        notes:&lt;br /&gt;
                make sure you call this script w/o quotes around your parameters:&lt;br /&gt;
                        loadDir ., .pdb&lt;br /&gt;
                as opposed to&lt;br /&gt;
                        loadDir &amp;quot;.&amp;quot;, &amp;quot;*.pdb&amp;quot;&lt;br /&gt;
                Use the former.&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        g = dirName + sep + &amp;quot;*.&amp;quot; + suff.split(&amp;quot;.&amp;quot;)[-1]&lt;br /&gt;
&lt;br /&gt;
        for c in glob( g ):&lt;br /&gt;
                cmd.load(c)&lt;br /&gt;
&lt;br /&gt;
                if ( group != None ):&lt;br /&gt;
                        cmd.group( group, basename(c).split(&amp;quot;.&amp;quot;)[0], &amp;quot;add&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
cmd.extend(&amp;quot;loadDir&amp;quot;, loadDir)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Script_Library|LoadDir]]&lt;br /&gt;
[[Category:System_Scripts]]&lt;/div&gt;</summary>
		<author><name>Newacct</name></author>
	</entry>
</feed>