rxn.chemutils.conversion.inchi_to_mol

rxn.chemutils.conversion.inchi_to_mol(inchi, sanitize=True, removeHs=True)[source]

Convert an InChI string to an RDKit Mol.

Mainly a wrapper around MolFromInchi that raises MolFromInchi when necessary.

Raises

InvalidInchi for empty or invalid InChI strings.

Parameters
  • inchi (str) – InChI string to convert.

  • sanitize (bool, default: True) – whether to sanitize the molecules or not. Note: sanitization here corresponds to doing a sanitization with SANITIZE_ALL.

  • removeHs (bool, default: True) – set to True to remove Hydrogens from a molecule

Return type

Mol

Returns

Mol instance.