<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Dan,<div><span class="Apple-tab-span" style="white-space:pre"> </span>You are correct that "coordset" can't go to a frame that hasn't been loaded yet. Right now, only the MD Movie tool knows how to load a frame from a trajectory, therefore what you have to do is find the Python instance of the MD Movie interface and call its LoadFrame method. So here's some code to do that:</div><div><br></div><div><div>def findMDMovie():</div><div> # locate and return the newest instance</div><div> # of MD Movie</div><div> from Movie.gui import MovieDialog</div><div> from chimera.extension import manager</div><div> mdms = [inst for inst in manager.instances</div><div> if isinstance(inst, MovieDialog)]</div><div> if not mdms:</div><div> raise AssertionError("No MD Movie instances!")</div><div> return mdms[-1]</div><div><br></div><div>mdm = findMDMovie()</div><div>mdm.LoadFrame(frameNumber)</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>So, not <i>too</i> bad. LoadFrame() will not only load the frame but will also go to that frame. Let me know if you have more questions.</div><div><br></div><div>--Eric</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-size: 16px; "><font face="Helvetica" size="5" style="font: normal normal normal 16px/normal Helvetica; "> Eric Pettersen</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-size: 16px; "><font face="Helvetica" size="5" style="font: normal normal normal 16px/normal Helvetica; "> UCSF Computer Graphics Lab</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-size: 16px; "><font face="Helvetica" size="5" style="font: normal normal normal 16px/normal Helvetica; "> <a href="http://www.cgl.ucsf.edu">http://www.cgl.ucsf.edu</a>'</font></div></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-size: 16px; "><font face="Helvetica" size="5" style="font: normal normal normal 16px/normal Helvetica; "><br></font></div><div><div>On Aug 7, 2011, at 11:14 AM, Daniel Gurnon wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi everyone,<div>I have a question for the python experts:</div><div><br></div><div>Suppose I have opened an MD trajectory using MD movie.</div><div><br></div><div>I want a script that will capture images along the trajectory spaced by user-defined timespans. Problem is, I don't know how to use a script to go to a specific frame in MD movie. As I understand it, coordset, as employed in the following example, requires the user to first play through the entire trajectory. With a million frames, that's not practical. Here's what I have so far, cobbled together from examples and my own limited understanding of Python.</div> <div><br></div><div><br></div><div>----------------------------</div><div>from chimera import runCommand</div><div><div><br></div><div>timestep=input ("How many picoseconds pass between frames?")</div><div>spacing=input ("What spacing, in ps, do you want between structures?")</div> <div>start=input ("Which frame do you want to start with?")</div><div>end=input ("What frame do you want to end with?")</div><div><br></div><div><div>runCommand("coordset #0" + start)</div><div> runCommand("focus")</div><div>runCommand("copy file C:\Users\Dan\Desktop" + "\\" +start + ".png" + " width 2000 width 2000 supersample 3")</div></div><div>----------------------------</div> <div><br></div><div>So in place of coordest, what could I use to jump to frames within MD movie?</div></div><div><br></div><div>And while I'm at it,</div><div>How can I generically specify the desktop in a windows environment (so that I could give this to a student and they wouldn't have to change "Dan" in c:\users\Dan\Desktp")</div> <div>How can I change the filename for the image to reflect framenumber? </div></blockquote></div></div><br><div apple-content-edited="true"><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><br class="Apple-interchange-newline"></div></span> </div><br></body></html>