Problems creating a covalent bond between a protein and a ligand in GROMACS

GROMACS version: GROMACS/2024.4-foss-2023b

I am following the tutorial “Modelling Post-Translationally Modified Proteins with GROMACS” (DR Anthony Nash, 2019) to create a covalent bond between the cysteine residue of the scFv and the DOX-maleimide molecule (designated as DM2 in the PDB file).

The goal is for pdb2gmx to automatically recognize and create the S–C (thioether) bond between the SG atom of cysteine 770 and the C36 atom of the maleimide group (residue DM2).

The files I modified were:

aminoacids.rtp – I added a new block [ DM2 ] containing all atoms, charges, and bonds corresponding to the DOX-maleimide structure (obtained from ACPYPE).

residuetypes.dat – I added the line:

DM2 Protein

so that pdb2gmx recognizes the residue as part of the protein.

specbond.dat – I added the line:

CYS SG 1 DM2 C36 1 0.16 CYX DM2

to create the covalent bond between the CYS and DM2 residues.

aminoacids.r2b – I added the line:

DM2 DM2 - - -

ffbonded.itp – I added the line:

S C 1 0.18200 251000.0

I did not modify aminoacids.hdb or ffnonbonded.itp.
I also did not modify the atomtypes.atp file, because in the aminoacids.rtp file I had already replaced the generic atom types (such as n, c3, ca, o, os, oh, hn, ha, etc.) with the corresponding atom types defined in the AMBER force field — namely N, C, CT, CA, O, OS, OH, H, HC, HA, HO, among others.
In the PDB file containing both molecules(scFv and DM2), I only removed the hydrogen atom that was bonded to the carbon C36 of the maleimide group in the DM2 residue.

Initially, the files residuetypes.dat and specbond.dat were placed outside the force field folder, but in the same directory containing the folder amber99sb-ildn-DOX-local.ff.

When I executed the command:

gmx pdb2gmx -f scFv_DOX.pdb -o scFv_DOX_processed.gro -p topol.top -ff amber99sb-ildn-DOX-local -merge all -water tip3p -v

I obtained the following error:

WARNING: File is empty

free(): double free detected in tcache 2

Aborted (core dumped)

After moving the files residuetypes.dat and specbond.dat inside the force field folder

(amber99sb-ildn-DOX-local.ff/), this error disappeared.

However, new behaviors emerged depending on how the chains are defined in the PDB file.

Case 1 — Protein and DM2 in the same chain

The pdb2gmx command results in the following error:

Fatal error:

The residues in the chain DM21–LEU923 do not have a consistent type. The

first residue has type ‘Other’, while residue HIS621 is of type ‘Protein’.

Either there is a mistake in your chain, or it includes nonstandard residue

names that have not yet been added to the residuetypes.dat file in the GROMACS

library directory. If there are other molecules such as ligands, they should

not have the same chain ID as the adjacent protein chain since it’s a separate

molecule.

This error occurs even though the residue DM2 was already added to residuetypes.dat as Protein.

Case 2 — Protein and DM2 in different chains

In this case, pdb2gmx runs without fatal errors, but does not create the covalent bond defined in specbond.dat.

The program indicates that it read only 9 lines from the specbond.dat file, even though the line defining the CYS–DM2 bond is the tenth line.

This suggests that GROMACS is ignoring the last line of the file (possibly due to formatting issues or because it does not recognize the residue type DM2 as Protein at the time of reading).

Summary of questions

1 - Why do the files residuetypes.dat and specbond.dat cause the error:

“free(): double free detected in tcache 2” when they are located outside the force field folder, even if they are in the same directory?

2 - Why does pdb2gmx still recognize DM2 as “Other” even after adding “DM2 Protein” to residuetypes.dat?

3 - Why does specbond.dat read only 9 lines, ignoring the tenth (which defines the CYS–DM2 bond)?

4 - What is the correct way to structure the PDB file (so that pdb2gmx correctly recognizes the specbond and creates the covalent bond): should CYS and DM2 be in the same chain or in different chains?

Perhaps this doesn’t address the problem directly, but a while back I wrote a tutorial for making conjugates with Gromologist - let me know if that’d work for your case:

Creating a conjugate · Wiki · KBM / Gromologist · GitLab