dgllife.utils.atom_hybridization_one_hot

dgllife.utils.atom_hybridization_one_hot(atom, allowable_set=None, encode_unknown=False)[source]

One hot encoding for the hybridization of an atom.

Parameters
  • atom (rdkit.Chem.rdchem.Atom) – RDKit atom instance.

  • allowable_set (list of rdkit.Chem.rdchem.HybridizationType) – Atom hybridizations to consider. Default: Chem.rdchem.HybridizationType.SP, Chem.rdchem.HybridizationType.SP2, Chem.rdchem.HybridizationType.SP3, Chem.rdchem.HybridizationType.SP3D, Chem.rdchem.HybridizationType.SP3D2.

  • encode_unknown (bool) – If True, map inputs not in the allowable set to the additional last element. (Default: False)

Returns

List of boolean values where at most one value is True.

Return type

list