stko.molecule_analysis.GeometryAnalyser

class stko.molecule_analysis.GeometryAnalyser[source]

Bases: object

Tools for analysing the geometry of molecules.

Warning

This code is only present in the latest versions of stko that require Python 3.11!

Methods

calculate_angles

Calculate angles for all angles defined by molecule bonding.

calculate_bonds

Calculate bond lengths for all stk.Molecule.get_bonds().

calculate_torsions

Calculate all torsions defined by molecule bonding.

get_avg_centroid_distance

Get the average distance between the molecule and centroid.

get_max_diameter

Get the maximum diameter of the molecule (defined in stk).

get_metal_centroid_metal_angle

Get all metal-centroid-metal angles.

get_metal_distances

Get all metal atom pair distances.

get_min_atom_atom_distance

Get the minimum distance between atoms in molecule.

get_min_centroid_distance

Get the minimum distance between the molecule and centroid.

get_radius_gyration

Get the radius of gyration of the molecule.

calculate_angles(molecule)[source]

Calculate angles for all angles defined by molecule bonding.

Parameters:

molecule (Molecule) – The molecule to analyse.

Returns:

Dictionary of angles organised by element triplet.

Return type:

dict[tuple[str, str, str], list[float]]

calculate_bonds(molecule)[source]

Calculate bond lengths for all stk.Molecule.get_bonds().

Parameters:

molecule (Molecule) – The molecule to analyse.

Returns:

Dictionary of bonds organised by element pair.

Return type:

dict[tuple[str, str], list[float]]

calculate_torsions(molecule)[source]

Calculate all torsions defined by molecule bonding.

Parameters:

molecule (Molecule) – The molecule to analyse.

Returns:

Dictionary of torsions organised by elements.

Return type:

dict[tuple[str, …], list[float]]

get_avg_centroid_distance(molecule)[source]

Get the average distance between the molecule and centroid.

Parameters:

molecule (Molecule) – The molecule to analyse.

Returns:

The average and std. deviation of centroid to atom distances.

Return type:

tuple[float, float]

get_max_diameter(molecule)[source]

Get the maximum diameter of the molecule (defined in stk).

Parameters:

molecule (Molecule) – The molecule to analyse.

Returns:

The maximum diameter in Angstrom.

Return type:

float

get_metal_centroid_metal_angle(molecule, metal_atom_nos)[source]

Get all metal-centroid-metal angles.

Parameters:
  • molecule (Molecule) – The molecule to analyse.

  • metal_atom_nos (tuple[int, ...]) – The atomic numbers to delete. Can be a tuple of one or any element on periodic table.

Returns:

The angles in degrees and associated metal atom ids.

Return type:

dict[tuple[int, int], float]

get_metal_distances(molecule, metal_atom_nos)[source]

Get all metal atom pair distances.

Parameters:
  • molecule (Molecule) – The molecule to analyse.

  • metal_atom_nos (tuple[int, ...]) – The atomic numbers to delete. Can be a tuple of one or any element on periodic table.

Returns:

The distances and associated metal atom ids.

Return type:

dict[tuple[int, int], float]

get_min_atom_atom_distance(molecule)[source]

Get the minimum distance between atoms in molecule.

This does not consider bonding.

Parameters:

molecule (Molecule) – The molecule to analyse.

Returns:

The minimum distance.

Return type:

float

get_min_centroid_distance(molecule)[source]

Get the minimum distance between the molecule and centroid.

This is nearly equivalent to a pore radius.

Parameters:

molecule (Molecule) – The molecule to analyse.

Returns:

The minimum centroid to atom distance.

Return type:

float

get_radius_gyration(molecule)[source]

Get the radius of gyration of the molecule.

Parameters:

molecule (Molecule) – The molecule to analyse.

Returns:

R_g in Angstrom.

Return type:

float