gufe.visualization.mapping_visualization¶
Functions
|
Method to visualise the atom map correspondence between two rdkit molecules given an input mapping. |
|
Draw the mapping visualization for a single molecular of a mapping |
|
Draw a molecule without any mapping information. |
- 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.
- gufe.visualization.mapping_visualization.draw_one_molecule_mapping(mol1_to_mol2, mol1, mol2, d2d=None)¶
Draw the mapping visualization for a single molecular of a mapping
This will always draw
molA
. To drawmolB
, switch order/invertmolA_to_molB
mapping.See
draw_mapping()
for details on the meaning of different colors.- 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.
- gufe.visualization.mapping_visualization.draw_unhighlighted_molecule(mol, d2d=None)¶
Draw a molecule without any mapping information.
This uses the same mechanisms as the mapping visualizations, and so can be useful in cases where you want the same visual style both for a plain molecule and a molecule with the mapping highlighted.
- Parameters:
mol (RDKit.Mol) – RDKit representation of the molecule
d2d (
rdkit.Chem.Draw.rdMolDraw2D.MolDraw2D
) – Optional MolDraw2D backend to use for visualisation.