AmberToolsToolkitWrapper

class openff.toolkit.utils.toolkits.AmberToolsToolkitWrapper[source]

AmberTools toolkit wrapper

Warning

This API is experimental and subject to change.

__init__()[source]

Methods

__init__()

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.

from_file(file_path, file_format[, ...])

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

from_file_obj(file_obj, file_format[, ...])

Return an openff.toolkit.topology.Molecule from a file-like object (an object with a ".read()" method using this toolkit.

is_available()

Check whether the AmberTools toolkit is installed

requires_toolkit()

Attributes

SUPPORTED_CHARGE_METHODS

supported_charge_methods

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

Instructions on how to install the wrapped toolkit.

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() bool[source]

Check whether the AmberTools toolkit is installed

Returns:

is_installed – True if AmberTools is installed, False otherwise.

assign_partial_charges(molecule: Molecule, partial_charge_method: str | None = None, use_conformers: list[Quantity] | None = None, strict_n_conformers: bool = False, normalize_partial_charges: bool = True, _cls=None)[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:
  • molecule – Molecule for which partial charges are to be computed

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

  • use_conformers – with shape (n_atoms, 3) and dimension of distance. Optional, default = None List of unit-wrapped numpy arrays to use for partial charge calculation. If None, an appropriate number of conformers will be generated.

  • strict_n_conformers – 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.

  • normalize_partial_charges – Whether to offset partial charges so that they sum to the total formal charge of the molecule. This is used to prevent accumulation of rounding errors when the partial charge generation method has low precision.

  • _cls – Molecule constructor

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

assign_fractional_bond_orders(molecule: Molecule, bond_order_model: str | None = None, use_conformers: list[str] | None = None, _cls=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:
  • molecule – The molecule to assign wiberg bond orders to

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

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

  • _cls – Molecule constructor

from_file(file_path, file_format, allow_undefined_stereo=False)

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

Parameters:
  • file_path – The file to read the molecule from

  • file_format – 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_stereo – If false, raises an exception if any molecules contain undefined stereochemistry.

  • _cls – Molecule constructor

Returns:

molecules – a list of Molecule objects is returned.

from_file_obj(file_obj, file_format, allow_undefined_stereo=False, _cls=None)

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

Parameters:
  • file_obj – The file-like object to read the molecule from

  • file_format – 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_stereo – If false, raises an exception if any molecules contain undefined stereochemistry. If false, the function skips loading the molecule.

  • _cls – Molecule constructor

Returns:

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[str]

List of file formats that this toolkit can write.

property toolkit_installation_instructions

Instructions on how to install the wrapped toolkit.

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_name – 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_version – The version of the wrapped toolkit