While in biological systems, Mg2+ ions are more commonly encountered as counterions, the heavy atoms of cobalt, or occasionally iridium (as observed in PDB: 2GIS), offer anomalous scattering properties crucial for solving the phase problem and generating electron-density maps of the structure.