ExplicitMoleculeComponent#
- class gufe.components.explicitmoleculecomponent.ExplicitMoleculeComponent(rdkit: rdkit.Chem.rdchem.Mol, name: str = '')#
Base class for explicit molecules.
This provides basic serialization and conversion to different representations. Specific file formats, such as SDF for small molecules or PDB for proteins, should be implemented in subclasses.
Methods
Generate an instance from JSON keyed chain representation.
Create a Component, copying from an RDKit Mol
Generate a JSON keyed chain representation.
Return an RDKit copied representation of this molecule
Attributes
Net formal charge for the
Component, if defined.- classmethod from_json(json_str)#
Generate an instance from JSON keyed chain representation.
Can provide either a filepath/filelike as file, or JSON content via content.
- Parameters:
file – A filepath or filelike object to read JSON data from.
content – A string to read JSON data from.
See also
- classmethod from_rdkit(rdkit: rdkit.Chem.rdchem.Mol, name: str = '')#
Create a Component, copying from an RDKit Mol
- property name: str#
- property smiles: str#
- to_json()#
Generate a JSON keyed chain representation.
This will be writen to the filepath or filelike object if passed.
- Parameters:
file – A filepath or filelike object to write the JSON to.
- Returns:
A minimal JSON representation of the object if file is None; else None.
- Return type:
str
See also
- to_rdkit() rdkit.Chem.rdchem.Mol#
Return an RDKit copied representation of this molecule
- property total_charge#
Net formal charge for the
Component, if defined.