dgl.data.chem.mol_to_bigraph(mol, add_self_loop=False, atom_featurizer=<dgl.data.chem.utils.CanonicalAtomFeaturizer object>, bond_featurizer=None)[source]

Convert an RDKit molecule object into a bi-directed DGLGraph and featurize for it.

  • mol (rdkit.Chem.rdchem.Mol) – RDKit molecule holder
  • add_self_loop (bool) – Whether to add self loops in DGLGraphs.
  • atom_featurizer (callable, rdkit.Chem.rdchem.Mol -> dict) – Featurization for atoms in a molecule, which can be used to update ndata for a DGLGraph. Default to CanonicalAtomFeaturizer().
  • bond_featurizer (callable, rdkit.Chem.rdchem.Mol -> dict) – Featurization for bonds in a molecule, which can be used to update edata for a DGLGraph.

g – Bi-directed DGLGraph for the molecule

Return type: