Skip to content

Commit

Permalink
Update uffminimize.py
Browse files Browse the repository at this point in the history
Added a check to expand the number of iterations that the compounds go through in the UFFOptimizeMolecule procedure if it failed to converge the first time around. I set the maxIters up from the default of 200 to 1000. This still runs reasonably quickly, and can help in the generation of improper compounds.
  • Loading branch information
francoep authored Apr 15, 2019
1 parent e264f32 commit 2c3587c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion uffminimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@
if mol is not None:
try:
orig = Chem.UFFGetMoleculeForceField(mol).CalcEnergy()
Chem.UFFOptimizeMolecule(mol)
a=Chem.UFFOptimizeMolecule(mol)

#sometimes the UFF Optimization does not converge (returns a 1 instead of 0)
if a==1:
a=Chem.UFFOptimizeMolecule(mol, maxIter=1000)

if options.verbose:
e = Chem.UFFGetMoleculeForceField(mol).CalcEnergy()
print mol.GetProp('_Name'),orig,"->",e
Expand Down

0 comments on commit 2c3587c

Please sign in to comment.