[gmx-developers] modify pdb2gmx and/or g_protonate in order to add specific hydrogen name
Berk Hess
hess at kth.se
Mon Feb 4 10:04:06 CET 2013
Hi,
I guess a single character change in the code should do it.
Try changing line 279 of src/kernel/genhydro.c (in version 4.6) from
(*abi)[*nabi + k].nname[l] = '1' + k;
to
(*abi)[*nabi + k].nname[l] = 'A' + k;
A proper solution would be to allow setting this starting character in
the hdb file.
Cheers,
Berk
On 02/04/2013 10:00 AM, Landry Charlier wrote:
> Thank you for yours answers.
>
> I have already tried the solution of Dr. Abraham. Indeed for POPC I have:
> - created a "clone" for POPC. Indeed, if i put the line "3 4 H13 C13 N
> C12" in the lipid.hdb file, pdb2gmx will bug by saying that the atom
> H131 is not in the residue POPC.
> So i have created the residue POPD, a clone of POPC in the lipid.rtp
> but with changes for the hydrogen names.
> - filled the lipid.hdb for the residue POPD
> - done a script with the sed command the change the residue name (POPD
> to POPC) and the hydrogen names.
>
> The problem is that I don't only work on POPC, I work on all the
> lipids contains in the charmm36. So I have to create a clone and a
> script for each lipid. Before doing all these steps, I have written
> this mail in order to know if there is an other solution.
>
> I think that the better (but may be not the easier) solution is to
> change the code. I will try the trick of Emanuel and if it's not good,
> I will do all the clones and scripts.
>
> Landraille
>
>
>
>
>
>
>
> Mark Abraham <mark.j.abraham at gmail.com> a écrit :
>
>> On Fri, Feb 1, 2013 at 7:40 PM, Emanuel Peter <
>> Emanuel.Peter at chemie.uni-regensburg.de> wrote:
>>
>>> I would try in the hdb entry
>>>
>>> H12A C13 N C12
>>> H13B C13 N C14
>>> H13C C13 N C15
>>>
>>> or
>>>
>>> H12A C13 C12 C14
>>> H13B C13 C12 C15
>>> H13C C13 N C16
>>>
>>> and then afterwards minimize.....
>>>
>>> Others might know a better way.
>>> This way was (for me) the easiest way.
>>> After minimization I got a reasonable protonation.
>>>
>>
>> Even if you can abuse pdb2gmx to put three hydrogens in like this, you
>> still have to get lucky that EM can sort out the problems. If it's
>> only a
>> naming problem, it's much more reliable to rename the atoms...
>>
>> Best and good luck,
>>>
>>> Emanuel
>>>
>>> >>> Landry Charlier <landry.charlier at univ-montp1.fr> 02/01/13 12:51
>>> AM >>>
>>>
>>>
>>> Hello,
>>>
>>> I have some problems in order to automatically add hydrogen to lipids
>>> with charmm36 force field. Indeed, when several hydrogen have to be
>>> added to the same atom, the command pdb2gmx -ignh or g_protonate add
>>> them with the same name but with the last number incremented by 1
>>> thanks to the .hdb file.
>>>
>>> Example : for charmm36, the hydrogens added to the CB atom of ARG are
>>> named HB1 & HB2 thanks to the line "2 6 HB CB CG CA" in the
>>> aminoacids.hdb file.
>>>
>>> For lipids, the hydrogen names differ by a letter. H13A, H13B H13C are
>>> linked to C13 in POPC in charmm36 for example.
>>>
>>> I would like to modify g_protonate or pdb2gmx in order to add hydrogen
>>> with a specific name like that:
>>> - If only 1 name is written in hdb file and several atoms have to be
>>> added, the hydrogen names have been incremented by 1 as it's by
>>> default (see the example of Arg above).
>>> - If there are as many names as the number of hydrogen to add, pdb2gmx
>>> and/or g_protonate will choose these names. The hdb file should be
>>> like this : 3 4 H13A,H13B,H13C C13 N C12
>>>
>>> But I check the g_protonate and pdb2gmx files in the source code and I
>>> am not enough good in programming for modify them.
>>>
>>> Could you help me please?
>>>
>>
>> You've not been completely clear on why you need the atoms named
>> differently, so I'll assume you need some output file from pdb2gmx to
>> have
>> atom names that match something else. If so, it is much easier to use
>> sed
>> three times to do the necessary changes than to think about touching C
>> code. For example:
>> sed -e 's/H131/H13A' infile > outfile
>>
>> Since you've got a script calling pdb2gmx anyway (hint, hint), you don't
>> even have to remember the magic words once you write them!
>>
>> Mark
>>
>
>
>
>
More information about the gromacs.org_gmx-developers
mailing list