Hi,
* Jeffrey N. Agar <agar@...> [2005-01-18 14:07] wrote:
>
> also, typing the following example from the users manual gives invalid
> syntax with an arrow pointing to the m in file_list =glob("mov*.pdb"):
>
> 2) The following is a Python program (with a .py or .pym extension)
> which uses a Python loop to load a large number of numbered PDB files,
> and then configures PyMOL to show them both forwards and backwards.
>
> from glob import glob
> from pymol import cmd
>
> file_list = glob("mov*.pdb"):
There should be no colon at the end of this line. I don't know if that's
what you actually typed or not.
>
> for file in file_list
> cmd.load(file,"mov")
>
> cmd.mset("1 -%d -2"%len(file_list))
>
> I obviously have no idea how to program. Sorry about that. I need canned
> commands to succeed.
I have four different loading scripts on my pymol scripts page that you
can take and modify if you wish. I "run" them at pymol startup (by
adding a line to my .pymolrc file), so that I can always type something
like:
load_models *.pdb, objname
within PyMOL. One script loads everything into a single object, one generates
individual objects, the third loads everything into a single object, but
with the discrete flag set to 1, and the fourth loads the PDB files
output by modeller, but in order from best to worst value for the
"OBJECTIVE FUNCTION".
Except for load_best.py, the models are loaded in alphabetical order, so
if you have files named:
ff0.pdb
...
ff9.pdb
ff10.pdb
ff11.pdb
...
then ff10 through ff19 would be loaded before ff2.pdb. It helps to
rename the ff0.pdb through ff9.pdb as ff00.pdb ... ff09.pdb.
Hope this helps,
Rob
--
Robert L. Campbell, Ph.D. <rlc1@...>
Senior Research Associate phone: 613-533-6821
Dept. of Biochemistry, Queen's University, fax: 613-533-2497
Kingston, ON K7L 3N6 Canada http://adelie.biochem.queensu.ca/~rlc
PGP Fingerprint: 9B49 3D3F A489 05DC B35C 8E33 F238 A8F5 F635 C0E2

Thread view

Greetings,
There are two examples that I can find for loading the multiple frames
(in my case of a morph between two structures) using a single command.
In my case the frames are ff0.pdb thru ff30.pdb. I've been trying to
substitute the my file names into the following example (from movie school).
ls morph*pdb |awk '{print ("load",$0",mov,"NR)}' > load.pml
becomes
ls ff*.pdb |awk '{print ("load",$0",mov,"NR)}' > load.pml
also, typing the following example from the users manual gives invalid
syntax with an arrow pointing to the m in file_list =glob("mov*.pdb"):
2) The following is a Python program (with a .py or .pym extension)
which uses a Python loop to load a large number of numbered PDB files,
and then configures PyMOL to show them both forwards and backwards.
from glob import glob
from pymol import cmd
file_list = glob("mov*.pdb"):
for file in file_list
cmd.load(file,"mov")
cmd.mset("1 -%d -2"%len(file_list))
I obviously have no idea how to program. Sorry about that. I need canned commands to succeed.
Thank you,
Jeff

Hi,
* Jeffrey N. Agar <agar@...> [2005-01-18 14:07] wrote:
>
> also, typing the following example from the users manual gives invalid
> syntax with an arrow pointing to the m in file_list =glob("mov*.pdb"):
>
> 2) The following is a Python program (with a .py or .pym extension)
> which uses a Python loop to load a large number of numbered PDB files,
> and then configures PyMOL to show them both forwards and backwards.
>
> from glob import glob
> from pymol import cmd
>
> file_list = glob("mov*.pdb"):
There should be no colon at the end of this line. I don't know if that's
what you actually typed or not.
>
> for file in file_list
> cmd.load(file,"mov")
>
> cmd.mset("1 -%d -2"%len(file_list))
>
> I obviously have no idea how to program. Sorry about that. I need canned
> commands to succeed.
I have four different loading scripts on my pymol scripts page that you
can take and modify if you wish. I "run" them at pymol startup (by
adding a line to my .pymolrc file), so that I can always type something
like:
load_models *.pdb, objname
within PyMOL. One script loads everything into a single object, one generates
individual objects, the third loads everything into a single object, but
with the discrete flag set to 1, and the fourth loads the PDB files
output by modeller, but in order from best to worst value for the
"OBJECTIVE FUNCTION".
Except for load_best.py, the models are loaded in alphabetical order, so
if you have files named:
ff0.pdb
...
ff9.pdb
ff10.pdb
ff11.pdb
...
then ff10 through ff19 would be loaded before ff2.pdb. It helps to
rename the ff0.pdb through ff9.pdb as ff00.pdb ... ff09.pdb.
Hope this helps,
Rob
--
Robert L. Campbell, Ph.D. <rlc1@...>
Senior Research Associate phone: 613-533-6821
Dept. of Biochemistry, Queen's University, fax: 613-533-2497
Kingston, ON K7L 3N6 Canada http://adelie.biochem.queensu.ca/~rlc
PGP Fingerprint: 9B49 3D3F A489 05DC B35C 8E33 F238 A8F5 F635 C0E2