- class openff.nagl.toolkits.NAGLOpenEyeToolkitWrapper[source]
Bases:
NAGLToolkitWrapperBase
,OpenEyeToolkitWrapper
Methods
Determine whether each atom in a molecule is in a ring of a given size.
Compute the lowest all-atom RMSD between a reference and target conformer, allowing for symmetry-equivalent atoms to be permuted.
Determine whether each bond in a molecule is in a ring of a given size.
Get the hybridization of each atom in a molecule.
Stream molecules from an SDF file.
Stream molecules to an SDF file using a context manager.
Convert an OpenFF Molecule to an OpenEye OEMol with charges stored as SD data.
Attributes
- get_atoms_are_in_ring_size(molecule: Molecule, ring_size: int) List[bool] [source]
Determine whether each atom in a molecule is in a ring of a given size.
- Parameters:
molecule (
openff.toolkit.topology.Molecule
) – The molecule to compute ring perception forring_size (
int
) – The size of the ring to check for.
- Returns:
in_ring_size (
List[bool]
)
- get_best_rmsd(molecule: Molecule, reference_conformer: ndarray | Quantity, target_conformer: ndarray | Quantity) Quantity [source]
Compute the lowest all-atom RMSD between a reference and target conformer, allowing for symmetry-equivalent atoms to be permuted.
- Parameters:
molecule (
openff.toolkit.topology.Molecule
) – The molecule to compute the RMSD forreference_conformer (
np.ndarray
oropenff.units.unit.Quantity
) – The reference conformer to compare to the target conformer. If a numpy array, it is assumed to be in units of angstrom.target_conformer (
np.ndarray
oropenff.units.unit.Quantity
) – The target conformer to compare to the reference conformer. If a numpy array, it is assumed to be in units of angstrom.
- Returns:
rmsd (
unit.Quantity
)
Examples
>>> from openff.units import unit >>> from openff.toolkit.topology import Molecule >>> from openff.toolkit.utils.toolkits import OpenEyeToolkitWrapper >>> toolkit_wrapper = OpenEyeToolkitWrapper() >>> molecule = Molecule.from_smiles("CCCCO") >>> molecule.generate_conformers(n_conformers=2) >>> rmsd = toolkit_wrapper.get_best_rmsd(molecule, molecule.conformers[0], molecule.conformers[1]) >>> print(f"RMSD in angstrom: {rmsd.m_as(unit.angstrom)}")
- get_bonds_are_in_ring_size(molecule: Molecule, ring_size: int) List[bool] [source]
Determine whether each bond in a molecule is in a ring of a given size.
- Parameters:
molecule (
openff.toolkit.topology.Molecule
) – The molecule to compute ring perception forring_size (
int
) – The size of the ring to check for.
- Returns:
in_ring_size (
List[bool]
) – Bonds are in the same order as the molecule’sbonds
attribute.
- get_molecule_hybridizations(molecule: Molecule) List[HybridizationType] [source]
Get the hybridization of each atom in a molecule.
- Parameters:
molecule (
openff.toolkit.topology.Molecule
) – The molecule to get the hybridizations of.- Returns:
hybridizations (
List[HybridizationType]
) – The hybridization of each atom in the molecule.
- stream_molecules_from_sdf_file(file: str, as_smiles: bool = False, mapped_smiles: bool = False, include_sdf_data: bool = True, **kwargs)[source]
Stream molecules from an SDF file.
- Parameters:
file (
str
) – The path to the SDF file to stream molecules from.as_smiles (
bool
, defaultFalse
) – If True, return a SMILES string instead of an OpenFF Moleculemapped_smiles (
bool
, defaultFalse
) – If True, return a SMILES string with atom indices as atom map numbers.include_sdf_data (
bool
, defaultTrue
) – If True, include the SDF tag data in the output molecules.
- Returns:
molecules (
Generator[openff.toolkit.topology.Molecule
orstr]
)
- stream_molecules_to_file(file: str)[source]
Stream molecules to an SDF file using a context manager.
- Parameters:
file (
str
) – The path to the SDF file to stream molecules to.
Examples
>>> from openff.toolkit.topology import Molecule >>> from openff.toolkit.utils.toolkits import OpenEyeToolkitWrapper >>> toolkit_wrapper = OpenEyeToolkitWrapper() >>> molecule1 = Molecule.from_smiles("CCO") >>> molecule2 = Molecule.from_smiles("CCC") >>> with toolkit_wrapper.stream_molecules_to_file("molecules.sdf") as writer: ... writer(molecule1) ... writer(molecule2)
- to_openeye(molecule: Molecule)[source]
Convert an OpenFF Molecule to an OpenEye OEMol with charges stored as SD data.
- Parameters:
molecule (
openff.toolkit.topology.Molecule
) – The molecule to convert- Returns:
oemol (
openeye.oechem.OEMol
)