class_docstr: This class is a featurizer of general graph convolution networks for molecules.
  
  The default node(atom) and edge(bond) representations are based on
  `WeaveNet paper <https://arxiv.org/abs/1603.00856>`_. If you want to use your own representations,
  you could use this class as a guide to define your original Featurizer. In many cases, it's enough
  to modify return values of `construct_atom_feature` or `construct_bond_feature`.
  
  The default node representation are constructed by concatenating the following values,
  and the feature length is 30.
  
  - Atom type: A one-hot vector of this atom, "C", "N", "O", "F", "P", "S", "Cl", "Br", "I", "other atoms".
  - Formal charge: Integer electronic charge.
  - Hybridization: A one-hot vector of "sp", "sp2", "sp3".
  - Hydrogen bonding: A one-hot vector of whether this atom is a hydrogen bond donor or acceptor.
  - Aromatic: A one-hot vector of whether the atom belongs to an aromatic ring.
  - Degree: A one-hot vector of the degree (0-5) of this atom.
  - Number of Hydrogens: A one-hot vector of the number of hydrogens (0-4) that this atom connected.
  - Chirality: A one-hot vector of the chirality, "R" or "S". (Optional)
  - Partial charge: Calculated partial charge. (Optional)
  
  The default edge representation are constructed by concatenating the following values,
  and the feature length is 11.
  
  - Bond type: A one-hot vector of the bond type, "single", "double", "triple", or "aromatic".
  - Same ring: A one-hot vector of whether the atoms in the pair are in the same ring.
  - Conjugated: A one-hot vector of whether this bond is conjugated or not.
  - Stereo: A one-hot vector of the stereo configuration of a bond.
  
  If you want to know more details about features, please check the paper [1]_ and
  utilities in deepchem.utils.molecule_feature_utils.py.
  
  Examples
  --------
  >>> smiles = ["C1CCC1", "C1=CC=CN=C1"]
  >>> featurizer = MolGraphConvFeaturizer(use_edges=True)
  >>> out = featurizer.featurize(smiles)
  >>> type(out[0])
  <class 'deepchem.feat.graph_data.GraphData'>
  >>> out[0].num_node_features
  30
  >>> out[0].num_edge_features
  11
  
  References
  ----------
  .. [1] Kearnes, Steven, et al. "Molecular graph convolutions: moving beyond fingerprints."
      Journal of computer-aided molecular design 30.8 (2016):595-608.
  
  Note
  ----
  This class requires RDKit to be installed.
docstr: Calculate molecule graph features from RDKit mol object.
  
  Parameters
  ----------
  datapoint: rdkit.Chem.rdchem.Mol
      RDKit mol object.
  
  Returns
  -------
  graph: GraphData
      A molecule graph with some features.
