dgl.data.chem.mol_to_complete_graph

dgl.data.chem.mol_to_complete_graph(mol, add_self_loop=False, atom_featurizer=None, bond_featurizer=None)[source]

Convert an RDKit molecule into a complete DGLGraph and featurize for it.

Parameters:
  • 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.
Returns:

g – Complete DGLGraph for the molecule

Return type:

DGLGraph