[Chimera-users] Add reasonable bonds from command line

Eric Pettersen pett at cgl.ucsf.edu
Mon Dec 29 12:07:42 PST 2014

On Dec 28, 2014, at 2:09 AM, Enrico Ronca <enrico at thch.unipg.it> wrote:

> Dear Sir.
> I'm Enrico Ronca a post-doc researcher at the National Research Council of Italy in Perugia.
> I'm contacting you because I often work with metal atoms and not always chimera show me bonds.
> I solved the problem removing all bonds and pseudo bonds and adding "reasonable bond between selected atoms" in the adjust bonds menu of chimera.
> Is there a way to run the same procedure from the command line so that I could automate it by a script?

Hi Enrico,
	There is no command line equivalent for the "all reasonable bonds" function, nor is there a command for deleting pseudobonds.  So you have to resort to Python.  Basically collating the "reasonable bond" code (from the _addBonds method in <your Chimera installation>/share/BuildStructure/gui.py) with custom code to close metal pseudobond groups and then additional calls to regular Chimera commands to select atoms and delete bonds.  I've attached a file (rebond.py) that contains all that code.  If you put the file in your home directory, then the command "open ~/rebond.py" will execute the code and do what you want.
	Normally I would not recommend adding "normal" (covalent) bonds rather than pseudobonds to metal ions since that will screw up many chemistry related functions in Chimera (e.g. adding hydrogens; finding H-bonds; minimization) but I suppose you know what you're doing!  Maybe these are actual metal compounds instead of coordination complexes?


                        Eric Pettersen
                        UCSF Computer Graphics Lab

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

More information about the Chimera-users mailing list