openforcefield.utils.toolkits.
OpenEyeToolkitWrapper
[source]¶OpenEye toolkit wrapper
Warning
This API is experimental and subject to change.
toolkit_file_read_formats
List of file formats that this toolkit can read.
toolkit_file_write_formats
List of file formats that this toolkit can write.
toolkit_installation_instructions
classmethod(function) -> method
toolkit_name
The name of the toolkit wrapped by this class.
Methods
|
Compute partial charges with OpenEye quacpac |
|
Compute AM1BCC partial charges with OpenEye quacpac |
|
Update and store list of bond orders this molecule. |
|
Find all SMARTS matches for the specified molecule, using the specified aromaticity model. |
|
Return an openforcefield.topology.Molecule from a file using this toolkit. |
|
Return an openforcefield.topology.Molecule from a file-like object (an object with a “.read()” method using this toolkit. |
|
If given an OEMol (or OEMol-derived object), this function will load it into an openforcefield.topology.molecule Otherwise, it will return False. |
|
Create a Molecule from an OpenEye molecule. |
|
Create a Molecule from a SMILES string using the OpenEye toolkit. |
|
Generate molecule conformers using OpenEye Omega. |
|
Check if the given OpenEye toolkit components are available. |
|
|
|
Writes an OpenFF Molecule to a file-like object |
|
Writes an OpenFF Molecule to a file-like object |
|
Create an OpenEye molecule using the specified aromaticity model |
|
Uses the OpenEye toolkit to convert a Molecule into a SMILES string. |
__init__
(self, /, *args, **kwargs)¶Initialize self. See help(type(self)) for accurate signature.
Methods
|
Initialize self. |
|
Compute partial charges with OpenEye quacpac |
|
Compute AM1BCC partial charges with OpenEye quacpac |
|
Update and store list of bond orders this molecule. |
|
Find all SMARTS matches for the specified molecule, using the specified aromaticity model. |
|
Return an openforcefield.topology.Molecule from a file using this toolkit. |
|
Return an openforcefield.topology.Molecule from a file-like object (an object with a “.read()” method using this toolkit. |
|
If given an OEMol (or OEMol-derived object), this function will load it into an openforcefield.topology.molecule Otherwise, it will return False. |
|
Create a Molecule from an OpenEye molecule. |
|
Create a Molecule from a SMILES string using the OpenEye toolkit. |
|
Generate molecule conformers using OpenEye Omega. |
|
Check if the given OpenEye toolkit components are available. |
|
|
|
Writes an OpenFF Molecule to a file-like object |
|
Writes an OpenFF Molecule to a file-like object |
|
Create an OpenEye molecule using the specified aromaticity model |
|
Uses the OpenEye toolkit to convert a Molecule into a SMILES string. |
Attributes
List of file formats that this toolkit can read. |
|
List of file formats that this toolkit can write. |
|
classmethod(function) -> method |
|
The name of the toolkit wrapped by this class. |
is_available
(oetools=('oechem', 'oequacpac', 'oeiupac', 'oeomega'))[source]¶Check if the given OpenEye toolkit components are available.
If the OpenEye toolkit is not installed or no license is found
for at least one the given toolkits , False
is returned.
Set of tools to check by their Python module name. Defaults to the complete set of tools supported by this function. Also accepts a single tool to check as a string instead of an iterable of length 1.
True
if all tools in oetools
are installed and licensed,
False
otherwise
from_object
(self, object, allow_undefined_stereo=False)[source]¶If given an OEMol (or OEMol-derived object), this function will load it into an openforcefield.topology.molecule Otherwise, it will return False.
An object to by type-checked.
Whether to accept molecules with undefined stereocenters. If False, an exception will be raised if a molecule with undefined stereochemistry is passed into this function.
An openforcefield.topology.molecule Molecule.
If the object could not be converted into a Molecule.
from_file
(self, file_path, file_format, allow_undefined_stereo=False)[source]¶Return an openforcefield.topology.Molecule from a file using this toolkit.
The file to read the molecule from
Format specifier, usually file suffix (eg. ‘MOL2’, ‘SMI’) Note that not all toolkits support all formats. Check ToolkitWrapper.toolkit_file_read_formats for details.
If false, raises an exception if oemol contains undefined stereochemistry.
The list of Molecule
objects in the file.
If the loaded mol2 file possibly uses GAFF atom types, which are not supported.
Examples
Load a mol2 file into an OpenFF Molecule
object.
>>> from openforcefield.utils import get_data_file_path
>>> mol2_file_path = get_data_file_path('molecules/cyclohexane.mol2')
>>> toolkit = OpenEyeToolkitWrapper()
>>> molecule = toolkit.from_file(mol2_file_path, file_format='mol2')
from_file_obj
(self, file_obj, file_format, allow_undefined_stereo=False)[source]¶Return an openforcefield.topology.Molecule from a file-like object (an object with a “.read()” method using this toolkit.
The file-like object to read the molecule from
Format specifier, usually file suffix (eg. ‘MOL2’, ‘SMI’) Note that not all toolkits support all formats. Check ToolkitWrapper.toolkit_file_read_formats for details.
If false, raises an exception if oemol contains undefined stereochemistry.
The list of Molecule objects in the file object.
If the loaded mol2 file possibly uses GAFF atom types, which are not supported.
to_file_obj
(self, molecule, file_obj, file_format)[source]¶Writes an OpenFF Molecule to a file-like object
The molecule to write
The file-like object to write to
The format for writing the molecule data
to_file
(self, molecule, file_path, file_format)[source]¶Writes an OpenFF Molecule to a file-like object
The molecule to write
The file path to write to.
The format for writing the molecule data
from_openeye
(oemol, allow_undefined_stereo=False)[source]¶Create a Molecule from an OpenEye molecule. If the OpenEye molecule has implicit hydrogens, this function will make them explicit.
Warning
This API is experimental and subject to change.
An OpenEye molecule
If false, raises an exception if oemol contains undefined stereochemistry.
An openforcefield molecule
Examples
Create a Molecule from an OpenEye OEMol
>>> from openeye import oechem
>>> from openforcefield.tests.utils import get_data_file_path
>>> ifs = oechem.oemolistream(get_data_file_path('systems/monomers/ethanol.mol2'))
>>> oemols = list(ifs.GetOEGraphMols())
>>> toolkit_wrapper = OpenEyeToolkitWrapper()
>>> molecule = toolkit_wrapper.from_openeye(oemols[0])
to_openeye
(molecule, aromaticity_model='OEAroModel_MDL')[source]¶Create an OpenEye molecule using the specified aromaticity model
Warning
This API is experimental and subject to change.
The molecule to convert to an OEMol
The aromaticity model to use
An OpenEye molecule
Examples
Create an OpenEye molecule from a Molecule
>>> from openforcefield.topology import Molecule
>>> toolkit_wrapper = OpenEyeToolkitWrapper()
>>> molecule = Molecule.from_smiles('CC')
>>> oemol = toolkit_wrapper.to_openeye(molecule)
to_smiles
(molecule)[source]¶Uses the OpenEye toolkit to convert a Molecule into a SMILES string.
The molecule to convert into a SMILES.
The SMILES of the input molecule.
from_smiles
(self, smiles, hydrogens_are_explicit=False, allow_undefined_stereo=False)[source]¶Create a Molecule from a SMILES string using the OpenEye toolkit.
Warning
This API is experimental and subject to change.
The SMILES string to turn into a molecule
If False, OE will perform hydrogen addition using OEAddExplicitHydrogens
Whether to accept SMILES with undefined stereochemistry. If False, an exception will be raised if a SMILES with undefined stereochemistry is passed into this function.
An openforcefield-style molecule.
generate_conformers
(self, molecule, n_conformers=1, clear_existing=True)[source]¶Generate molecule conformers using OpenEye Omega.
Warning
This API is experimental and subject to change.
Molecule
The molecule to generate conformers for.
The maximum number of conformers to generate.
Whether to overwrite existing conformers for the molecule
compute_partial_charges
(self, molecule, quantum_chemical_method='AM1-BCC', partial_charge_method='None')[source]¶Compute partial charges with OpenEye quacpac
Warning
This API is experimental and subject to change.
Molecule for which partial charges are to be computed
The charge model to use. One of [‘noop’, ‘mmff’, ‘mmff94’, ‘am1bcc’, ‘am1bccnosymspt’, ‘amber’, ‘amberff94’, ‘am1bccelf10’] If None, ‘am1bcc’ will be used.
The partial charges
compute_partial_charges_am1bcc
(self, molecule)[source]¶Compute AM1BCC partial charges with OpenEye quacpac
Warning
This API is experimental and subject to change.
Molecule for which partial charges are to be computed
The partial charges
compute_wiberg_bond_orders
(self, molecule, charge_model=None)[source]¶Update and store list of bond orders this molecule. Can be used for initialization of bondorders list, or for updating bond orders in the list.
Warning
This API is experimental and subject to change.
The molecule to assign wiberg bond orders to
The charge model to use. One of [‘am1’, ‘pm3’]. If None, ‘am1’ will be used.
find_smarts_matches
(self, molecule, smarts, aromaticity_model='OEAroModel_MDL')[source]¶Find all SMARTS matches for the specified molecule, using the specified aromaticity model.
Warning
This API is experimental and subject to change.
The molecule for which all specified SMARTS matches are to be located
SMARTS string with optional SMIRKS-style atom tagging
Aromaticity model to use during matching
toolkit_file_read_formats
¶List of file formats that this toolkit can read.
toolkit_file_write_formats
¶List of file formats that this toolkit can write.
toolkit_installation_instructions
¶classmethod(function) -> method
Convert a function to be a class method.
A class method receives the class as implicit first argument, just like an instance method receives the instance. To declare a class method, use this idiom:
- class C:
@classmethod def f(cls, arg1, arg2, …):
…
It can be called either on the class (e.g. C.f()) or on an instance (e.g. C().f()). The instance is ignored except for its class. If a class method is called for a derived class, the derived class object is passed as the implied first argument.
Class methods are different than C++ or Java static methods. If you want those, see the staticmethod builtin.
toolkit_name
¶The name of the toolkit wrapped by this class.