thanks for suggestion.

I've tried to use loadDir with the pdb's subset where each file had name like 001.pdb 002.pdb ... 055.pdb but when the sotring have been still wrong :(

also is loadDir script I found block

        for c in glob( g ):
                if ( group != None ):
               group, basename(c).split(".")[0], "add" )

what should I change here to sort files correctly?


2013/4/2 Pete Meyer <>
Hi James,

Assuming your going from the pymol wiki loadDir script; you'd need to change glob(c) loop (sort the list in your preferred order before the loop, rather than using the result list unmodified).

If I'm understanding your problem correctly (numbered pdb files being loaded as 1.pdb, 100.pdb, 2.pdb ... instead of 1.pdb, 2.pdb, ... 100.pdb) it might be easier rename your pdb files so that the default string sorting from glob matches the numerical order you want.  Using the same example, the filenames would change to 001.pdb, 002.pdb, ... 100.pdb.


James Starlight wrote:
Dear PyMol users!

I've forced with the problem of the loading of the my structural ensemble
(pdb files of the protein listed as 1.pdb 2.pdb 3.pdb ..;. 100.pdb) into
pymol via loadDir.pml script. In particular after loading of my ensemble in
the right contex pymol's window I want to preserve structural order
according to the pdb's names ( so that structures were listed in order from
1 to the 100.pdbs but not in the random (mixed) order). What additions to
the loadDir script should I do to make such ordering ?



Own the Future-Intel(R) Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest. Compete for recognition, cash, and the chance to get your game on Steam. $5K grand prize plus 10 genre and skill prizes. Submit your demo by 6/6/13.


PyMOL-users mailing list (
Info Page: