draw_mapping#

gufe.visualization.mapping_visualization.draw_mapping(mol1_to_mol2: dict[int, int], mol1: rdkit.Chem.Mol, mol2: rdkit.Chem.Mol, d2d=None)#

Method to visualise the atom map correspondence between two rdkit molecules given an input mapping.

Legend:
  • Red highlighted atoms: unique atoms, i.e. atoms which are not mapped.

  • Blue highlighted atoms: element changes, i.e. atoms which are mapped but change elements.

  • Red highlighted bonds: any bond which involves at least one unique atom or one element change.

Parameters:
  • mol1_to_mol2 (dict of int:int) – Atom mapping between input molecules.

  • mol1 (RDKit.Mol) – RDKit representation of molecule 1

  • mol2 (RDKit.Mol) – RDKit representation of molecule 2

  • d2d (rdkit.Chem.Draw.rdMolDraw2D.MolDraw2D) – Optional MolDraw2D backend to use for visualisation.