LigandAtomMapping#
- class openfe.setup.atom_mapping.LigandAtomMapping(componentA: SmallMoleculeComponent, componentB: SmallMoleculeComponent, componentA_to_componentB: dict[int, int], annotations: dict[str, Any] | None = None)#
Bases:
AtomMappingSimple container for an atom mapping between two small molecule components.
- Parameters:
componentA (SmallMoleculeComponent) – the ligand molecules on either end of the mapping
componentB (SmallMoleculeComponent) – the ligand molecules on either end of the mapping
componentA_to_componentB (dict[int, int]) – correspondence of indices of atoms between the two ligands; the keys are indices in componentA and the values are indices in componentB
annotations (dict[str, Any]) – Mapping of annotation identifier to annotation data. Annotations may contain arbitrary JSON-serializable data. Annotation identifiers starting with
ofe-may have special meaning in other parts of OpenFE.scoreis a reserved annotation identifier.
Methods
Save atom map visualization to disk
Return the distances between pairs of atoms in the mapping
Create an new mapping based on this one with extra annotations.
Attributes
Maps the index of an item from Component A onto Component B
Indices of atoms in component A that aren't mappable to B
Similar to A to B, but reversed.
Indices of atoms in component B that aren't mappable to A
- property annotations#
- property componentA_to_componentB: dict[int, int]#
Maps the index of an item from Component A onto Component B
Keys are indices from Component A, values are indices from Component B.
Not all indices will be resolvable, these items have no corresponding entity in the other component (e.g. the atom disappears), therefore resulting in a KeyError on query
- property componentA_unique#
Indices of atoms in component A that aren’t mappable to B
- property componentB_unique#
Indices of atoms in component B that aren’t mappable to A
- draw_to_file(fname: str, d2d=None)#
Save atom map visualization to disk
- Parameters:
d2d (
rdkit.Chem.Draw.rdMolDraw2D.MolDraw2D) – If desired specify an instance of a MolDraw2D object. DefaultNonewill write a .png file using the MolDraw2DCairo backend.fname (str) – Name of file to save atom map
- get_distances() ndarray[Any, dtype[float64]]#
Return the distances between pairs of atoms in the mapping