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

One hot encoding for the type of an atom.

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

  • allowable_set (list of str) – Atom types to consider. Default: C, N, O, S, F, Si, P, Cl, Br, Mg, Na, Ca, Fe, As, Al, I, B, V, K, Tl, Yb, Sb, Sn, Ag, Pd, Co, Se, Ti, Zn, H, Li, Ge, Cu, Au, Ni, Cd, In, Mn, Zr, Cr, Pt, Hg, Pb.

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


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

Return type