code: def _featurize(self, datapoint: RDKitMol, **kwargs) -> GraphData:
      """Calculate molecule graph features from RDKit mol object.
  
      Parameters
      ----------
      datapoint: rdkit.Chem.rdchem.Mol
          RDKit mol object.
  
      Returns
      -------
      graph: GraphData
          A molecule graph with some features.
  
      """
      assert (
          datapoint.GetNumAtoms() > 1
      ), "More than one atom should be present in the molecule for this featurizer to work."
      if "mol" in kwargs:
          datapoint = kwargs.get("mol")
          raise DeprecationWarning(
              'Mol is being phased out as a parameter, please pass "datapoint" instead.'
          )
  
      if self.use_partial_charge:
          try:
              datapoint.GetAtomWithIdx(0).GetProp("_GasteigerCharge")
          except:
              # If partial charges were not computed
              try:
                  from rdkit.Chem import AllChem
  
                  AllChem.ComputeGasteigerCharges(datapoint)
              except ModuleNotFoundError:
                  raise ImportError(
                      "This class requires RDKit to be installed."
                  )
  
      # construct atom (node) feature
      h_bond_infos = construct_hydrogen_bonding_info(datapoint)
      atom_features = np.asarray(
          [
              _construct_atom_feature(
                  atom,
                  h_bond_infos,
                  self.use_chirality,
                  self.use_partial_charge,
              )
              for atom in datapoint.GetAtoms()
          ],
          dtype=float,
      )
  
      # construct edge (bond) index
      src, dest = [], []
      for bond in datapoint.GetBonds():
          # add edge list considering a directed graph
          start, end = bond.GetBeginAtomIdx(), bond.GetEndAtomIdx()
          src += [start, end]
          dest += [end, start]
  
      # construct edge (bond) feature
      bond_features = None  # deafult None
      if self.use_edges:
          features = []
          for bond in datapoint.GetBonds():
              features += 2 * [_construct_bond_feature(bond)]
          bond_features = np.asarray(features, dtype=float)
  
      # load_sdf_files returns pos as strings but user can also specify
      # numpy arrays for atom coordinates
      pos = []
      if "pos_x" in kwargs and "pos_y" in kwargs and "pos_z" in kwargs:
          if isinstance(kwargs["pos_x"], str):
              pos_x = eval(kwargs["pos_x"])
          elif isinstance(kwargs["pos_x"], np.ndarray):
              pos_x = kwargs["pos_x"]
          if isinstance(kwargs["pos_y"], str):
              pos_y = eval(kwargs["pos_y"])
          elif isinstance(kwargs["pos_y"], np.ndarray):
              pos_y = kwargs["pos_y"]
          if isinstance(kwargs["pos_z"], str):
              pos_z = eval(kwargs["pos_z"])
          elif isinstance(kwargs["pos_z"], np.ndarray):
              pos_z = kwargs["pos_z"]
  
          for x, y, z in zip(pos_x, pos_y, pos_z):
              pos.append([x, y, z])
          node_pos_features = np.asarray(pos)
      else:
          node_pos_features = None
      return GraphData(
          node_features=atom_features,
          edge_index=np.asarray([src, dest], dtype=int),
          edge_features=bond_features,
          node_pos_features=node_pos_features,
      )
  
imports: from typing import List, Tuple
  import numpy
  from deepchem.utils.typing import RDKitAtom, RDKitBond, RDKitMol
  from deepchem.feat.graph_data import GraphData
  from deepchem.feat.base_classes import MolecularFeaturizer
  from deepchem.utils.molecule_feature_utils import one_hot_encode
  from deepchem.utils.molecule_feature_utils import get_atom_type_one_hot
  from deepchem.utils.molecule_feature_utils import construct_hydrogen_bonding_info
  from deepchem.utils.molecule_feature_utils import get_atom_hydrogen_bonding_one_hot
  from deepchem.utils.molecule_feature_utils import get_atom_hybridization_one_hot
  from deepchem.utils.molecule_feature_utils import get_atom_total_num_Hs_one_hot
  from deepchem.utils.molecule_feature_utils import get_atom_is_in_aromatic_one_hot
  from deepchem.utils.molecule_feature_utils import get_atom_chirality_one_hot
  from deepchem.utils.molecule_feature_utils import get_atom_formal_charge
  from deepchem.utils.molecule_feature_utils import get_atom_partial_charge
  from deepchem.utils.molecule_feature_utils import get_atom_total_degree_one_hot
  from deepchem.utils.molecule_feature_utils import get_bond_type_one_hot
  from deepchem.utils.molecule_feature_utils import get_bond_is_in_same_ring_one_hot
  from deepchem.utils.molecule_feature_utils import get_bond_is_conjugated_one_hot
  from deepchem.utils.molecule_feature_utils import get_bond_stereo_one_hot
  from deepchem.utils.molecule_feature_utils import get_atom_formal_charge_one_hot
  from deepchem.utils.molecule_feature_utils import get_atom_implicit_valence_one_hot
  from deepchem.utils.molecule_feature_utils import get_atom_explicit_valence_one_hot
  from deepchem.utils.rdkit_utils import compute_all_pairs_shortest_path
  from deepchem.utils.rdkit_utils import compute_pairwise_ring_info
label_desc: Use image node_id 2 for calling the MolGraphConvFeaturizer obj's underlying member method code with example usage: obj._featurize(datapoint) and returns: GraphData