stko.OpenMMMD

class stko.OpenMMMD(force_field, output_directory, reporting_freq, trajectory_freq, integrator=None, num_steps=100, num_conformers=50, box_vectors=None, define_stereo=False, partial_charges_method='am1bcc', random_seed=108, initial_temperature=300 K, platform=None, conformer_optimiser=None, energy_calculator=None)[source]

Bases: Optimizer

Optimise a molecule with OpenMM and Molecular Dynamics.

Warning

Even if random seeds are set on the integrator, we cannot guarantee that two identical simulations will produce the same exact trajectory.

Parameters:
  • force_field (ForceField) – The force field to use.

  • output_directory (Path) – The directory to which the output files should be written.

  • reporting_freq (int) – How often the simulation properties should be written in time steps.

  • trajectory_freq (int) – How often the trajectory should be written in time steps.

  • integrator (Integrator | None) – The integrator to use, openmm.openmm.LangevinIntegrator by default.

  • num_steps (int) – The number of steps to simulate.

  • num_conformers (int) – The number of conformers to sample during the MD run.

  • box_vectors (Quantity | None) – The box vectors to use.

  • define_stereo (bool) – Toggle calculation of stereochemistry.

  • partial_charges_method (Literal['am1bcc', 'mmff94', 'gasteiger', 'am1-mulliken', 'espaloma-am1bcc']) – The method to use for calculating partial charges. The default "am1bcc" is semi-empirical and may be slow.

  • random_seed (int) – The random seed to use.

  • initial_temperature (Quantity) – The initial temperature to use.

  • platform (Literal['CUDA'] | None) – The platform to use.

  • conformer_optimiser (Optimizer | None) – The optimiser to use for the conformers.

  • energy_calculator (EnergyCalculator | None) – The energy calculator to use to evaluate conformers.

Methods

optimize

Optimize mol.

optimize(mol)[source]

Optimize mol.

Parameters:

mol (MoleculeT) – The molecule to be optimized.

Returns:

The optimized molecule.

Return type:

MoleculeT