# Error when adding new residue to hdb (CHARMM36)

**URL:** <https://gromacs.bioexcel.eu/t/error-when-adding-new-residue-to-hdb-charmm36/4364>\
**Category:** User discussions\
**Tags:** pdb2gmx, forcefield\
**Created:** [June 26, 2022, 2:05am UTC](https://gromacs.bioexcel.eu/t/error-when-adding-new-residue-to-hdb-charmm36/4364 "2022-06-26T02:05:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dom](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@dom](https://gromacs.bioexcel.eu/u/dom)\
**Post date:** [June 26, 2022, 2:05am UTC](https://gromacs.bioexcel.eu/t/error-when-adding-new-residue-to-hdb-charmm36/4364/1 "2022-06-26T02:05:39Z")

</div>

GROMACS version:2022.2  
GROMACS modification: No

I am adding a new protein residue to the CHARMM36 forcefield (July 2021). As per the instructions in the GROMACS manual (“Adding a Residue to a Force Field”), I modified residuetypes.dat, aminoacids.rtp, and aminoacids.hdb with the new residue entry. It seems that all bonds in the residue already exist in the forcefield.

After I execute pdb2gmx and select CHARMM36 with the updated TIP3P water model, I receive the following output:

> Opening force field file ./charmm36-jul2021.ff/atomtypes.atp
> 
> Reading residue database… (Charmm36-jul2021)  
> Opening force field file ./charmm36-jul2021.ff/aminoacids.rtp  
> Opening force field file ./charmm36-jul2021.ff/carb.rtp  
> Opening force field file ./charmm36-jul2021.ff/cgenff.rtp  
> Opening force field file ./charmm36-jul2021.ff/ethers.rtp  
> Opening force field file ./charmm36-jul2021.ff/lipid.rtp  
> Opening force field file ./charmm36-jul2021.ff/metals.rtp  
> Opening force field file ./charmm36-jul2021.ff/na.rtp  
> Opening force field file ./charmm36-jul2021.ff/silicates.rtp  
> Opening force field file ./charmm36-jul2021.ff/solvent.rtp  
> Opening force field file ./charmm36-jul2021.ff/aminoacids.hdb
> 
> * * *
> 
> Program: gmx pdb2gmx, version 2022.2  
> Source file: src/gromacs/gmxpreprocess/h\_db.cpp (line 180)
> 
> ## Fatal error: Error reading from file ./charmm36-jul2021.ff/aminoacids.hdb

When there is a problem with the .hdb file format, I am notified of the formatting error, which suggests that the command can access the file, so it’s not a permissions issue. I’ve formatted the new entry exactly as the others in the .hdb file.

Could anyone suggest the origin of this error and/or how I might go about solving it? I can provide the new entries, or any other information, if needed. Thank you for your time.

---

<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:** [June 26, 2022, 2:17am UTC](https://gromacs.bioexcel.eu/t/error-when-adding-new-residue-to-hdb-charmm36/4364/2 "2022-06-26T02:17:13Z")

</div>

Please provide the details of everything you changed in the files. Make sure you’re using a plain-text editor and you don’t have any weird line endings (use `dos2unix` if needed).

---

<div class="post-metadata">

**Author:** ![dom](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@dom](https://gromacs.bioexcel.eu/u/dom)\
**Post date:** [June 26, 2022, 3:19pm UTC](https://gromacs.bioexcel.eu/t/error-when-adding-new-residue-to-hdb-charmm36/4364/3 "2022-06-26T15:19:52Z")

</div>

I’ve attached a .txt file with the entries I added (modifications.txt). I created it in a plain-text editor (Notepad) and there shouldn’t be anything strange about the lines.

For clarity, I also added the modified .hdb, .dat, and .rtp files.

[https://drive.google.com/drive/folders/1FsH3fSlGW7j63Ee7JdjXvCYIGvCZtDF0?usp=sharing](https://drive.google.com/drive/folders/1FsH3fSlGW7j63Ee7JdjXvCYIGvCZtDF0?usp=sharing)

---

<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:** [June 26, 2022, 3:58pm UTC](https://gromacs.bioexcel.eu/t/error-when-adding-new-residue-to-hdb-charmm36/4364/4 "2022-06-26T15:58:11Z")

</div>

The problem is that you specify 10 lines for the `.hdb` entry but there are 11. This causes the file to be parsed incorrectly.
