openforcefield.utils.toolkits.AmberToolsToolkitWrapper

class openforcefield.utils.toolkits.AmberToolsToolkitWrapper[source]

AmberTools toolkit wrapper

Warning

This API is experimental and subject to change.

Attributes
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

Return the name of the toolkit wrapped by this class as a str

toolkit_version

Return the version of the wrapped toolkit as a str

Methods

assign_fractional_bond_orders(molecule[, …])

Update and store list of bond orders this molecule.

assign_partial_charges(molecule[, …])

Compute partial charges with AmberTools using antechamber/sqm, and assign the new values to the partial_charges attribute.

compute_partial_charges_am1bcc(molecule[, …])

Compute partial charges with AmberTools using antechamber/sqm.

from_file(file_path, file_format[, …])

Return an openforcefield.topology.Molecule from a file using this toolkit.

from_file_obj(file_obj, file_format[, …])

Return an openforcefield.topology.Molecule from a file-like object (an object with a “.read()” method using this

is_available()

Check whether the AmberTools toolkit is installed

requires_toolkit()

__init__()[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__()

Initialize self.

assign_fractional_bond_orders(molecule[, …])

Update and store list of bond orders this molecule.

assign_partial_charges(molecule[, …])

Compute partial charges with AmberTools using antechamber/sqm, and assign the new values to the partial_charges attribute.

compute_partial_charges_am1bcc(molecule[, …])

Compute partial charges with AmberTools using antechamber/sqm.

from_file(file_path, file_format[, …])

Return an openforcefield.topology.Molecule from a file using this toolkit.

from_file_obj(file_obj, file_format[, …])

Return an openforcefield.topology.Molecule from a file-like object (an object with a “.read()” method using this

is_available()

Check whether the AmberTools toolkit is installed

requires_toolkit()

Attributes

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

Return the name of the toolkit wrapped by this class as a str

toolkit_version

Return the version of the wrapped toolkit as a str

static is_available()[source]

Check whether the AmberTools toolkit is installed

Returns
is_installedbool

True if AmberTools is installed, False otherwise.

assign_partial_charges(molecule, partial_charge_method=None, use_conformers=None, strict_n_conformers=False)[source]

Compute partial charges with AmberTools using antechamber/sqm, and assign the new values to the partial_charges attribute.

Warning

This API experimental and subject to change.

Parameters
moleculeopenforcefield.topology.Molecule

Molecule for which partial charges are to be computed

partial_charge_methodstr, optional, default=None

The charge model to use. One of [‘gasteiger’, ‘am1bcc’, ‘am1-mulliken’]. If None, ‘am1-mulliken’ will be used.

use_conformersiterable of simtk.unit.Quantity-wrapped numpy arrays, each with shape (n_atoms, 3) and dimension of distance. Optional, default = None

List of (n_atoms x 3) simtk.unit.Quantities to use for partial charge calculation. If None, an appropriate number of conformers will be generated.

strict_n_conformersbool, default=False

Whether to raise an exception if an invalid number of conformers is provided for the given charge method. If this is False and an invalid number of conformers is found, a warning will be raised.

Raises
ChargeMethodUnavailableError if the requested charge method can not be handled by this toolkit
ChargeCalculationError if the charge method is supported by this toolkit, but fails
compute_partial_charges_am1bcc(molecule, use_conformers=None, strict_n_conformers=False)[source]

Compute partial charges with AmberTools using antechamber/sqm. This will calculate AM1-BCC charges on the first conformer only.

Warning

This API is experimental and subject to change.

Parameters
moleculeMolecule

Molecule for which partial charges are to be computed

use_conformersiterable of simtk.unit.Quantity-wrapped numpy arrays, each with shape (n_atoms, 3) and dimension of distance. Optional, default = None

Coordinates to use for partial charge calculation. If None, an appropriate number of conformers will be generated.

strict_n_conformersbool, default=False

Whether to raise an exception if an invalid number of conformers is provided. If this is False and an invalid number of conformers is found, a warning will be raised instead of an Exception.

Returns
chargesnumpy.array of shape (natoms) of type float

The partial charges

assign_fractional_bond_orders(molecule, bond_order_model=None, use_conformers=None)[source]

Update and store list of bond orders this molecule. Bond orders are stored on each bond, in the bond.fractional_bond_order attribute.

Warning

This API is experimental and subject to change.

Parameters
moleculeopenforcefield.topology.molecule Molecule

The molecule to assign wiberg bond orders to

bond_order_modelstr, optional, default=None

The charge model to use. Only allowed value is ‘am1-wiberg’. If None, ‘am1-wiberg’ will be used.

use_conformersiterable of simtk.unit.Quantity(np.array) with shape (n_atoms, 3) and dimension of distance, optional, default=None

The conformers to use for fractional bond order calculation. If None, an appropriate number of conformers will be generated by an available ToolkitWrapper.

from_file(file_path, file_format, allow_undefined_stereo=False)

Return an openforcefield.topology.Molecule from a file using this toolkit.

Parameters
file_pathstr

The file to read the molecule from

file_formatstr

Format specifier, usually file suffix (eg. ‘MOL2’, ‘SMI’) Note that not all toolkits support all formats. Check ToolkitWrapper.toolkit_file_read_formats for details.

allow_undefined_stereobool, default=False

If false, raises an exception if any molecules contain undefined stereochemistry.

Returns
——-
moleculesMolecule or list of Molecules

a list of Molecule objects is returned.

from_file_obj(file_obj, file_format, allow_undefined_stereo=False)
Return an openforcefield.topology.Molecule from a file-like object (an object with a “.read()” method using this

toolkit.

Parameters
file_objfile-like object

The file-like object to read the molecule from

file_formatstr

Format specifier, usually file suffix (eg. ‘MOL2’, ‘SMI’) Note that not all toolkits support all formats. Check ToolkitWrapper.toolkit_file_read_formats for details.

allow_undefined_stereobool, default=False

If false, raises an exception if any molecules contain undefined stereochemistry. If false, the function skips loading the molecule.

Returns
moleculesMolecule or list of Molecules

a list of Molecule objects is returned.

property toolkit_file_read_formats

List of file formats that this toolkit can read.

property toolkit_file_write_formats

List of file formats that this toolkit can write.

property 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.

property toolkit_name

Return the name of the toolkit wrapped by this class as a str

Warning

This API is experimental and subject to change.

Returns
toolkit_namestr

The name of the wrapped toolkit

property toolkit_version

Return the version of the wrapped toolkit as a str

Warning

This API is experimental and subject to change.

Returns
toolkit_versionstr

The version of the wrapped toolkit