stko.MetalOptimizer
- class stko.MetalOptimizer(metal_binder_distance=1.6, metal_binder_forceconstant=100.0, max_iterations=500)[source]
Bases:
OptimizerApplies forcefield optimizers in
rdkitthat can handle metals.- Parameters:
See also
rdkit: https://www.rdkit.org/
Notes
By default,
optimize()will run a restricted optimization using constraints and the UFF. To implement this, metal atoms are replaced by noninteracting H atoms, and constraints are applied to maintain the metal centre geometry. Restrictions are applied to the ligand with respect to its input structure. So if that is poorly optimised, then the output will be also.Warning: this optimizer seems to be machine dependant, producing different energies after optimisation on Ubunut 18 vs. Ubuntu 20.
Examples
MetalOptimizerallows for the restricted optimization ofConstructedMoleculeinstances containing metals. Note that this optimizer algorithm is not very robust to large bonds and may fail.import stk import stko # Produce a Pd+2 atom with 4 functional groups. palladium_atom = stk.BuildingBlock( smiles='[Pd+2]', functional_groups=( stk.SingleAtom(stk.Pd(0, charge=2)) for i in range(4) ), position_matrix=[[0., 0., 0.]], ) # Build a building block with two functional groups using # the SmartsFunctionalGroupFactory. bb1 = stk.BuildingBlock( smiles=( 'C1=NC=CC(C2=CC=CC(C3=C' 'C=NC=C3)=C2)=C1' ), functional_groups=[ stk.SmartsFunctionalGroupFactory( smarts='[#6]~[#7X2]~[#6]', bonders=(1, ), deleters=(), ), ], ) cage1 = stk.ConstructedMolecule( stk.cage.M3L6( building_blocks=(palladium_atom, bb1), # Ensure that bonds between the GenericFunctionalGroups # of the ligand and the SingleAtom functional groups # of the metal are dative. reaction_factory=stk.DativeReactionFactory( stk.GenericReactionFactory( bond_orders={ frozenset({ stk.GenericFunctionalGroup, stk.SingleAtom }): 9 } ) ), optimizer=stk.MCHammer(), ) ) # Define an optimizer. optimizer = stko.MetalOptimizer() # Optimize. opt_cage1 = optimizer.optimize(mol=cage1)
Methods
Optimize mol.