[Chimera-users] using chimera command in batch mode

cuitao at webmail.hzau.edu.cn cuitao at webmail.hzau.edu.cn
Wed Mar 9 21:13:33 PST 2011

Dear sir

I am so grateful to you for your detailed answer.
 Thanks a million.

best wishes
Tao Cui

------------------ 原始邮件 ------------------
>From: Eric Pettersen <pett at cgl.ucsf.edu>
>Reply-To: UCSF Chimera Mailing List <chimera-users at cgl.ucsf.edu>
>To: "cuitao at webmail.hzau.edu.cn" <cuitao at webmail.hzau.edu.cn>
>Cc: UCSF Chimera Mailing List <chimera-users at cgl.ucsf.edu>
>Subject: Re: using chimera command in batch mode
>Date: Wed, 9 Mar 2011 13:11:31 -0800
On Mar 8, 2011, at 5:30 PM, Tao Cui wrote:
    Dear sir:

I have seen one message you posted in dock-fans mail list.

The batch mode solution you privided is really helpful to me.  I wnat to know if I can complete similar batch mode works for other applation? for example, delete all H atoms, save molecule to pdb format and writedms.

Thank you very much!

Hi Tao,
You can use the same approach outlined in the dock-fans post to write scripts for other purposes.  The script in that post uses Python since that is the only way to call DockPrep from a script, but if the things you want to do are available as Chimera commands you can just write a Chimera command script and use it the same way (the script would need to end in .com or .cmd instead of .py though).  So deleting all H atoms would just be the command "del H".  You would save a file in PDB format with the "write" command (type "help write" in Chimera to see what arguments you would want).
Writing a DMS file isn't available as a command, so you would need to use Python scripting for that, along the lines of:
from chimera import runCommand, openModels, MSMSModel
# generate surface using 'surf' command
# get the surf object
surf = openModels.list(modelTypes=[MSMSModel])[0]
# write DMS
from WriteDMS import writeDMS
writeDMS(surf, "output.dms")
You would need to keep in mind that Chimera's surface generation will fail for some structures, more so on Windows than other platforms, so you might want to check that the output file actually has some surface points in it.  Alternately, in Chimera, the surface attribute "calculationFailed" will tell you if the surface calculation succeeded or not, so you could do something other than try to write the DMS file if that attribute is False.
Eric Pettersen
UCSF Computer Graphics Lab

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20110310/6280feec/attachment.html>

More information about the Chimera-users mailing list