smores.EspMolecule#

class smores.EspMolecule(atoms, positions, dummy_index, attached_index, electrostatic_potential)[source]#

Bases: object

Calculates StericParameters from electrostatic potentials.

See also

Examples

Calculate steric parameters

>>> import smores
>>> molecule = smores.EspMolecule.from_cube_file("HBr", dummy_index=0, attached_index=1)
>>> molecule.get_steric_parameters()
StericParameters(L=3.57164113574581, B1=1.9730970556668774, B5=2.320611610648539)

Initialize an EspMolecule.

Parameters:
  • atoms (list[str]) – The elemental symbol of each atom of the molecule.

  • positions (list[list[float]]) – The coordinates of each atom of the molecule, provided as an N x 3 matrix.

  • dummy_index (int) – The index of the dummy atom.

  • attached_index (int) – The index of the attached atom of the substituent.

  • electrostatic_potential (VoxelGrid) – The electrostatic potential used for calculating the steric parameters.

Methods

from_cube_file

Get a molecule from a .cube file.

from_rdkit

Get a molecule from an rdkit molecule.

get_attached_index

Get the index of the atom attached to the substituent.

get_dummy_index

Get the index of the dummy atom.

get_steric_parameters

Get the steric parameters from the electrostatic potential.

classmethod from_cube_file(path, dummy_index, attached_index)[source]#

Get a molecule from a .cube file.

Parameters:
  • path (Path | str) – The path to the file.

  • dummy_index (int) – The index of the dummy atom.

  • attached_index (int) – The index of the attached atom of the substituent.

Returns:

The molecule.

Return type:

EspMolecule

classmethod from_rdkit(molecule, dummy_index, attached_index, electrostatic_potential, conformer_id=0)[source]#

Get a molecule from an rdkit molecule.

Parameters:
  • molecule (Mol) – The rdkit molecule. It must have at least one conformer.

  • dummy_index (int) – The index of the dummy atom.

  • attached_index (int) – The index of the attached atom of the substituent.

  • electrostatic_potential (VoxelGrid) – The electrostatic potential used for calculating the steric parameters.

  • conformer_id (int) – The id of the conformer to use.

Returns:

The smores molecule.

Return type:

EspMolecule

get_attached_index()[source]#

Get the index of the atom attached to the substituent.

Returns:

The index of the atom attached to the substituent.

Return type:

int

get_dummy_index()[source]#

Get the index of the dummy atom.

Returns:

The index of the dummy atom.

Return type:

int

get_steric_parameters()[source]#

Get the steric parameters from the electrostatic potential.

Returns:

The parameters.

Return type:

StericParameters