Hi Mateusz,

The first guess would be that you're not in the right directory, since
Pymol can't find the file. That seems a bit awkward, as I guess
they're in the same directory as "converged.nam", or aren't they? To
see what is in the directory, you can call cmd.ls() at the start of
the script. For what it's worth, the script is syntactically correct,
although it could be written a bit more neatly ;)

Hope it helps,

Tsjerk

On Tue, Nov 10, 2009 at 5:08 PM, Mateusz Maciejewski
<s0676...@sms.ed.ac.uk> wrote:
> Hello,
>
> I'm writing a script in Python to be executed in PyMOL. Unfortunately I got
> stuck right at the beginning, when I'm trying to load .pdb's from
> "converged.nam" file. The relevant bit of the script is the following:
>
>
> from pymol.cgo import *
> from pymol import cmd
>
> loadedStuff=open("converged.nam", 'r')
> linie = loadedStuff.readlines()
> for n in range(len(linie)): linie[n] = linie[n][:-1]
> for n in range(len(linie)): print n, linie[n]
> for n in linie: cmd.load(n,n)
>
>
>
> Unfortunately, it is not working - I keep on getting:
>
>
>
> 0 compstatin.pdb_14
> 1 compstatin.pdb_72
> 2 compstatin.pdb_91
> 3 compstatin.pdb_93
> 4 compstatin.pdb_78
> 5 compstatin.pdb_34
> 6 compstatin.pdb_32
> 7 compstatin.pdb_7
> 8 compstatin.pdb_47
> 9 compstatin.pdb_31
> 10 compstatin.pdb_5
> ExecutiveProcessPDBFile-Error: Unable to open file 'compstatin.pdb_14'.
> Traceback (most recent call last):
>   File "/usr/local/pymol/modules/pymol/parsing.py", line 407, in run_file
>     execfile(file,global_ns,local_ns)
>   File "align.py", line 8, in ?
>     for n in linie: cmd.load(n,n)
>   File "/usr/local/pymol/modules/pymol/importing.py", line 575, in load
>     if _raising(r): raise pymol.CmdException
> CmdException: <pymol.CmdException instance at 0x56fdc6cc>
>
>
>
> When I manually form a list containing all the compstatin entries than it is
> working, so it must be something with how it processes the list which it
> gets from the file. I can't really understand why that is so, especially
> given how it correctly pronts out the content of the list that captures the
> content of the file. I am obviously making some silly mistake here... any
> suggestions?
>
> Thank you,
> Mateusz Maciejewski
>
> ----------------------------------------------
>
>
>
> Mateusz Maciejewski,
> University of Edinburgh
> Joseph Black Chemistry Bldg, West Mains Rd.,
> Edinburgh EH9 3JJ, U.K.
> Phone (44) (0) 131 650 4704 (group office)
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus
> on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
>



-- 
Tsjerk A. Wassenaar, Ph.D.

Computational Chemist
Medicinal Chemist
Neuropharmacologist

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net

Reply via email to