
Hi everyone, For the purpose of making educational content, I'm interested in smoothing out the often jumpy transitions from frame to frame in a MD trajectory. My approach was to write two python scripts (with critical help from Eric of course); one goes through the trajectory and saves pdbs of each desired frame, while the second opens these pdbs and creates a morph, interpolating from one pdb to the next. It seemed like I was almost there, and it looked great when I tried 50 frames.....but Chimera crashed when I tried morphing 200 frames, adding 3 frames of interpolation between each. Is there a better way to add transitions in between (ideally thousands of) frames of an MD trajectory? Thanks Dan -- ____________________________ Daniel Gurnon, Ph. D. Associate Professor of Chemistry and Biochemistry DePauw University Greencastle, IN 46135 p: 765-658-6279 e: danielgurnon@depauw.edu

Hi, Can we see the interpolation code? -- Darren On 09/20/2011 09:40 AM, Daniel Gurnon wrote:
Hi everyone, For the purpose of making educational content, I'm interested in smoothing out the often jumpy transitions from frame to frame in a MD trajectory. My approach was to write two python scripts (with critical help from Eric of course); one goes through the trajectory and saves pdbs of each desired frame, while the second opens these pdbs and creates a morph, interpolating from one pdb to the next.
It seemed like I was almost there, and it looked great when I tried 50 frames.....but Chimera crashed when I tried morphing 200 frames, adding 3 frames of interpolation between each.
Is there a better way to add transitions in between (ideally thousands of) frames of an MD trajectory?
Thanks Dan -- ____________________________
Daniel Gurnon, Ph. D. Associate Professor of Chemistry and Biochemistry DePauw University Greencastle, IN 46135
p: 765-658-6279 e: danielgurnon@depauw.edu <mailto:danielgurnon@depauw.edu>
_______________________________________________ Chimera-users mailing list Chimera-users@cgl.ucsf.edu http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users

Here it is: from chimera import openModels, Molecule, runCommand i=1 runCommand ("morph start #0 frames 2") totalModels=len(openModels.list(modelTypes=[Molecule])) for m in openModels.list(modelTypes=[Molecule]): while i < totalModels: runCommand ("morph interpolate #" +str(i)+ " frames 2") i=int(i)+1 runCommand ("morph movie") On Tue, Sep 20, 2011 at 1:54 PM, Darren Weber <dweber@cgl.ucsf.edu> wrote:
Hi,
Can we see the interpolation code?
-- Darren
On 09/20/2011 09:40 AM, Daniel Gurnon wrote:
Hi everyone, For the purpose of making educational content, I'm interested in smoothing out the often jumpy transitions from frame to frame in a MD trajectory. My approach was to write two python scripts (with critical help from Eric of course); one goes through the trajectory and saves pdbs of each desired frame, while the second opens these pdbs and creates a morph, interpolating from one pdb to the next.
It seemed like I was almost there, and it looked great when I tried 50 frames.....but Chimera crashed when I tried morphing 200 frames, adding 3 frames of interpolation between each.
Is there a better way to add transitions in between (ideally thousands of) frames of an MD trajectory?
Thanks Dan -- ____________________________
Daniel Gurnon, Ph. D. Associate Professor of Chemistry and Biochemistry DePauw University Greencastle, IN 46135
p: 765-658-6279 e: danielgurnon@depauw.edu <mailto:danielgurnon@depauw.edu>
_______________________________________________ Chimera-users mailing list Chimera-users@cgl.ucsf.edu http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users
Chimera-users mailing list Chimera-users@cgl.ucsf.edu http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users
-- ____________________________ Daniel Gurnon, Ph. D. Associate Professor of Chemistry and Biochemistry DePauw University Greencastle, IN 46135 p: 765-658-6279 e: danielgurnon@depauw.edu

Why does it have a 'while' loop inside a 'for' loop? -- Darren On 09/20/2011 11:10 AM, Daniel Gurnon wrote:
Here it is:
from chimera import openModels, Molecule, runCommand i=1 runCommand ("morph start #0 frames 2") totalModels=len(openModels.list(modelTypes=[Molecule])) for m in openModels.list(modelTypes=[Molecule]): while i < totalModels: runCommand ("morph interpolate #" +str(i)+ " frames 2") i=int(i)+1 runCommand ("morph movie")
On Tue, Sep 20, 2011 at 1:54 PM, Darren Weber <dweber@cgl.ucsf.edu <mailto:dweber@cgl.ucsf.edu>> wrote:
Hi,
Can we see the interpolation code?
-- Darren
On 09/20/2011 09:40 AM, Daniel Gurnon wrote: > Hi everyone, > For the purpose of making educational content, I'm interested in > smoothing out the often jumpy transitions from frame to frame in a MD > trajectory. My approach was to write two python scripts (with critical > help from Eric of course); one goes through the trajectory and saves > pdbs of each desired frame, while the second opens these pdbs and > creates a morph, interpolating from one pdb to the next. > > It seemed like I was almost there, and it looked great when I tried 50 > frames.....but Chimera crashed when I tried morphing 200 frames, > adding 3 frames of interpolation between each. > > Is there a better way to add transitions in between (ideally thousands > of) frames of an MD trajectory? > > Thanks > Dan > -- > ____________________________ > > Daniel Gurnon, Ph. D. > Associate Professor of Chemistry and Biochemistry > DePauw University > Greencastle, IN 46135 > > p: 765-658-6279 <tel:765-658-6279> > e: danielgurnon@depauw.edu <mailto:danielgurnon@depauw.edu> <mailto:danielgurnon@depauw.edu <mailto:danielgurnon@depauw.edu>> > > > _______________________________________________ > Chimera-users mailing list > Chimera-users@cgl.ucsf.edu <mailto:Chimera-users@cgl.ucsf.edu> > http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users _______________________________________________ Chimera-users mailing list Chimera-users@cgl.ucsf.edu <mailto:Chimera-users@cgl.ucsf.edu> http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users
-- ____________________________
Daniel Gurnon, Ph. D. Associate Professor of Chemistry and Biochemistry DePauw University Greencastle, IN 46135
p: 765-658-6279 e: danielgurnon@depauw.edu <mailto:danielgurnon@depauw.edu>

Hi Dan, As per this previous message: http://plato.cgl.ucsf.edu/pipermail/chimera-users/2008-April/002496.html it might be better to rewrite the trajectory with averaged coordinates, using a "smoothing window" of nearby frames to compute an average for each frame. The script attached to that original message still works, though I'm attaching it again to this message (see the original message for running it). Let me know if this doesn't meet your needs. --Eric On Sep 20, 2011, at 9:40 AM, Daniel Gurnon wrote:
Hi everyone, For the purpose of making educational content, I'm interested in smoothing out the often jumpy transitions from frame to frame in a MD trajectory. My approach was to write two python scripts (with critical help from Eric of course); one goes through the trajectory and saves pdbs of each desired frame, while the second opens these pdbs and creates a morph, interpolating from one pdb to the next.
It seemed like I was almost there, and it looked great when I tried 50 frames.....but Chimera crashed when I tried morphing 200 frames, adding 3 frames of interpolation between each.
Is there a better way to add transitions in between (ideally thousands of) frames of an MD trajectory?
Thanks Dan -- ____________________________
Daniel Gurnon, Ph. D. Associate Professor of Chemistry and Biochemistry DePauw University Greencastle, IN 46135
p: 765-658-6279 e: danielgurnon@depauw.edu _______________________________________________ Chimera-users mailing list Chimera-users@cgl.ucsf.edu http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users

Hi Dan, Chimera molecule models take lots of memory, about 2 to 4 Kbytes per atom. If your 200 frame models had 5000 atoms each that would be one million atoms taking about 2-4 Gbytes. You would certainly run out of memory and likely crash with a 32-bit version of Chimera (addressible memory of 4 Gbytes). A 64-bit version of Chimera might get further if your machine has more 8 Gbytes of actual memory. But you can see it won't scale to thousands of models. So I would suggest opening a small batch of frames (50) as individual PDB models, compute and play the morph, then close that batch of models and open the next (50) and compute and play the morph. All the while you record the movie. The pauses during the morph computations and model opening/closing will not appear in the movie because the Chimera graphics is not being redrawn at those times. This method is a bit more complex though. Maybe it would be slightly simpler to just morph between two frames a time. Tom
Hi everyone, For the purpose of making educational content, I'm interested in smoothing out the often jumpy transitions from frame to frame in a MD trajectory. My approach was to write two python scripts (with critical help from Eric of course); one goes through the trajectory and saves pdbs of each desired frame, while the second opens these pdbs and creates a morph, interpolating from one pdb to the next.
It seemed like I was almost there, and it looked great when I tried 50 frames.....but Chimera crashed when I tried morphing 200 frames, adding 3 frames of interpolation between each.
Is there a better way to add transitions in between (ideally thousands of) frames of an MD trajectory?
Thanks Dan -- ____________________________
Daniel Gurnon, Ph. D. Associate Professor of Chemistry and Biochemistry DePauw University Greencastle, IN 46135
p: 765-658-6279 e: danielgurnon@depauw.edu <mailto:danielgurnon@depauw.edu>
_______________________________________________ Chimera-users mailing list Chimera-users@cgl.ucsf.edu http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users
participants (4)
-
Daniel Gurnon
-
Darren Weber
-
Eric Pettersen
-
Tom Goddard