Normally I don't announce new scripts to the PyMOLWiki, but I just
finished one small utility script I find very useful. I hope someone
out there can benefit from it too.
The script, loadDir, loads ALL the files (you specify the type) in a
directory (you provide the path). It can also group them all, helping
keep your data organized in PyMOL.
The script can be downloaded from the PyMOLWiki:
If you're interested, here are some details:
On startup you can issue something like,
and PyMOL will load all the PDB files in dataDir. But, once in PyMOL
it's more difficult and involves some Python scripting (which I just
finished). Here's some example uses:
(1) Load all PDBs in the current directory
loadDir ., *.pdb
The defaults are to load all pdbs from ".", so the above can also be
(2) Load all the SD files in /tmp.
# all 4 do the same thing; gives you flexibility
loadDir /tmp, sdf
loadDir /tmp, .sdf
loadDir /tmp, *.sdf
loadDir /tmp, fileName.sdf
(3) Let's say you have a directory tree like:
# - classA
# - classB
# - classE
# - classF
# - classC
We can load all the files in the subdirs of receptors and group them
into one group called "rec"
loadDir receptors/*, *.pdb, group=rec
Likewise we can load classC by name or glob into the group "nonBind"
# these two commands do the same thing, in this example
loadDir nonBinders/*, *.pdb, group=nonBind
loadDir nonBinders/classC, *.pdb, group=nonBind
Jason Vertrees, PhD
Dartmouth College : jv@...
Boston University : jasonv@...
PyMOLWiki : http://www.pymolwiki.org/