determine_bonds_openbabel#

determine_bonds_openbabel(mol, return_implicit_Hs=False, verbose=False)[source]#

Determine bond orders with Open Babel, or None if failed.

Note that atom properties may have been lost and the default from openbabel is to process the molecule with implicit hydrogens only, so all hydrogens and their positions are deleted and then optionally restores with approximate coordinates.

Parameters:
  • mol (rdkit.Chem.Mol) – RDKit molecule that needs to be updated

  • return_implicit_Hs (bool, optional, default=False) – If False, the inherent implicit hydrogens from the openbabel process are added back with approximated coordinates.

  • verbose (bool, optional, default=False) – If True and an error in bond determination occurs, the primary traceback is printed.

Returns:

mol – New RDKit molecule from openbabel determination of bond orders. Note that atom properties may have been lost. Returns None if bond determination failed.

Return type:

rdkit.Chem.Mol