[Chimera-users] How to change colour of H-bond between atoms

Elaine Meng meng at cgl.ucsf.edu
Thu Dec 18 09:29:35 PST 2014

Dear Mahendra Thapa, 
You can Ctrl-click to select the H-bond, then click the green magnifying glass icon near the bottom right of the Chimera window to open the Selection Inspector.  In the Selection Inspector (Inspect: Pseudobond), you can click the color square to bring up the Color Editor, in which you can change the color.  You can't change the width of only one H-bond, but you can change the width of all of them at the same time:  in the Selection Inspector, change to Inspect: Pseudobond group, then change the line width value.

You can also set the linewidth in the FindHBond dialog, or with an option in the findhbond command, when you show the H-bonds in the first place:

To use only commands…
If you put the mouse cursor over the entries in the Selection Inspector dialog, it shows balloon help that includes the attribute name that could be used in the command line with the "setattr" command ("bondcolor" is only for covalent bonds).   Again, you can change color individually for a pseudobond ("p" in example below) but linewidth only for all H-bonds ("g" for pseudobond group), example commands:

setattr p color red :240 at H20:120 at O
setattr g lineWidth 3 :240 at H20:120 at O


You can see the other changeable properties in the Selection Inspector and whether they apply to an individual pseudobond or a whole group.  I still included the atom specification in the second example so it will only affect the H-bond group.  There might be other pseudobond groups like metal-complex bonds that you didn't want to change.  If you didn't include the atom specifications, it would set ALL pseudobond groups to that thickness:

setattr g lineWidth 2

I hope this helps,
Elaine C. Meng, Ph.D. 
UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab
Department of Pharmaceutical Chemistry
University of California, San Francisco

On Dec 17, 2014, at 8:00 PM, Mahendra B Thapa <thapamb at mail.uc.edu> wrote:

> Dear Chimera Users,
>               There is a hydrogen bond between, say, H20 of a ligand (LIG,res no: 240; this H-atom is attached with N atom of LIG) and O atom of GLU 120 residue. There are other hydrogen bonds too, but I am interested to change the color of that H-bond only to, say, red. I tried some like
> bondcolor red :240 at H20
> But, it is not working. Any suggestion might help me. Also, is there any way to change width of the H-bond?
> Thank you,
> Mahendra Thapa
> University of Cincinnati,OH

More information about the Chimera-users mailing list