Zach,

I remember my grad-school days hacking away at PyMOL movies.  It can
be fun, but sometimes frustrating.  I used to love to watch the
audience while they watched a really cool molecular movie.

I rescripted your movie to perform the trna movements and also rotate
around the scene as the movie plays.  The key concept you were missing
is that a "scene" stores the camera position.  So, when you made your
360 scenes--we'll talk about that in a second--you inadvertently
stored the camera position, too.  That's why the camera was "frozen".
What you can do, instead is use the "mdo" command.  Next, scenes takes
up lots of memory, especially as PyMOL likes to interpolate between
them as well as store camera, color and object representations.  So,
better than that is to script a small command per frame; hence, the
mdo command, or better yet, take advantage of the interpolations.
Check out the PyMOLWiki for the difference between a 'scene', 'frame'
and 'state'.  Those must be absolutely clear before you get good at
complex movies.

Here's the working (but mediocre) script. Copy and paste it into
PyMOL.  There are a couple other ways you could reproduce this.

#
# BEGIN
#
reinit

# position molecule & view
fetch 1yfg, trna, async=0
orient
rotate z, 60, trna

python
for x in range(6):
  n = "trna_%s" % x
  cmd.create( n, "trna", 1, 1)

cmd.hide("everything", "trna")
cmd.translate( [0, -60, 0], "trna" )
cmd.origin("trna")

for x in range(6):
  n = "trna_%s" % x
  cmd.rotate( "z", 60. * x, n)
  cmd.show_as("cartoon", n)
  cmd.origin("trna")
  cmd.zoom()
python end


mset 1x360

python
for x in range(1,361):
  cmd.mdo( x, "rotate y, 1.0, object=trna_0; rotate [-1.4,1.,0.], 1.0,
object=trna_1; rotate [-1.4, -1., 0.], 1.0, object=trna_2; rotate y,
1.0, object=trna_3; rotate [-1.4, 1., 0.], 1.0, object=trna_4; rotate
[1.4,1.,0.], 1.0, object=trna_5; ")
python end

frame 1
orient vis
mview store

python
for f in [120,240,360]:
  cmd.frame(f)
  cmd.turn('y', 60)
  cmd.mview(action="store", linear=1)
python end

frame 1
mplay
#
# END
#

Last, this can be improved by making the 360 mdos into 2 rotates (per
trna and camera).  Can you figure out how?  Think about it and play
around.  The answer is on my PyMOLWiki User Page:
http://www.pymolwiki.org/index.php/User:Inchoate#tRNA_hairball.

Cheers,

-- Jason

On Wed, Feb 24, 2010 at 9:29 PM, Zach Charlop-Powers
<zachary.charlop-pow...@mssm.edu> wrote:
> Hello Pymol-ers,
> I am trying to script pymol to make some movies. I would like to:
> 1) move the molecules around and save their states somehow (as a state or
> scene or something to that effect). After that, I would like to be able to
> 2) move the camera around independently of the molecules to give a nice
> effect.
> You can see below that I am able to do the first part of this. However when
> i use either "scene" command (in use) or the "mview" command (commented out)
> I run into the same problems: My camera  position seems to be locked so i
> can no longer use the positioning and interpolation  functions that Warren
> and others worked so hard to put together. I have been playing with this for
> a while and can't figure out a solution. I am hoping someone may have some
> hints on how to proceed.
>
> thanks,
> zach cp
> grad student
> mount sinai school of medicine.
>
> # setup PyMOL for movies
> reinitialize
> set movie_auto_interpolate, off
> set matrix_mode, 1
> set movie_panel, 1
> set scene_buttons, 1
> set cache_frames, 1
> config_mouse three_button_motions, 1
>
> # download the complex and set it up
> fetch 1yfg.pdb, trna
> orient
> rotate z,60, trna
> # make an array of the molecules
> python
> s = range(1,7)
> for x in s:
> cmd.copy("trna%s" %x, "trna")
> cmd.hide("lines", "trna")
> cmd.translate("[0,-60,0]", "trna")
> cmd.origin("trna")
> s = range(1,7)
> for x in s:
> cmd.rotate("z", "%d" %(60*x), "trna%s" %x)
> cmd.hide("lines" ,"trna%s" %x)
> cmd.show("cartoon" ,"trna%s" %x)
> cmd.origin("trna")
> cmd.zoom()
> python end
>
> # overview of the scene
> frame 1
> mview store
> orient
>
> python
> for x in range(360):
>   cmd.madd("1 x1"); cmd.frame(1000);
>   cmd.rotate("y", 1.0, object="trna1")
>   cmd.rotate("[-1.4,1,0]", 1.0, object="trna2")
>   cmd.rotate("[-1.4,-1,0]", 1.0, object="trna3")
>   cmd.rotate("y", 1.0, object="trna4")
>   cmd.rotate("[1.4,-1,0]", 1.0, object="trna5")
>   cmd.rotate("[1.4,1,0]", 1.0, object="trna6")
>   #cmd.mview("store", object="trna1")
>   #cmd.mview("store", object="trna2")
>   #cmd.mview("store", object="trna3")
>   #cmd.mview("store", object="trna4")
>   #cmd.mview("store", object="trna5")
>   #cmd.mview("store", object="trna6")
>   #cmd.mview("reinterpolate")
>   cmd.scene("new","store")
> python end
> frame 180
> set_view (\
>      0.769429266,   -0.001453266,    0.638730288,\
>     -0.483805567,    0.651568949,    0.584285855,\
>     -0.417025983,   -0.758588016,    0.500633180,\
>      0.000000000,    0.000000000, -635.205078125,\
>    -42.521865845,   33.457977295,   19.863151550,\
>    530.689270020,  739.720764160,  -20.000000000 )
> mview store
> mview interpolate
> mview reinterpolate
>
> mplay
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> 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
>



-- 
Jason Vertrees, PhD
PyMOL Product Manager
Schrodinger, LLC

(e) jason.vertr...@schrodinger.com
(o) +1 (603) 374-7120

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
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