pdb2gmx creates additional incorrect cmap entries
If some non amino acid residue(s) follow(s) the last amino acid, an additional cmap entry is generated. It is centered on the last amino acid and connects to the first N in the non-amino acid residue. The additional residues have to be bonded to the protein (like glycosylation) and thus be in the same segment for the error to occur.
The logic which creates the cmap entries (gen_cmap in pdb2top.c) should either take into account the termini detection (it works correctly in this case) or check that the previous or next residue participating in the cmap entry are protein residues (using residuetypes.dat). Not sure what is the best strategy.
Fix pdb2gmx -cmap in corner cases
CMAP torsions are only generated when the atoms are from the same chain
(pdb2gmx -merge allows multiple chains to be present in the
moleculetype), and their residues are in residuetypes.dat as