Unable to make OFFMol from RDMol: RDMol has unspecified stereochemistry.
razvanmarinescu opened this issue · 4 comments
I'm trying to build an OpenFF molecule from an RDkit molecule:
from openff.toolkit.topology import Molecule
from rdkit import Chem
rdmol = Chem.MolFromSmiles('C#CC(O)(C#C)C1CCN(CC2=C(C(=O)OC)C(c3ccc(F)cc3Cl)N=C(c3ccccn3)N2)CC1')
molecule = Molecule.from_rdkit(rdmol)
But I get this error (on the final line molecule = Molecule.from_rdkit(rdmol)
)
UndefinedStereochemistryError: Unable to make OFFMol from RDMol: RDMol has unspecified stereochemistry. Undefined chiral centers are:
- Atom C (index 17)
Any help?
In the call to from_rdkit()
, add the argument allow_undefined_stereo=False
.
Thanks @peastman! Indeed, now it's only a warning, so it works. Could you explain what it means? Why is the stereochemistry not unspecified in the RDkit molecule?
Your SMILES pattern includes no stereochemistry, so RDKit doesn't define any stereochemistry and is content with that.
https://www.rdkit.org/docs/RDKit_Book.html#from-smiles
This is really a topic of OpenFF Toolkit usage, not openmmforcefields
; if you have more questions please consider raising them here: https://github.com/openforcefield/discussions/discussions
(OpenFF and OpenMM are different projects, despite similar names and significant overlap)
Thank you very much @mattwthompson. Yes, will do