[chimera-dev] Linking Chimera with Tetr
Gordon Gibb
gordon.gibb at ed.ac.uk
Tue Feb 7 08:24:47 PST 2017
Dear developers,
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 - http://nms.kcl.ac.uk/lev.kantorovitch/codes/lev00/index.html <http://nms.kcl.ac.uk/lev.kantorovitch/codes/lev00/index.html>) with Chimera.
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.
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:
#save xform matrix and close model
xf=model.openState.xform
chimera.openModels.close(model)
#open updated file into model number baseId
chimera.openModels.open(filename,baseId=baseId)
#retrieve model from the list of open models
modlist=chimera.openModels.list()
for mod in modlist:
if mod.id == baseId:
model=mod
break
#set the xform matrix
model.openState.xform=xf
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.
Thanks in advance,
Gordon
-----------------------------------------------
Dr Gordon P S Gibb
EPCC, The University of Edinburgh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-dev/attachments/20170207/21f8fd78/attachment.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: not available
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-dev/attachments/20170207/21f8fd78/attachment.ksh>
More information about the Chimera-dev
mailing list