[Chimera-users] Morphing script

Eric Pettersen pett at cgl.ucsf.edu
Wed Sep 8 11:31:38 PDT 2010


On Sep 8, 2010, at 6:26 AM, Rajan Prabu wrote:

> Dear Chimera users,
>
> I am trying to make a morphing pdb with chimera without opening the  
> interface using --nogui option. It works and calculates the  
> interpolation and then it crashes. If i understood it correctly,  it  
> is trying to open the MD Movie GUI. By default morph movie command  
> calls the MD Movie interface.  Is it possible to make it work  
> without opening the interface.
>
> I am trying to run the script with chimera using the following command
>
> chimera --nogui --script chi1.py
>
> and my script chi1.py is the following
>
> from chimera import runCommand
> runCommand('open starting.pdb')
> runCommand('open end.pdb')
> runCommand('morph start #0')
> runCommand('morph interpolate #1')
> runCommand('morph movie')
> runCommand('stop')

Hi Rajan,
	Yes, you are correct.  The "morph movie" command tries to open the MD  
Movie interface and that doesn't work in nogui mode.  There is no  
Chimera command for creating the morph trajectory without opening the  
MD Movie interface.  I'll be adding a feature-request ticket to our  
Trac database to see that that gets implemented in the not-too-distant  
future.
	Since you are using a Python script here, you can use the Python API  
to create and open the morph trajectory by changing your script to this:

from chimera import runCommand, openModels
runCommand('open starting.pdb')
runCommand('open end.pdb')
runCommand('morph start #0')
runCommand('morph interpolate #1')
#runCommand('morph movie')
from Morph.cmdline import _find
morph = _find("default")
traj, xform = morph.makeTrajectory(minimize=None, steps=None)
openModels.add([traj])
runCommand('stop')

Unfortunately it uses a "private" function of the Morph module (_find;  
functions/methods that start with an underscore are "private" and are  
supposed to be used only by other functions/methods in the same  
module).  I hope the Morph module API can be improved so that scripts  
like yours don't need to "cheat" and access private functions/data.
	I note that your script doesn't really do anything with the morph  
after it's created.  I assume you'll add some commands in there to  
save the morph or to run through it with the "coordset" command and  
save images or something. :-)
	I've attached the modified script for your convenience.

--Eric

                         Eric Pettersen
                         UCSF Computer Graphics Lab
                         http://www.cgl.ucsf.edu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20100908/787afdff/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: morph.py
Type: text/x-python-script
Size: 354 bytes
Desc: not available
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20100908/787afdff/attachment.bin>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20100908/787afdff/attachment-0001.html>


More information about the Chimera-users mailing list