SmallMoleculeComponent#
- class openfe.setup.system.SmallMoleculeComponent(rdkit: Mol, name: str = '')#
Bases:
ExplicitMoleculeComponentComponentrepresenting a small molecule.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 class supports reading/writing to the .sdf format, which is suited to smaller molecules. Ligands alchemically mutated in a free energy calculation are typically represented with this class.
The name can be explicitly set by the
nameattribute, 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_Nameproperty 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) – A human readable tag for this molecule. This name will be used in the hash.
Methods
Construct from an OpenFF toolkit Molecule
Create
SmallMoleculeComponentfrom SDF file.Create
SmallMoleculeComponentfrom SDF-formatted string.OpenFF Toolkit representation of this molecule
Create a string based on SDF.
- classmethod from_json(json_str)#
- classmethod from_sdf_file(filename: str)#
Create
SmallMoleculeComponentfrom SDF file.- Parameters:
filename (str) – name of SDF file
- Returns:
the deserialized molecule
- Return type:
- classmethod from_sdf_string(sdf_str: str)#
Create
SmallMoleculeComponentfrom SDF-formatted string.- Parameters:
sdf_str (str) – input string in SDF format
- Returns:
the deserialized molecule
- Return type:
- to_json()#
- to_openff()#
OpenFF Toolkit representation of this molecule
- to_sdf() str#
Create a string based on SDF.
See also
from_sdf_string()create an object from the output of this
- property total_charge#
Net formal charge for the
Component, if defined.