CHARMMing the PDB database dragon

Life gets interesting when you try to deal with amazing complexity.   Such as trying to leverage the CHARMM (1) resources to build bond information for PDB (2) files.    The CHARMM files are wonderful for describing bonding information for most basic protein building blocks.   Unfortunately the naming conventions differ between CHARMM and PDB, and even within PDB files itself.    I will get to the hydrogen mapping later, but for now I am just discovering the "insertion code" for residues (col 27 in the ATOM punchcard):
  • Alphabet letters are commonly used for insertion code. The insertion code is used when two residues have the same numbering. The combination of residue numbering and insertion code defines the unique residue.
The PDB in question is 4COX - a pretty massive file with almost 18K atoms.  Here at atom 580 - is an inserted residue.

After a bit of searching - I found this rather nice explanation for why "insertion codes" have been conserved in the evolution of PDB:
Because people felt it was important to preserve the
amino acid numbering for 'important' residues and to be
able to readily discuss and compare the structures from
different species, various people decided to try to number
the proteins from species B, C, etc. to match the numbering
used for species A.  In doing this, one must have gaps
(missing numbers) where a sequence is shorter.  But what
should one do when a sequence is longer?  This is the case
where it is necessary to insert extra numbers and this is
done by using insertion codes.
https://lists.sdsc.edu/pipermail/pdb-l/2004-March/001513.html

Refs:
(1) www.charmm.orgChemistry at HARvard Macromolecular Mechanics
(2) wikipedia.org/wiki/Protein_Data_Bank_(file_format) Description in wikipedia of the PDB file format 

Comments