Zinc problem while running pdb2gmx

GROMACS version: 2025.3-Homebrew
GROMACS modification: Yes/No

Hi, I’m trying to run gmx pdb2gmx on a protein–zinc complex using the CHARMM27 force field, but I keep getting this error:

My ultimate goal is to run MD with restraints on ZN and 3 HIS coordinating ZN (266,268,278) without any MCPB parameter or something like that

Fatal error:
Residue 'ZN' not found in residue topology database

this is the part of pdb that contains zinc ion

ATOM   2968  C   ASP A 315     -36.797   4.375  -8.741  1.00 15.00      A    C  
ATOM   2969  O   ASP A 315     -36.098   3.398  -8.434  1.00 15.00      A    O  
TER
HETATM 2970  ZN  ZN  Z1001     -37.232  -1.978  -4.906  1.00 15.00      Z   ZN
TER
ATOM   2971  N   MET B   1      17.112 -21.651  21.381  1.00 15.00      B    N  
ATOM   2972  HN  MET B   1      16.246 -21.280  21.658  1.00 15.00      B    H  

while executing i got

MacBookPro GROMACS % gmx pdb2gmx -f complex.pdb -o complex_processed.gro -p topol.top -i posre.itp -water tip3p -ff charmm27 -ignh -merge no

                 :-) GROMACS - gmx pdb2gmx, 2025.3-Homebrew (-:

Executable:   /opt/homebrew/bin/../Cellar/gromacs/2025.3_1/bin/gmx
Data prefix:  /opt/homebrew/bin/../Cellar/gromacs/2025.3_1
Working dir:  /Users/jiyunlee/Desktop/GROMACS
Command line:
  gmx pdb2gmx -f complex.pdb -o complex_processed.gro -p topol.top -i posre.itp -water tip3p -ff charmm27 -ignh -merge no

Using the Charmm27 force field in directory charmm27.ff

going to rename charmm27.ff/aminoacids.r2b
Opening force field file /opt/homebrew/bin/../Cellar/gromacs/2025.3_1/share/gromacs/top/charmm27.ff/aminoacids.r2b

going to rename charmm27.ff/rna.r2b
Opening force field file /opt/homebrew/bin/../Cellar/gromacs/2025.3_1/share/gromacs/top/charmm27.ff/rna.r2b
Reading complex.pdb...
Read '', 7442 atoms

Analyzing pdb file
Splitting chemical chains based on TER records or chain id changing.

There are 3 chains and 0 blocks of water and 960 residues with 7442 atoms

  chain  #res #atoms

  1 'A'   313   2460  

  2 'Z'     1      1  

  3 'B'   646   4981  

All occupancies are one
All occupancies are one
Opening force field file /opt/homebrew/bin/../Cellar/gromacs/2025.3_1/share/gromacs/top/charmm27.ff/atomtypes.atp

Reading residue database... (Charmm27)
Opening force field file /opt/homebrew/bin/../Cellar/gromacs/2025.3_1/share/gromacs/top/charmm27.ff/aminoacids.rtp
Opening force field file /opt/homebrew/bin/../Cellar/gromacs/2025.3_1/share/gromacs/top/charmm27.ff/dna.rtp
Opening force field file /opt/homebrew/bin/../Cellar/gromacs/2025.3_1/share/gromacs/top/charmm27.ff/lipids.rtp
Opening force field file /opt/homebrew/bin/../Cellar/gromacs/2025.3_1/share/gromacs/top/charmm27.ff/rna.rtp
Opening force field file /opt/homebrew/bin/../Cellar/gromacs/2025.3_1/share/gromacs/top/charmm27.ff/aminoacids.hdb
Opening force field file /opt/homebrew/bin/../Cellar/gromacs/2025.3_1/share/gromacs/top/charmm27.ff/dna.hdb
Opening force field file /opt/homebrew/bin/../Cellar/gromacs/2025.3_1/share/gromacs/top/charmm27.ff/lipids.hdb
Opening force field file /opt/homebrew/bin/../Cellar/gromacs/2025.3_1/share/gromacs/top/charmm27.ff/rna.hdb
Opening force field file /opt/homebrew/bin/../Cellar/gromacs/2025.3_1/share/gromacs/top/charmm27.ff/aminoacids.n.tdb
Opening force field file /opt/homebrew/bin/../Cellar/gromacs/2025.3_1/share/gromacs/top/charmm27.ff/dna.n.tdb
Opening force field file /opt/homebrew/bin/../Cellar/gromacs/2025.3_1/share/gromacs/top/charmm27.ff/rna.n.tdb
Opening force field file /opt/homebrew/bin/../Cellar/gromacs/2025.3_1/share/gromacs/top/charmm27.ff/aminoacids.c.tdb
Opening force field file /opt/homebrew/bin/../Cellar/gromacs/2025.3_1/share/gromacs/top/charmm27.ff/dna.c.tdb
Opening force field file /opt/homebrew/bin/../Cellar/gromacs/2025.3_1/share/gromacs/top/charmm27.ff/rna.c.tdb

Back Off! I just backed up topol.top to ./#topol.top.2#

Processing chain 1 'A' (2460 atoms, 313 residues)
Analysing hydrogen-bonding network for automated assignment of histidine
 protonation. 450 donors and 448 acceptors were found.
There are 757 hydrogen bonds
Will use HISE for residue 9
Will use HISE for residue 121
Will use HISE for residue 132
Will use HISE for residue 150
Will use HISE for residue 195
Will use HISE for residue 217
Will use HISE for residue 239
Will use HISD for residue 266
Will use HISD for residue 268
Will use HISE for residue 273
Will use HISE for residue 278
Will use HISE for residue 280
Will use HISE for residue 310

Identified residue CYS3 as a starting terminus.

Identified residue ASP315 as a ending terminus.
9 out of 9 lines of specbond.dat converted successfully
Special Atom Distance matrix:
                    CYS3    HIS9   MET20   CYS38   CYS54  MET112  HIS121
                     SG4   NE256   SD133   SG270   SG395   SD833  NE2906
    HIS9   NE256   2.285
   MET20   SD133   2.620   1.379
   CYS38   SG270   2.601   2.318   1.489
   CYS54   SG395   2.317   1.940   1.424   0.516
  MET112   SD833   2.414   3.159   2.253   1.998   2.244
  HIS121  NE2906   2.394   3.364   3.376   2.267   2.056   3.197
  HIS132  NE2992   3.147   4.289   3.405   2.966   3.255   1.159   3.746
  CYS140  SG1041   3.224   3.921   2.880   2.645   2.979   0.861   3.911
  CYS149  SG1117   2.568   4.147   3.528   2.853   3.029   1.492   2.953
  HIS150 NE21127   2.920   4.423   3.782   2.807   3.013   1.944   2.626
  CYS154  SG1161   1.433   3.057   2.688   2.396   2.402   1.250   2.662
  CYS187  SG1408   3.156   2.055   0.968   2.215   2.293   2.280   4.205
  MET188  SD1415   2.650   1.829   0.551   1.527   1.610   1.817   3.494
  HIS195 NE21479   3.128   1.100   1.160   2.554   2.357   3.276   4.174
  MET203  SD1538   2.273   1.379   0.378   1.355   1.269   1.967   3.117
  HIS217 NE21644   2.639   3.305   2.520   2.814   2.980   1.047   4.041
  MET219  SD1659   2.397   3.489   2.851   2.962   3.091   1.104   3.841
  CYS226  SG1710   3.444   4.582   4.066   4.391   4.506   2.501   5.171
  HIS239 NE21821   3.473   4.369   3.517   3.617   3.859   1.650   4.700
  MET243  SD1860   3.236   3.630   2.512   2.470   2.807   0.894   4.003
  CYS249  SG1903   2.798   2.813   1.629   1.646   1.959   0.907   3.457
  HIS266 NE22044   2.064   2.739   2.039   2.287   2.389   0.825   3.461
  HIS268 NE22061   2.240   2.965   2.170   2.256   2.417   0.547   3.444
  HIS273 NE22110   3.599   3.804   2.558   2.200   2.640   1.282   3.880
  HIS278 NE22141   2.496   2.863   2.030   2.462   2.609   1.017   3.870
  HIS280 NE22163   2.867   3.180   2.305   2.791   2.969   1.261   4.255
  HIS310 NE22421   2.243   3.269   3.053   3.581   3.555   2.145   4.316
                  HIS132  CYS140  CYS149  HIS150  CYS154  CYS187  MET188
                  NE2992  SG1041  SG1117 NE21127  SG1161  SG1408  SD1415
  CYS140  SG1041   0.798
  CYS149  SG1117   1.075   1.707
  HIS150 NE21127   1.582   2.150   0.787
  CYS154  SG1161   1.725   1.933   1.237   1.786
  CYS187  SG1408   3.341   2.682   3.730   4.105   2.965
  MET188  SD1415   2.949   2.374   3.194   3.499   2.439   0.724
  HIS195 NE21479   4.421   3.881   4.541   4.858   3.548   1.407   1.559
  MET203  SD1538   3.126   2.657   3.190   3.463   2.318   1.128   0.539
  HIS217 NE21644   1.547   1.183   2.094   2.752   1.630   2.216   2.045
  MET219  SD1659   1.343   1.316   1.683   2.413   1.254   2.696   2.425
  CYS226  SG1710   2.279   2.355   2.729   3.504   2.510   3.692   3.633
  HIS239 NE21821   1.295   1.180   2.147   2.816   2.233   3.135   3.007
  MET243  SD1860   1.299   0.513   2.113   2.540   2.092   2.219   1.981
  CYS249  SG1903   1.911   1.287   2.357   2.673   1.986   1.545   1.128
  HIS266 NE22044   1.725   1.420   1.969   2.558   1.207   1.966   1.632
  HIS268 NE22061   1.435   1.119   1.765   2.341   1.202   2.092   1.730
  HIS273 NE22110   1.640   0.994   2.350   2.534   2.507   2.392   2.077
  HIS278 NE22141   1.849   1.365   2.311   2.896   1.680   1.732   1.555
  HIS280 NE22163   1.894   1.352   2.508   3.116   2.001   1.850   1.804
  HIS310 NE22421   2.560   2.495   2.677   3.417   1.820   2.860   2.752
                  HIS195  MET203  HIS217  MET219  CYS226  HIS239  MET243
                 NE21479  SD1538 NE21644  SD1659  SG1710 NE21821  SD1860
  MET203  SD1538   1.407
  HIS217 NE21644   3.286   2.272
  MET219  SD1659   3.637   2.552   0.591
  CYS226  SG1710   4.639   3.807   1.654   1.447
  HIS239 NE21821   4.314   3.284   1.066   1.078   1.282
  MET243  SD1860   3.479   2.332   1.084   1.430   2.485   1.359
  CYS249  SG1903   2.680   1.460   1.408   1.768   3.050   2.142   0.926
  HIS266 NE22044   2.859   1.740   0.660   0.813   2.138   1.664   1.299
  HIS268 NE22061   3.065   1.878   0.613   0.750   2.140   1.496   1.047
  HIS273 NE22110   3.620   2.433   1.860   2.152   3.270   2.084   0.809
  HIS278 NE22141   2.798   1.798   0.501   0.979   2.096   1.531   1.109
  HIS280 NE22163   3.012   2.115   0.479   1.067   1.929   1.319   1.067
  HIS310 NE22421   3.477   2.774   1.390   1.231   1.447   1.974   2.469
                  CYS249  HIS266  HIS268  HIS273  HIS278  HIS280
                  SG1903 NE22044 NE22061 NE22110 NE22141 NE22163
  HIS266 NE22044   1.178
  HIS268 NE22061   1.056   0.313
  HIS273 NE22110   1.024   1.904   1.651
  HIS278 NE22141   1.086   0.483   0.562   1.780
  HIS280 NE22163   1.284   0.851   0.863   1.806   0.404
  HIS310 NE22421   2.568   1.428   1.633   3.215   1.537   1.607
Start terminus CYS-3: NH3+
End terminus ASP-315: COO-
Opening force field file /opt/homebrew/bin/../Cellar/gromacs/2025.3_1/share/gromacs/top/charmm27.ff/aminoacids.arn
Opening force field file /opt/homebrew/bin/../Cellar/gromacs/2025.3_1/share/gromacs/top/charmm27.ff/dna.arn
Opening force field file /opt/homebrew/bin/../Cellar/gromacs/2025.3_1/share/gromacs/top/charmm27.ff/rna.arn

Checking for duplicate atoms....

Generating any missing hydrogen atoms and/or adding termini.

Now there are 313 residues with 4881 atoms
Chain time...

Back Off! I just backed up topol_Protein_chain_A.itp to ./#topol_Protein_chain_A.itp.2#

Making bonds...

Number of bonds was 4951, now 4951

Generating angles, dihedrals and pairs...
Before cleaning: 13035 pairs
Before cleaning: 13220 dihedrals

Making cmap torsions...

There are  311 cmap torsion pairs

There are 13220 dihedrals,  830 impropers, 8977 angles
          12933 pairs,     4951 bonds and     0 virtual sites

Total mass 34910.134 a.m.u.

Total charge -5.000 e

Writing topology

Back Off! I just backed up posre_Protein_chain_A.itp to ./#posre_Protein_chain_A.itp.2#

Processing chain 2 'Z' (1 atoms, 1 residues)

Residue ZN1001 has type 'Ion', assuming it is not linked into a chain.

Problem with chain definition, or missing terminal residues. This chain does not appear to contain a recognized chain molecule. If this is incorrect, you can edit residuetypes.dat to modify the behavior.
9 out of 9 lines of specbond.dat converted successfully

-------------------------------------------------------
Program:     gmx pdb2gmx, version 2025.3-Homebrew
Source file: src/gromacs/gmxpreprocess/resall.cpp (line 625)

Fatal error:
Residue 'ZN' not found in residue topology database

For more information and tips for troubleshooting, please check the GROMACS
website at https://manual.gromacs.org/current/user-guide/run-time-errors.html

i opened by charmm27.ff file and i think this file does not contain any errors

part of atomtypes.atp

ZN	65.370000 ;	zinc (II) cation 

part of ions.itp

[ moleculetype ]
; molname   nrexcl
ZN          1

[ atoms ]
; id    at type     res nr  residu name at name  cg nr  charge   
1       ZN          1       ZN          ZN       1      2

part of the aminoacids.rtp

[ ZN2 ]
 [ atoms ]
        ZN      ZN      2.00    0

I could not find any thing like residuetypes.dat in my charmm27.ff file