<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Lukas,<div><span class="Apple-tab-span" style="white-space:pre"> </span>The runCommand function immediately executes the given command and does not wait for a redraw to occur before going on to the next command in your script. In order to allow Chimera to draw the map you've opened you need to insert a run('wait 1') in front of your sleep() call -- asking Chimera to draw one frame.</div><div><br></div><div>--Eric</div><div><br><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="5" style="font: 16.0px Helvetica"><span class="Apple-converted-space"> <span class="Apple-converted-space"> </span></span>Eric Pettersen</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="5" style="font: 16.0px Helvetica"><span class="Apple-converted-space"> <span class="Apple-converted-space"> </span></span>UCSF Computer Graphics Lab</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="5" style="font: 16.0px Helvetica"><span class="Apple-converted-space"> </span><a href="http://www.cgl.ucsf.edu">http://www.cgl.ucsf.edu</a></font></p><br class="Apple-interchange-newline"></div></span> </div><br><div><div>On Oct 27, 2008, at 9:42 AM, Lukas Palatinus wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "> <div>Hello all,</div><div>I am using Chimera as a visualization tool for small-molecule electron densities obtained by ab initio structure solution. I want to create a small script that will make Chimera read and display the intermediate electron densities as they are produced during the iterative structure solution process. I am not skilled in Python, but I could make a simple Python script by copying and modifying scripts previously posted in this list. Here is the script:</div><div><br></div><div>from chimera import runCommand as run</div><div>from os.path import exists</div><div>from time import sleep</div><div>map_file= 'test.xplor'</div><div>while exists(map_file):</div><div> run('close all')</div><div> run('open ' + map_file)</div><div> sleep(1)</div><div><br></div><div>I am sure this is not the most elegant way to achieve what I need, but it should do the job. What the script should in my opinion do is to read and display the file test.xplor, then wait one second, close the map and reopen it again, until the file test.xplor is deleted. The script does >>almost<< that, it opens the volume viewer, reads the map, but it does not display the map in the main Chimera window. Only after the file test.xplor is deleted, the last map is displayed. Can anybody give me a hint what am I doing wrong? I am using Chimera 1.2540 on Mac OS X 10.4.</div><div><br></div><div>Thanks in advance for any help.</div><div><br></div><div>Best regards</div><div><br></div><div>Lukas</div><div><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><br class="Apple-interchange-newline"><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div><br class="khtml-block-placeholder"></div><div>Lukas Palatinus</div><div>Laboratoire de Cristallographie</div><div>EPFL Lausanne</div><div><font class="Apple-style-span" face="Verdana"><span class="Apple-style-span" style="font-family: Verdana; "><span class="Apple-style-span" style="font-family: Verdana; "><span class="Apple-style-span" style="font-family: Verdana; ">Tel.: +41 (0)21 693 0639</span></span></span></font></div><div>mailto: <a href="mailto:palat@fzu.cz">palat@fzu.cz</a></div><div><br class="khtml-block-placeholder"></div><br class="Apple-interchange-newline"></span></span></span> </div><br></div>_______________________________________________<br>Chimera-users mailing list<br><a href="mailto:Chimera-users@cgl.ucsf.edu">Chimera-users@cgl.ucsf.edu</a><br>http://www.cgl.ucsf.edu/mailman/listinfo/chimera-users<br></blockquote></div><br></div></body></html>