API docs#
- class openfe.SmallMoleculeComponent(*args, **kwargs)#
A molecule wrapper suitable for small molecules
Note
This class is a read-only representation of a molecule, if you want to edit the molecule do this in an appropriate toolkit before creating an instance from this class.
This wrapper uses SMILES as the primary hash, so is best suited to smaller molecules. It also supports reading/writing to .sdf format, which again is suited to smaller molecules. A small molecule can have a name associated with it, which is needed to distinguish two molecules with the same SMILES representation, or is simply useful to help identify ligand molecules later. The name can be explicitly set by the
name
attribute, or implicitly set based on the tags in the input molecular representation (if supported, as with RDKit). If not explicitly set on creation, the molecule will first look for an OpenFE-specific tagofe-name
, and if that doesn’t exist, for a commonly-used naming tag (e.g., the_Name
property for RDKit molecules). If no name is found, the empty string is used.- Parameters:
rdkit (
rdkit.Chem.rdchem.Mol
) – rdkit representation of the moleculename (str, optional) – if multiple Molecules with identical SMILES but differing positions are used, a name must be given to differentiate these. This name will be used in the hash.
- class openfe.LigandAtomMapping(*args, **kwargs)#
Simple container with the mapping between two Molecules
- class openfe.LigandNetwork(edges: Iterable[LigandAtomMapping], nodes: Iterable[SmallMoleculeComponent] | None = None)#
A directed graph connecting many ligands according to their atom mapping
- Parameters:
edges (Iterable[LigandAtomMapping]) – edges for this network
nodes (Iterable[SmallMoleculeComponent]) – nodes for this network
- class openfe.setup.atom_mapping.LigandAtomMapper#
Suggests AtomMappings for a pair of
SmallMoleculeComponent
s.Subclasses will typically implement the
_mappings_generator
method, which returns an iterable ofLigandAtomMapping
suggestions.