Worked it out for myself. I needed to use: Chem.AddHs(mol, addCoords=True)
Doh! On Tue, Dec 14, 2021 at 5:45 PM Tim Dudgeon <tdudgeon...@gmail.com> wrote: > I'm seeing lots of failures when minimising molecules using > MMFFOptimizeMolecule. > A large proportion of seemingly valid molecules seem to fail. > Am I doing something stupid here? > > Example: > > from rdkit import Chem > from rdkit.Chem import AllChem > > molblock = ''' > RDKit 3D > > 5 4 0 0 0 0 0 0 0 0999 V2000 > 10.2630 -5.8010 25.0960 N 0 0 0 0 0 0 0 0 0 0 0 0 > 8.8220 -3.5490 23.3680 C 0 0 0 0 0 0 0 0 0 0 0 0 > 8.2100 -4.7890 24.0210 C 0 0 0 0 0 0 0 0 0 0 0 0 > 9.1000 -5.2470 25.1770 C 0 0 0 0 0 0 0 0 0 0 0 0 > 8.5860 -5.0380 26.4480 N 0 0 0 0 0 0 0 0 0 0 0 0 > 3 2 1 0 > 4 1 2 0 > 4 3 1 0 > 5 4 1 0 > M END > ''' > > mol = Chem.MolFromMolBlock(molblock) > print("Processing", Chem.MolToSmiles(mol)) > molh = Chem.AddHs(mol) > converged = AllChem.MMFFOptimizeMolecule(molh) > > > Outcome: > > Processing CCC(=N)N > [17:41:57] > > **** > Invariant Violation > bad direction in linearSearch > Violation occurred on line 234 in file > /home/conda/feedstock_root/build_artifacts/rdkit_1620892510968/work/Code/Numerics/Optimizer/BFGSOpt.h > Failed Expression: status >= 0 > **** > > Traceback (most recent call last): > File "/data/work/jku/5V6S/simple-min.py", line 23, in <module> > converged = AllChem.MMFFOptimizeMolecule(molh) > RuntimeError: Invariant Violation > bad direction in linearSearch > Violation occurred on line 234 in file > Code/Numerics/Optimizer/BFGSOpt.h > Failed Expression: status >= 0 > RDKIT: 2021.03.2 > BOOST: 1_74 > >
_______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss