Skip to content

Commit

Permalink
Always reading stereo info from 3D conformations.
Browse files Browse the repository at this point in the history
  • Loading branch information
ijpulidos committed Mar 8, 2023
1 parent 379ea55 commit bdbc8b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion perses/rjmc/atom_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ def copy_molecule(mol):
atom.name = oeatom.GetName()
elif hasattr(mol, 'GetAtoms'):
# OpenEye OEMol
offmol = Molecule(mol, allow_undefined_stereo=True)
offmol = Molecule(mol)
oemol = oechem.OEMol(mol)
else:
raise ValueError(f'Not sure how to copy {mol}; should be openff.toolkit.topology.Molecule or openeye.oechem.OEMol')
Expand Down
2 changes: 1 addition & 1 deletion perses/utils/openeye.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,10 +362,10 @@ def createOEMolFromSDF(sdf_filename, index=0, add_hydrogens=True, allow_undefine
if add_hydrogens:
oechem.OEAddExplicitHydrogens(molecule)
oechem.OEPerceiveChiral(molecule)
oechem.OE3DToInternalStereo(molecule)

# perceive chirality
if not allow_undefined_stereo:
assert oechem.OE3DToInternalStereo(molecule), f"the stereochemistry perception from 3D coordinates failed"
assert not has_undefined_stereocenters(molecule), f"there is an atom with an undefined stereochemistry"

return molecule
Expand Down

0 comments on commit bdbc8b3

Please sign in to comment.