[Chimera-users] Chimera AddH questions

Eric Pettersen pett at cgl.ucsf.edu
Wed Oct 31 15:12:01 PDT 2007

On Oct 31, 2007, at 2:25 PM, Diep Quang Vinh wrote:

> Dear Eric,
> Could you please do me an other favor? Could you please tell me how  
> to do your instructions automatic by command line? Since I will  
> deal with a hundreds of files like those and I have to add Hydrogen  
> atom to these file.

Hi Vinh,
	There is no command-line equivalent for Build Structure, so you have  
to resort to Python here.  Here's the Python code to change the  
currently selected atom the same way you did by hand:

from BuildStructure import changeAtom
from chimera import selection, Element
changeAtom(selection.currentAtoms()[0], Element("C"), 3, 3, name="C")

If you put the above into a script named addCH.py, then you can use  
these commands to add the hydrogen:

sel :2.A at C
open C:\<wherever you put the script>\addCH.py

You might want to use the "alias" command for the above so you don't  
have to type so much.


> ----- Original Message ----- From: "Eric Pettersen"  
> <pett at cgl.ucsf.edu>
> To: "Diep Quang Vinh" <vdiep at purdue.edu>
> Sent: Wednesday, October 31, 2007 4:01 PM
> Subject: Re: Chimera AddH questions
>> You're welcome.  Glad I could help.
>> --Eric
>> On Oct 31, 2007, at 12:15 PM, Diep Quang Vinh wrote:
>>> Dear Eric,
>>> Thank you very much for your help. It works right now. I  
>>> appriciate  that so much.
>>> Thanks.
>>> Vinh
>>> ----- Original Message ----- From: "Eric Pettersen"   
>>> <pett at cgl.ucsf.edu>
>>> To: <vdiep at purdue.edu>
>>> Cc: "chimera BB" <chimera-users at cgl.ucsf.edu>
>>> Sent: Wednesday, October 31, 2007 2:32 PM
>>> Subject: Chimera AddH questions
>>>> On Oct 31, 2007, at 8:41 AM, chimera-bugs at cgl.ucsf.edu wrote:
>>>>> The following bug report has been submitted:
>>>>> Submitter Name:  Vinh
>>>>> Submitter Email: vdiep
>>>>> Platform:        windows
>>>>> Chimera Version: 1
>>>>> Description
>>>>> Hello, I would like to ask you some questions concern about  
>>>>> addh command.
>>>>> 1. I had an molecule which has 2-residues and one of them has  
>>>>> an termini -CO. This molecule is in fact was cut from a  
>>>>> bigger   molecule and the original C have an bond with one H  
>>>>> atom. Now Can  I  by using addh command, recover the original  
>>>>> configuration? I  mean  there is only one Hydrogen added to  
>>>>> this Carbon. Since when  I did  it, chimera gave the an extra  
>>>>> Oxigen and not an Hydrogen.
>>>> When Chimera looks at a peptide chain with an incomplete C   
>>>> terminus, it tries to deduce (by looking at SEQRES records)   
>>>> whether that  residue is really the C terminus or is instead   
>>>> simply the last  residue in a chain that is partially missing.    
>>>> I'm guessing that your  structure file didn't have any SEQRES   
>>>> records, so Chimera guessed  that the ending amino acid was  
>>>> really  the C terminus and therefore  made the C-O moiety into a  
>>>> carboxylate.
>>>> If all you want to do is add a single hydrogen to that carbon,   
>>>> you should use the Build Structure tool to do that.  Here's how:
>>>> control-double click on the carbon
>>>> choose "Modify Atom" from the menu that pops up
>>>> In the Build Structure dialog that comes up, change the   
>>>> "Geometry"  to "planar" and the "Name" back to "C"
>>>> click on the "Change" button -- your hydrogen will be added
>>>>> I try to add the hydrogen for example:
>>>>> first : addh
>>>>> then : addh spec :2.A at C
>>>>> but both of them give me the same answer and on top of that it   
>>>>> adds one more H on the other nearby Nitrogen.
>>>> The smallest thing addh can add hydrogens to is an entire  
>>>> model.   If you specify something smaller, the entire model  
>>>> still gets   protonated. This limitation is mentioned in the  
>>>> addh documentation.
>>>> --Eric
>>>>                         Eric Pettersen
>>>>                         UCSF Computer Graphics Lab
>>>>                         pett at cgl.ucsf.edu
>>>>                         http://www.cgl.ucsf.edu

More information about the Chimera-users mailing list