<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Dear developers,<div class=""><br class=""></div><div class="">I have been working on integrating Tetr (a command line tool to construct/modify molecular systems for use in computational chemistry codes such as CASTEP and CP2K - <a href="http://nms.kcl.ac.uk/lev.kantorovitch/codes/lev00/index.html" class="">http://nms.kcl.ac.uk/lev.kantorovitch/codes/lev00/index.html</a>) with Chimera. </div><div class=""><br class=""></div><div class="">To do this we have written a plugin to Chimera that runs an instance of Tetr in a console, with the user being able to type commands into Tetr. The aim is to have Chimera visualise the system being constructed in Tetr, and to update the visualisation based to changes made in Tetr. </div><div class=""><br class=""></div><div class="">At present whenever a command is send to Tetr (which in response to this command may re-write a file containing the molecular system), the plugin looks to see if this file has changed, and if so gets Chimera to reload this file and visualise it. As far as I can tell, there isn’t a ‘reload’ option in Chimera, so instead I close the model (saving its xform matrix first), then open the modified file, and set its xform matrix to restore the old viewing angle etc. For example:</div><div class=""><br class=""></div><div class=""><font face="Courier" class="">#save xform matrix and close model</font></div><div class=""><font face="Courier" class="">xf=model.openState.xform</font></div><div class=""><font face="Courier" class="">chimera.openModels.close(model)</font></div><div class=""><font face="Courier" class=""><br class=""></font></div><div class=""><font face="Courier" class="">#open updated file into model number baseId</font></div><div class=""><font face="Courier" class="">chimera.openModels.open(filename,baseId=baseId)</font></div><div class=""><font face="Courier" class=""><br class=""></font></div><div class=""><font face="Courier" class="">#retrieve model from the list of open models</font></div><div class=""><font face="Courier" class="">modlist=chimera.openModels.list()</font></div><div class=""><font face="Courier" class="">for mod in modlist:</font></div><div class=""><font face="Courier" class=""> if mod.id == baseId:</font></div><div class=""><font face="Courier" class=""> model=mod</font></div><div class=""><font face="Courier" class=""> break</font></div><div class=""><font face="Courier" class=""><br class=""></font></div><div class=""><font face="Courier" class="">#set the xform matrix</font></div><div class=""><font face="Courier" class="">model.openState.xform=xf</font></div><div class=""><br class=""></div><div class="">What I was wondering was 1) if this is a sensible way to go about things, and 2) if there is a way to retrieve and store visualisation information such as displaying the molecule as ball and stick, wireframe etc such that this can be re-applied to the newly opened model, since at present any visualisation information is not retained when re-opening a file.</div><div class=""><br class=""></div><div class="">Thanks in advance,</div><div class=""><br class=""></div><div class="">Gordon</div><div class=""><br class=""></div><div class=""> </div><div class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">-----------------------------------------------</div><div class="">Dr Gordon P S Gibb</div><div class="">EPCC, The University of Edinburgh</div></div><br class="Apple-interchange-newline"><br class="Apple-interchange-newline">
</div>
<br class=""></div></body></html>