Re: [PyMOL] What's wrong with my pymol script?

2016-08-15 Thread Julian Heinrich
Hi,

adding a 'refresh' (http://www.pymolwiki.org/index.php/Refresh) seems to
work:

```
from pymol import cmd

cmd.fetch('1nmr', async=0)
for i in range(1, cmd.count_states()+1):
 cmd.set("state", i)
 cmd.png("%d.png" % (i), width=1000, height=1000, dpi=300)
 cmd.refresh()
```


On Sun, Aug 14, 2016 at 3:55 PM Dd H  wrote:

> Hi everyone,
> I want to render images of frames of my trajectory that loaded in pymol
> with the script below. After running this script, pymol outputs images
> and they are all the same. So what's wrong with my script?
>
> for i in range(1, cmd.count_states()+1):
>  cmd.set("state", i, "traj")
>  cmd.png("%d.png" % (i), width=10, height=10, dpi=300)
>
>
> --
> What NetFlow Analyzer can do for you? Monitors network bandwidth and
> traffic
> patterns at an interface-level. Reveals which users, apps, and protocols
> are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and other flows. Make informed decisions using capacity
> planning reports. http://sdm.link/zohodev2dev
> ___
> 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
--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. http://sdm.link/zohodev2dev___
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

Re: [PyMOL] What's wrong with my pymol script?

2016-08-14 Thread Sampson, Jared M.
Hi Dd H -

`cmd.set` is the wrong command to use here.  (It's for changing settings, not 
for going through states, although some settings can be applied to only a 
specific state).

Instead, you should use `cmd.frame(i)` to move to that frame (state) number.

Note that the `width` and `height` arguments to 
`cmd.png` are in pixels unless you include 
a unit suffix like '10in' or '10cm', and it also takes a `ray` keyword argument 
if you want to ray trace for a nicer image.  Also, this is in a PyMOL (.pml) 
script instead of a Python (.py) script, you need to enclose any statement that 
requires multiple lines (i.e. loops, if/else, etc.) within a `python` block.

```
python
for i in range(1, cmd.count_states()+1):
 cmd.frame(i)
 cmd.png("%d.png" % (i), width='10in', height='10in', dpi=300, ray=1)
python end
```

Hope that helps.

Cheers,
Jared


On Aug 14, 2016, at 9:48 AM, Dd H > 
wrote:

Hi everyone,
I want to render images of frames of my trajectory that loaded in pymol with 
the script below. After running this script, pymol outputs images and they are 
all the same. So what's wrong with my script?

for i in range(1, cmd.count_states()+1):
 cmd.set("state", i, "traj")
 cmd.png("%d.png" % (i), width=10, height=10, dpi=300)

--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. 
http://sdm.link/zohodev2dev___
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

--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. http://sdm.link/zohodev2dev___
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