dgl.data.chem.mol_to_graph

dgl.data.chem.mol_to_graph(mol, graph_constructor, atom_featurizer, bond_featurizer)[source]

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

Parameters:
  • mol (rdkit.Chem.rdchem.Mol) – RDKit molecule holder
  • graph_constructor (callable) – Takes an RDKit molecule as input and returns a DGLGraph
  • atom_featurizer (callable, rdkit.Chem.rdchem.Mol -> dict) – Featurization for atoms in a molecule, which can be used to update ndata for a DGLGraph.
  • 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 – Converted DGLGraph for the molecule

Return type:

DGLGraph