stko.RmsdCalculator

class stko.RmsdCalculator(initial_molecule, ignore_hydrogens=False)[source]

Bases: object

Calculates the root mean square distance between molecules.

This calculator will only work if the two molecules are the same and have the same atom ordering.

No alignment of the two molecules occurs. However, both molecules are moved to a centroid position of (0, 0, 0).

Parameters:
  • initial_molecule (Molecule) – The stk.Molecule to calculate RMSD from.

  • ignore_hydrogens (bool) – True to ignore hydrogen atoms.

Examples

import stk
import stko
import numpy as np

bb1 = stk.BuildingBlock('C1CCCCC1')
calculator = stko.RmsdCalculator(bb1)
results = calculator.get_results(stko.UFF().optimize(bb1))
rmsd  = results.get_rmsd()

Methods

calculate

get_results

Calculate the RMSD between mol and the initial molecule.

calculate(mol)[source]
Parameters:

mol (Molecule)

Return type:

float

get_results(mol)[source]

Calculate the RMSD between mol and the initial molecule.

Parameters:

mol (Molecule) – The stk.Molecule to calculate RMSD to.

Returns:

The RMSD between the molecules.

Return type:

RmsdResults