# Help: Error encountered in gmx hbond hydrogen bond calculation

**URL:** <https://gromacs.bioexcel.eu/t/help-error-encountered-in-gmx-hbond-hydrogen-bond-calculation/12192>\
**Category:** User discussions\
**Tags:** gmx-hbond\
**Created:** [June 4, 2025, 5:53am UTC](https://gromacs.bioexcel.eu/t/help-error-encountered-in-gmx-hbond-hydrogen-bond-calculation/12192 "2025-06-04T05:53:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yolo-kk](https://avatars.discourse-cdn.com/v4/letter/y/9dc877/32.png) [@Yolo-kk](https://gromacs.bioexcel.eu/u/Yolo-kk)\
**Post date:** [June 4, 2025, 5:53am UTC](https://gromacs.bioexcel.eu/t/help-error-encountered-in-gmx-hbond-hydrogen-bond-calculation/12192/1 "2025-06-04T05:53:19Z")

</div>

GROMACS version:2023.3  
GROMACS modification: Yes/No  
Hello everyone, I currently want to use the `gmx hbond` command to calculate hydrogen bonds between specified protein atom groups. First, I generated the specified atom groups using the command `gmx make_ndx -f result.gro -o index.ndx`. Then, I processed the trajectory file with `gmx trjconv -f result.xtc -s md.tpr -o 40-50ns.xtc -b 40000 -e 50000 -pbc mol -center -ur compact` to center the protein and save a 10ns trajectory file. Finally, I used the command `gmx hbond -f 40-50ns.xtc -s md.tpr -n index.ndx -num -hbn -hbm` to generate three files: `hbmap.xpm`, `hbnum.xvg`, and `hbond.ndx`. The `hbmap.xpm` and `hbnum.xvg` files are shown in the figures below. However, in the `[hbonds_Protein]` section of the `hbond.ndx` file, the specific atoms forming the hydrogen bonds are not correctly displayed, and the middle atom always shows an index of -1. Could anyone explain what might be causing this issue?  
hbond.ndx:

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/d/d14b673ce9444f3bafb1b8b7975e4b58e86972c6.png)  
hbnum.xvg:  
 ![image](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/5/58abecd65b75d223a423df60dfbfd7fa9886ebf4.png)

---

<div class="post-metadata">

**Author:** ![hess](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/hess/32/416_2.png) [@hess](https://gromacs.bioexcel.eu/u/hess)\
**Post date:** [June 4, 2025, 7:28am UTC](https://gromacs.bioexcel.eu/t/help-error-encountered-in-gmx-hbond-hydrogen-bond-calculation/12192/2 "2025-06-04T07:28:59Z")

</div>

Could you try the gmx hbond tool in the 2025 release? There has been a complete rewrite of the code and the issue is likely fixed there.

---

<div class="post-metadata">

**Author:** ![Yolo-kk](https://avatars.discourse-cdn.com/v4/letter/y/9dc877/32.png) [@Yolo-kk](https://gromacs.bioexcel.eu/u/Yolo-kk)\
**Post date:** [June 4, 2025, 7:34am UTC](https://gromacs.bioexcel.eu/t/help-error-encountered-in-gmx-hbond-hydrogen-bond-calculation/12192/3 "2025-06-04T07:34:31Z")

</div>

Okay, thank you for the reminder. I’ll give it a try
