stko.PlanarityCalculator

class stko.PlanarityCalculator[source]

Bases: object

Calculates measures of planarity of a molecule.

Measures based on plane deviation from Angew. paper [1] and a ChemRxiv paper [2].

Plane deviation: sum of the shortest distance to the plane of best fit of all deviation atoms (sum abs(d_i)).

Plane deviation span: d_max - d_min (SDP in [2])

Planarity parameter: defined as sqrt((1/num_atoms) * (sum d_i ** 2)) (MPP in [2])

Examples

import stk
import stko

# Create a molecule whose torsions we want to know.
mol1 = stk.BuildingBlock('c1ccccc1')

# Create the calculator.
pc = stko.PlanarityCalculator()

# Extract the measures.
pc_results = pc.get_results(mol1)
plane_deviation = pc_results.get_plane_deviation()
plane_deviation_span = pc_results.get_plane_deviation_span()
planarity_parameter = pc_results.get_planarity_parameter()

References

Methods

calculate

Perform calculation on mol.

get_results

Calculate the planarity of mol.

calculate(mol, plane_atom_ids=None, deviation_atom_ids=None)[source]

Perform calculation on mol.

Parameters:
  • mol (Molecule) – The stk.Molecule whose planarity is to be calculated.

  • plane_atom_ids (Iterable[int] | None) – The atom ids to use to define the plane of best fit.

  • deviation_atom_ids (Iterable[int] | None) – The atom ids to use to calculate planarity.

Yields:

Dictionary of results.

Return type:

Iterable[dict]

get_results(mol, plane_atom_ids=None, deviation_atom_ids=None)[source]

Calculate the planarity of mol.

Parameters:
  • mol (Molecule) – The stk.Molecule whose planarity is to be calculated.

  • plane_atom_ids (Iterable[int] | None) – The atom ids to use to define the plane of best fit.

  • deviation_atom_ids (Iterable[int] | None) – The atom ids to use to calculate planarity.

Returns:

The planarity measures of the molecule.

Return type:

PlanarityResults