Re: [Chimera-users] using chimera command in batch mode

Dear sir I am so grateful to you for your detailed answer. Thanks a million. best wishes Tao Cui ------------------ 原始邮件 ------------------
From: Eric Pettersen <pett@cgl.ucsf.edu> Reply-To: UCSF Chimera Mailing List <chimera-users@cgl.ucsf.edu> To: "cuitao@webmail.hzau.edu.cn" <cuitao@webmail.hzau.edu.cn> Cc: UCSF Chimera Mailing List <chimera-users@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. http://mailman.docking.org/pipermail/dock-fans/2007-May/001043.html 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 runCommand("surf") # 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 Eric Pettersen UCSF Computer Graphics Lab http://www.cgl.ucsf.edu

On Mar 9, 2011, at 9:13 PM, Tao Cui wrote:
Dear sir
I am so grateful to you for your detailed answer. Thanks a million.
best wishes
Tao Cui
You're welcome!
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.
Um, er, you would do something else if calculationFailed is True! --Eric
participants (2)
-
cuitao@webmail.hzau.edu.cn
-
Eric Pettersen