<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.pymol.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Lkajan</id>
	<title>PyMOL Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.pymol.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Lkajan"/>
	<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php/Special:Contributions/Lkajan"/>
	<updated>2026-04-26T17:51:58Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=MovieSchool_4&amp;diff=7886</id>
		<title>MovieSchool 4</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=MovieSchool_4&amp;diff=7886"/>
		<updated>2010-02-01T14:44:48Z</updated>

		<summary type="html">&lt;p&gt;Lkajan: /* BB Inspector */ the frame command must preceed the zoom and store commands in the example in order to achieve the desired effect - I have just went through that example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Simple Movie Examples ==&lt;br /&gt;
We now the ability to make some pretty simple, but cool movies.  So, let's try a few.&lt;br /&gt;
&lt;br /&gt;
=== Multiple Zooming ===&lt;br /&gt;
Let's try making a movie where we zoom into each ligand that's not water.  In order to make this movie, I had to find a protein with suitable ligands, so you can do the same for your own protein.  Just replace the hard-coded residue numbers.&lt;br /&gt;
&lt;br /&gt;
'''Goal:''' Make a movie that zoom into the three ligands, stays on that ligand for 2 seconds, then moves to the next.  I also want smooth zoom out at the end.  Don't let the length of this movie script throw you off, you've seen all of the movie commands and the initial commands are just loading the and making it look good.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# setup PyMOL for the movie&lt;br /&gt;
reinitialize&lt;br /&gt;
set matrix_mode, 1&lt;br /&gt;
set movie_panel, 1&lt;br /&gt;
&lt;br /&gt;
# load the PDB, make selections for the ligands and&lt;br /&gt;
# make the protein look snazzy.&lt;br /&gt;
#load /spc/pdb/2jep.pdb&lt;br /&gt;
fetch 2jep, async=0&lt;br /&gt;
remove resn HOH&lt;br /&gt;
orient&lt;br /&gt;
select l1, c. A and i. 1397&lt;br /&gt;
select l2, c. A and i. 1396&lt;br /&gt;
select l3, c. B and i. 1396&lt;br /&gt;
as cartoon&lt;br /&gt;
color grey&lt;br /&gt;
show sticks, het&lt;br /&gt;
color magnesium, het&lt;br /&gt;
&lt;br /&gt;
# At 30 FPS this is then a 16 second movie.&lt;br /&gt;
# We look at the structure for 2 seconds, zoom in to each ligand&lt;br /&gt;
# and look at it for another 2 seconds, then, zoom out and look again&lt;br /&gt;
# at everything for another 2 seconds.&lt;br /&gt;
&lt;br /&gt;
# initialize the 480 frame movie&lt;br /&gt;
mset 1 x480&lt;br /&gt;
&lt;br /&gt;
# zoom all ('scene #1')&lt;br /&gt;
frame 1&lt;br /&gt;
mview store&lt;br /&gt;
# stay here for 2 seconds&lt;br /&gt;
frame 60&lt;br /&gt;
mview store&lt;br /&gt;
&lt;br /&gt;
# zoom on ligand 1  ('scene #2')&lt;br /&gt;
frame 120&lt;br /&gt;
zoom l1&lt;br /&gt;
mview store&lt;br /&gt;
# stay here for 2 seconds&lt;br /&gt;
frame 180&lt;br /&gt;
mview store&lt;br /&gt;
&lt;br /&gt;
# zoom on ligand 2  ('scene #3')&lt;br /&gt;
frame 240&lt;br /&gt;
zoom l2&lt;br /&gt;
mview store&lt;br /&gt;
# stay for 2 seconds&lt;br /&gt;
frame 300&lt;br /&gt;
mview store&lt;br /&gt;
&lt;br /&gt;
# zoom to ligand 3  ('scene #4')&lt;br /&gt;
frame 360&lt;br /&gt;
zoom l3&lt;br /&gt;
mview store&lt;br /&gt;
# stay for 2 seconds&lt;br /&gt;
frame 420&lt;br /&gt;
mview store&lt;br /&gt;
&lt;br /&gt;
# zoom out  ('back to scene #1')&lt;br /&gt;
frame 480&lt;br /&gt;
zoom&lt;br /&gt;
mview store&lt;br /&gt;
&lt;br /&gt;
# interpolate the frames&lt;br /&gt;
mview reinterpolate&lt;br /&gt;
&lt;br /&gt;
# play the awesome movie!&lt;br /&gt;
mplay&lt;br /&gt;
&lt;br /&gt;
# stop when you want&lt;br /&gt;
# mstop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Animating an Alignment ===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# setup PyMOL for the movie&lt;br /&gt;
reinitialize&lt;br /&gt;
set matrix_mode, 1&lt;br /&gt;
set movie_panel, 1&lt;br /&gt;
&lt;br /&gt;
# load the PDBs&lt;br /&gt;
fetch 1cll 1ggz, async=0&lt;br /&gt;
&lt;br /&gt;
# orient the scene&lt;br /&gt;
as cartoon&lt;br /&gt;
orient&lt;br /&gt;
&lt;br /&gt;
# make 100-frame movie&lt;br /&gt;
mset 1 x100&lt;br /&gt;
# goto frame 1&lt;br /&gt;
frame 1&lt;br /&gt;
&lt;br /&gt;
# store the camera position and object&lt;br /&gt;
# positions in frame 1&lt;br /&gt;
mview store&lt;br /&gt;
mview store, object=1cll&lt;br /&gt;
mview store, object=1ggz&lt;br /&gt;
&lt;br /&gt;
# goto frame 90&lt;br /&gt;
frame 90&lt;br /&gt;
# align the two proteins&lt;br /&gt;
super 1cll, 1ggz&lt;br /&gt;
# we rezoom to center the camera on the &lt;br /&gt;
# two aligned proteins&lt;br /&gt;
zoom&lt;br /&gt;
# store the camera positions&lt;br /&gt;
mview store&lt;br /&gt;
# store the new object position(s)&lt;br /&gt;
mview store, object=1cll&lt;br /&gt;
mview store, object=1ggz&lt;br /&gt;
&lt;br /&gt;
# have PyMOL stitch together the scenes.&lt;br /&gt;
mview reinterpolate&lt;br /&gt;
mview reinterpolate, object=1cll&lt;br /&gt;
mview reinterpolate, object=1ggz&lt;br /&gt;
&lt;br /&gt;
# rewind&lt;br /&gt;
frame 1&lt;br /&gt;
# get some popcorn!  :-)&lt;br /&gt;
mplay&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BB Inspector ===&lt;br /&gt;
This movie will walk down the alpha carbons inspecting each one for 1/3 of a second.  :-)  What would be cool would be to calculate the difference vector from i. n+1 to i. n and then walk that path.  Anyhow, here you go:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# usual setup&lt;br /&gt;
reinitialize&lt;br /&gt;
set matrix_mode, 1&lt;br /&gt;
set movie_panel, 1&lt;br /&gt;
&lt;br /&gt;
# fetch 1CLL to work on; this will only work on 1cll&lt;br /&gt;
# or any other protein with 144 AAs starting at resi 4.&lt;br /&gt;
fetch 1cll, async=0&lt;br /&gt;
as lines, n. C+O+N+CA&lt;br /&gt;
color marine&lt;br /&gt;
zoom i. 4+5&lt;br /&gt;
&lt;br /&gt;
# 10 frames per AA&lt;br /&gt;
mset 1 x1440&lt;br /&gt;
mview store&lt;br /&gt;
&lt;br /&gt;
# this code maps the zooming of&lt;br /&gt;
# one AA and it's neighbor to 10 frames&lt;br /&gt;
python&lt;br /&gt;
for x in range(0,144):&lt;br /&gt;
  cmd.frame((10*x)+1)&lt;br /&gt;
  cmd.zoom( &amp;quot;n. CA and i. &amp;quot; + str(x) + &amp;quot;+&amp;quot; + str(x+1))&lt;br /&gt;
  cmd.mview(&amp;quot;store&amp;quot;)&lt;br /&gt;
python end&lt;br /&gt;
&lt;br /&gt;
# goto the end and interpolate all the frames&lt;br /&gt;
frame 288&lt;br /&gt;
mview store&lt;br /&gt;
mview reinterpolate&lt;br /&gt;
&lt;br /&gt;
# I know, it's not smooth &amp;amp; cool like the other ones&lt;br /&gt;
mplay&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[MovieSchool_3| &amp;amp;larr; Previous Lesson]] [[MovieSchool_5| Next Lesson &amp;amp;rarr;]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Movies]]&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Lkajan</name></author>
	</entry>
</feed>