Modifying a forcefield to include custom residues

GROMACS version: 2022
GROMACS modification: Yes

Hello, I currently want to simulate interactions between hexagonal boron nitride and different amino-acids, and I tried to modify the CHARMM27 forcefield as described in the following article’s supplementary materials ( by adding residues and values to “atomtypes.atp”, “ffnonbonded.itp”, and added a “bn.itp” file that I included in the “forcefield.itp” file (everything in the charmm27.ff folder). However, when I run the gromacs command “gmx pdb2gmx -f myfile.pdb”, I get the following error: “Residue ‘BN’ not found in residue topology database”.
Did I do anything wrong to build this topology or miss any step?


First check the common errors:

Also consider:

  • After running pdb2gmx, check the file to ensure that the ‘BN’ residue is correctly listed and referenced. The [ moleculetype ] and [ atoms ] sections should include the necessary information.

  • Ensure that GROMACS is using the modified forcefield files