[Chimera-users] using chimera command in batch mode

Eric Pettersen pett at cgl.ucsf.edu
Wed Mar 9 13:11:31 PST 2011


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


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


More information about the Chimera-users mailing list