# Adding new residue to charmmForcefield

**URL:** <https://gromacs.bioexcel.eu/t/adding-new-residue-to-charmmforcefield/4409>\
**Category:** User discussions\
**Tags:** pdb2gmx\
**Created:** [July 4, 2022, 6:54pm UTC](https://gromacs.bioexcel.eu/t/adding-new-residue-to-charmmforcefield/4409 "2022-07-04T18:54:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![deebee](https://avatars.discourse-cdn.com/v4/letter/d/e56c9b/32.png) [@deebee](https://gromacs.bioexcel.eu/u/deebee)\
**Post date:** [July 4, 2022, 6:54pm UTC](https://gromacs.bioexcel.eu/t/adding-new-residue-to-charmmforcefield/4409/1 "2022-07-04T18:54:48Z")

</div>

GROMACS version: 2022  
GROMACS modification: Yes  
Hello,

I am trying to convert my itp to rtp as to add a new residue to my FF (charm36)  
I converted my itp and added it to my rtp

```auto
; Name			   
[AMA]				

[atoms]
; Atom type charge		
     O1 OG311 -0.553 1 ;
     O2 OG2D1 -0.548 2 ;
     N1 NG321 -1.077 3 ;
     N2 NG2D1 -0.824 4 ;
     N3 NG301 -0.137 5 ;
     N4 NG321 -0.502 6 ;
     C1 CG321 -0.281 7 ;
     C2 CG321 -0.196 8 ;
     C3 CG311 0.326 9 ;
     C4 CG321 0.015 10 ;
     C5 CG2O2 0.779 11 ;
     C6 CG2N1 0.500 12 ;
     C7 CG331 -0.207 13 ;
     C8 CG331 -0.207 14 ;
     H1 HGA2 0.090 15 ;
     H2 HGA2 0.090 16 ;
     H3 HGA2 0.090 17 ;
     H4 HGA2 0.090 18 ;
     H5 HGA1 0.090 19 ;
     H6 HGA2 0.090 20 ;
     H7 HGA2 0.090 21 ;
     H8 HGPAM2 0.396 22 ;
     H9 HGPAM2 0.396 23 ;
    H10 HGA3 0.090 24 ;
    H11 HGA3 0.090 25 ;
    H12 HGA3 0.090 26 ;
    H13 HGA3 0.090 27 ;
    H14 HGA3 0.090 28 ;
    H15 HGA3 0.090 29 ;
    H16 HGPAM2 0.330 30 ;
    H17 HGPAM2 0.330 31 ;
    H18 HGP1 0.290 32 ;

```

then when I run pdb2gmx the pdb coordnates dont match the rtp

```auto
Program: gmx pdb2gmx, version 2022
Source file: src/gromacs/gmxpreprocess/pdb2gmx.cpp (line 873)

Fatal error:
Atom C in residue AMA 130 was not found in rtp entry AMA with 32 atoms
while sorting atoms.

```

can someone help me understand how to add a new residue

 ![ama](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/f/f12488e552413614727210f2e7ef5726e7dd2056.jpeg)

pdb

```auto
ATOM 833 O1 AMA A 133 -4.082 -0.118 -1.252 1.00 0.00 O
ATOM 834 O2 AMA A 133 -3.776 -0.825 0.814 1.00 0.00 O
ATOM 835 N1 AMA A 133 -2.586 1.978 0.882 1.00 0.00 N
ATOM 836 N2 AMA A 133 1.828 -1.071 0.125 1.00 0.00 N
ATOM 837 N3 AMA A 133 3.317 0.328 -0.198 1.00 0.00 N
ATOM 838 N4 AMA A 133 2.932 -1.150 1.185 1.00 0.00 N
ATOM 839 C1 AMA A 133 -0.991 0.166 0.328 1.00 0.00 C
ATOM 840 C2 AMA A 133 -0.503 -0.790 -0.788 1.00 0.00 C
ATOM 841 C3 AMA A 133 -2.305 0.885 -0.063 1.00 0.00 C
ATOM 842 C4 AMA A 133 0.581 -1.776 -0.300 1.00 0.00 C
ATOM 843 C5 AMA A 133 -3.476 -0.083 -0.098 1.00 0.00 C
ATOM 844 C6 AMA A 133 2.753 -0.486 0.318 1.00 0.00 C
ATOM 845 C7 AMA A 133 4.796 0.514 -0.140 1.00 0.00 C
ATOM 846 C8 AMA A 133 2.662 1.663 -0.302 1.00 0.00 C
ATOM 847 H1 AMA A 133 -0.218 0.910 0.528 1.00 0.00 H
ATOM 848 H2 AMA A 133 -1.147 -0.390 1.256 1.00 0.00 H
ATOM 849 H3 AMA A 133 -1.344 -1.383 -1.156 1.00 0.00 H
ATOM 850 H4 AMA A 133 -0.129 -0.210 -1.636 1.00 0.00 H
ATOM 851 H5 AMA A 133 -2.200 1.317 -1.064 1.00 0.00 H
ATOM 852 H6 AMA A 133 0.191 -2.356 0.542 1.00 0.00 H
ATOM 853 H7 AMA A 133 0.826 -2.468 -1.110 1.00 0.00 H
ATOM 854 H8 AMA A 133 -3.478 2.412 0.646 1.00 0.00 H
ATOM 855 H9 AMA A 133 -1.875 2.701 0.809 1.00 0.00 H
ATOM 856 H10 AMA A 133 5.131 1.193 -0.930 1.00 0.00 H
ATOM 857 H11 AMA A 133 5.307 -0.443 -0.277 1.00 0.00 H
ATOM 858 H12 AMA A 133 5.085 0.932 0.830 1.00 0.00 H
ATOM 859 H13 AMA A 133 2.631 2.148 0.680 1.00 0.00 H
ATOM 860 H14 AMA A 133 1.641 1.564 -0.681 1.00 0.00 H
ATOM 861 H15 AMA A 133 3.210 2.309 -0.995 1.00 0.00 H
ATOM 862 H16 AMA A 133 2.885 -1.504 2.139 1.00 0.00 H
ATOM 863 H17 AMA A 133 3.597 -1.743 0.690 1.00 0.00 H
ATOM 864 H18 AMA A 133 -4.815 -0.755 -1.160 1.00 0.00 H

```

---

<div class="post-metadata">

**Author:** ![jalemkul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/jalemkul/32/18_2.png) [@jalemkul](https://gromacs.bioexcel.eu/u/jalemkul)\
**Post date:** [July 7, 2022, 3:53am UTC](https://gromacs.bioexcel.eu/t/adding-new-residue-to-charmmforcefield/4409/2 "2022-07-07T03:53:47Z")

</div>

This is identical to your other issue: [New residue top](https://gromacs.bioexcel.eu/t/new-residue-top/4405)

Note, too, that using the atom name O2 is going to cause problems, because `pdb2gmx` is going to translate it to OXT and try to terminate the chain. Use a different name. O1 may also be problematic, check `xlateat.dat` in `$GMXLIB`.

---

<div class="post-metadata">

**Author:** ![deebee](https://avatars.discourse-cdn.com/v4/letter/d/e56c9b/32.png) [@deebee](https://gromacs.bioexcel.eu/u/deebee)\
**Post date:** [July 7, 2022, 4:41pm UTC](https://gromacs.bioexcel.eu/t/adding-new-residue-to-charmmforcefield/4409/3 "2022-07-07T16:41:58Z")

</div>

Thank you  
I now have a complete model and have renamed my atoms  
pdb

```auto
ATOM 1648 N AMA A 133 5.590 58.089 0.490 1.00 48.56 N  
ATOM 1649 CA AMA A 133 5.170 59.183 1.347 1.00 48.56 C  
ATOM 1650 C AMA A 133 5.848 60.488 0.954 1.00 48.56 C  
ATOM 1651 O AMA A 133 5.182 61.513 0.802 1.00 48.56 O  
ATOM 1652 CB AMA A 133 5.443 58.855 2.817 1.00 57.81 C  
ATOM 1653 CG AMA A 133 4.451 57.855 3.410 1.00 57.81 C  
ATOM 1654 CD AMA A 133 4.497 57.861 4.930 1.00 57.81 C  
ATOM 1655 NE AMA A 133 5.783 57.394 5.439 1.00 57.81 N  
ATOM 1656 CZ AMA A 133 6.143 56.118 5.501 1.00 57.81 C  
ATOM 1657 NH1 AMA A 133 5.312 55.173 5.091 1.00 57.81 N1+
ATOM 1658 NH2 AMA A 133 7.337 55.789 5.966 1.00 57.81 N  
ATOM 1659 CQ1 AMA A 133 7.737 54.376 6.031 0.00 0.00 C  
ATOM 1660 CQ2 AMA A 133 8.264 56.837 6.418 0.00 0.00 C  
ATOM 1661 HA AMA A 133 4.096 59.313 1.215 1.00 48.56 H  
ATOM 1662 H03 AMA A 133 5.744 61.573 0.932 1.00 48.56 H  
ATOM 1663 HB1 AMA A 133 4.996 61.639 -0.131 1.00 48.56 H  
ATOM 1664 HB2 AMA A 133 5.338 59.783 3.378 1.00 57.81 H  
ATOM 1665 HD1 AMA A 133 6.446 58.437 2.898 1.00 57.81 H  
ATOM 1666 HD2 AMA A 133 4.722 56.858 3.063 1.00 57.81 H  
ATOM 1667 HG1 AMA A 133 3.445 58.117 3.084 1.00 57.81 H  
ATOM 1668 HG2 AMA A 133 3.725 57.183 5.293 1.00 57.81 H  
ATOM 1669 H11 AMA A 133 4.325 58.877 5.284 1.00 57.81 H  
ATOM 1670 H12 AMA A 133 4.473 55.599 4.723 1.00 57.81 H  
ATOM 1671 H1 AMA A 133 5.755 54.625 4.368 1.00 57.81 H  
ATOM 1672 H2 AMA A 133 6.054 57.286 0.891 1.00 48.56 H  
ATOM 1673 H3 AMA A 133 5.072 54.575 5.868 1.00 57.81 H  
ATOM 1674 H4 AMA A 133 7.998 54.041 5.070 0.00 0.00 H  
ATOM 1675 H5 AMA A 133 8.596 56.615 7.389 0.00 0.00 H  
ATOM 1676 H6 AMA A 133 6.938 53.802 6.397 0.00 0.00 H  
ATOM 1677 H7 AMA A 133 7.771 57.764 6.419 0.00 0.00 H  
ATOM 1678 H8 AMA A 133 8.562 54.275 6.672 0.00 0.00 H  
ATOM 1679 H9 AMA A 133 9.087 56.879 5.768 0.00 0.00 H  

```

I rewrote my AMA rtp based on arg and 2mr  
I dont understand the code of the hbd.dat

I am working on a nontraditional residues guide do you know of other helpful material beyond the manual?

I tried copying and renaming the arginine hbd as AMA and I still cant generate a .gro despite my pdb

```auto
-------------------------------------------------------
Program: gmx pdb2gmx, version 2022
Source file: src/gromacs/gmxpreprocess/add_par.cpp (line 165)

Fatal error:
Atom HH11 not found in rtp database in residue AMA, it looks a bit like HN

```

my rtp

```auto
 [atoms]
        N NH1 -0.4700 1; peptide nitrogen
       HN H 0.3100 1;polar H
       CA CT1 0.0700 1; aliphatic sp3 C for CH
       HA HB1 0.0900 1; backbone H
       CB CT2 -0.1800 2;aliphatic sp3 C for CH2
      HB1 HA2 0.0900 2; alkane, CH2, new LJ params
      HB2 HA2 0.0900 2;alkane, CH2, new LJ params
       CG CT2 -0.1800 3;aliphatic sp3 C for CH2
      HG1 HA2 0.0900 3;alkane, CH2, new LJ params
      HG2 HA2 0.0900 3;alkane, CH2, new LJ params
       CD CT2 0.2000 4;aliphatic sp3 C for CH2
      HD1 HA2 0.0900 4;alkane, CH2, new LJ params
      HD2 HA2 0.0900 4;alkane, CH2, new LJ params
       NE NC2 -0.7000 4;guanidinium nitrogen
       HE HC 0.4400 4;N-ter H
       CZ C 0.6400 4;carbonyl C, peptide backbone
      NH1 NC2 -0.8000 4;guanidinium nitrogen
      H11 HC 0.4600 4;N-ter H
      NH2 NC2 -0.8000 4;guanidinium nitrogen
      CQ1 CG334 0.1100 4;aliphatic C for methyl group (-CH3
       H1 HGA3 0.0900 4;alphatic proton, CH3
       H2 HGA3 0.0900 4;alphatic proton, CH3
       H3 HGA3 0.0900 4;alphatic proton, CH3
      CQ2 CG334 0.1100 4;aliphatic C for methyl group (-CH3
       H4 HGA3 0.0900 4;alphatic proton, CH3
       H5 HGA3 0.0900 4;alphatic proton, CH3
       H6 HGA3 0.0900 4;alphatic proton, CH3  
        C C 0.5100 5; carbonyl C, peptide backbone
        O O -0.5100 5; carbonyl oxygen 

```

---

<div class="post-metadata">

**Author:** ![jalemkul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/jalemkul/32/18_2.png) [@jalemkul](https://gromacs.bioexcel.eu/u/jalemkul)\
**Post date:** [July 8, 2022, 1:46am UTC](https://gromacs.bioexcel.eu/t/adding-new-residue-to-charmmforcefield/4409/4 "2022-07-08T01:46:55Z")

</div>

Please provide the content of your `.hdb` entry for AMA.

---

<div class="post-metadata">

**Author:** ![deebee](https://avatars.discourse-cdn.com/v4/letter/d/e56c9b/32.png) [@deebee](https://gromacs.bioexcel.eu/u/deebee)\
**Post date:** [July 8, 2022, 1:23pm UTC](https://gromacs.bioexcel.eu/t/adding-new-residue-to-charmmforcefield/4409/5 "2022-07-08T13:23:00Z")

</div>

aminoacids.hbd

```auto
AMA 8
1 1 HN N CA -C     
1 5 HA CA N CB C      
2 6 HB CB CG CA     
2 6 HG CG CB CD     
2 6 HD CD CG NE     
1 1 HE NE CZ CD     
2 3 HH1 NH1 CZ NH2    
2 3 HH2 NH2 CZ NH1     

```

also how do I correctly add the bonds angles and dihedrals. my AMA only contains atoms and types

---

<div class="post-metadata">

**Author:** ![jalemkul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/jalemkul/32/18_2.png) [@jalemkul](https://gromacs.bioexcel.eu/u/jalemkul)\
**Post date:** [July 10, 2022, 3:04am UTC](https://gromacs.bioexcel.eu/t/adding-new-residue-to-charmmforcefield/4409/6 "2022-07-10T03:04:59Z")

</div>

Let me save you some work - your residue is already in the CHARMM force field as residue DA2.

As for the core questions:

> [@deebee](#):
>
> also how do I correctly add the bonds angles and dihedrals. my AMA only contains atoms and types

Only bonds are mandatory to specify; `pdb2gmx` works out the angles and dihedrals based on bonded connectivity. You simply specify which atoms are bonded. This is fairly simple for a slight modification of an existing residue, you just update those bonds. CHARMM also requires a `[cmap]` directive, but that’s boilerplate since it’s the same for all residues (unless you’re toying with the backbone, but that’s not relevant here).

As for the `.hdb` file, again work from an existing residue if possible, and make small adjustments. The issue with your file is that you are specifying that two H atoms will be added to NH1, and they have the base name of HH1. So `pdb2gmx` will then build on HH11 and HH12. You have neither in your `.rtp` file, and the PDB coordinates have entirely different names, except H11 and H12 but they’re both connected to entirely different atoms when I visualize the coordinates you provided. That coordinate file is a total mess though, with a strained geometry and very haphazard atom naming. I don’t know how to work off of that, and would suggest rebooting and making all nomenclature consistent with a parent ARG residue, then making small adjustments to generate the desired residue. But again, it’s all sort of a moot point because what you need is already in the force field here. Make sure your residue and atom names in the PDB file are consistent with what the `.rtp` entry expects, and let fly with `pdb2gmx`. Make sure you are using the July 2021 version of the CHARMM36 port and you’re covered.
