dgl.data.chem.smile_to_bigraph

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

Convert a SMILES into a bi-directed DGLGraph and featurize for it.

Parameters:
  • smile (str) – String of SMILES
  • 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 – Bi-directed DGLGraph for the molecule

Return type:

DGLGraph