disambiguate_alt_ids

openff.pablo.ccd.patches.disambiguate_alt_ids(res: ResidueDefinition) list[ResidueDefinition][source]

CCD patch: put alt atom ids in their own residue definitions if needed

This patch should be run before other patches that add synonyms, as it assumes that there is at most one synonym (from the CCD alt id flag).

Some CCD residues (like GLY) have alternative atom IDs that clash with canonical IDs for a different atom. This breaks synonyms because the clashing alternate ID is never assigned; the PDB file is interpreted as having two copies of the canonical ID atom. To fix this, we just split residue definitions with this clashing problem into two definitions, one with the canonical IDs and the other with the alternates.

Note that if a linking atom is part of a clash, this may interfere with the disambiguated residue definition’s ability to link to canonically named residue definitions.