class_docstr: Featurizer for GROVER Model
  
  The Grover Featurizer is used to compute features suitable for grover model.
  It accepts an rdkit molecule of type `rdkit.Chem.rdchem.Mol` or a SMILES string
  as input and computes the following sets of features:
      1. a molecular graph from the input molecule
      2. functional groups which are used **only** during pretraining
      3. additional features which can **only** be used during finetuning
  
  Parameters
  ----------
  additional_featurizer: dc.feat.Featurizer
      Given a molecular dataset, it is possible to extract additional molecular features in order
  to train and finetune from the existing pretrained model. The `additional_featurizer` can
  be used to generate additional features for the molecule.
  
  References
  ---------
  .. [1] Rong, Yu, et al. "Self-supervised graph transformer on large-scale
      molecular data." NeurIPS, 2020
  
  Examples
  --------
  >>> import deepchem as dc
  >>> from deepchem.feat import GroverFeaturizer
  >>> feat = GroverFeaturizer(features_generator = dc.feat.CircularFingerprint())
  >>> out = feat.featurize('CCC')
  
  Note
  ----
  This class requires RDKit to be installed.
code: def _make_mol_graph(self, mol: RDKitMol) -> GraphData:
      from deepchem.feat.molecule_featurizers.dmpnn_featurizer import (
          bond_features,
      )
  
      smiles = Chem.MolToSmiles(mol)
      f_atoms = []  # mapping from atom index to atom features
      f_bonds = (
          []
      )  # mapping from bond index to concat(from_atom, bond) features
      edge_index = []
  
      n_atoms = mol.GetNumAtoms()  # number of atoms
      n_bonds = 0  # number of bonds
      a2b: List[
          List[int]
      ] = []  # mapping from atom index to incoming bond indices
      b2a = (
          []
      )  # mapping from bond index to the index of the atom the bond is coming from
      b2revb = (
          []
      )  # mapping from bond index to the index of the reverse bond
  
      for _ in range(n_atoms):
          a2b.append([])
  
      for _, atom in enumerate(mol.GetAtoms()):
          f_atoms.append(self._get_atom_features(atom, mol))
  
      for a1 in range(n_atoms):
          for a2 in range(a1 + 1, n_atoms):
              bond = mol.GetBondBetweenAtoms(a1, a2)
  
              if bond is None:
                  continue
  
              if np.random.binomial(1, self.bond_drop_rate):
                  continue
  
              f_bond = bond_features(bond)
              # Always treat the bond as directed.
              f_bonds.append(f_atoms[a1] + f_bond)
              f_bonds.append(f_atoms[a2] + f_bond)
  
              edge_index.extend([[a1, a2], [a2, a1]])
  
              b1 = n_bonds  # b1: bond id
              b2 = b1 + 1  # b2: reverse bond id
              # add mapping between bond b1 and atom a2 (destination atom)
              a2b[a2].append(b1)  # b1 = a1 --> a2
              # add mapping between bond id and atom id (a1)
              b2a.append(a1)
              # add mapping between bond id and atom a1 (source atom)
              a2b[a1].append(b2)  # b2 = a2 --> a1
              b2a.append(a2)
              # update index on bond and reverse bond mappings
              b2revb.append(b2)
              b2revb.append(b1)
              n_bonds += 2
  
      molgraph = GraphData(
          node_features=np.asarray(f_atoms),
          edge_index=np.asarray(edge_index).T,
          edge_features=np.asarray(f_bonds),
          b1=b1,
          b2=b2,
          a2b=a2b,
          b2a=b2a,
          b2revb=b2revb,
          n_bonds=n_bonds,
          n_atoms=n_atoms,
          smiles=smiles,
      )
      return molgraph
  
file_path: deepchem/deepchem/feat/molecule_featurizers/grover_featurizer.py
imports: from typing import Optional, List
  import numpy
  from deepchem.feat.graph_data import GraphData
  from deepchem.feat.molecule_featurizers import RDKitDescriptors
  from deepchem.feat.base_classes import MolecularFeaturizer
  from deepchem.utils.molecule_feature_utils import one_hot_encode
  from deepchem.utils.typing import RDKitMol
  from rdkit import Chem
label_desc: Use image node_id 3 for calling the GroverFeaturizer obj's underlying member method code with example usage: obj._make_mol_graph(mol) and returns: molgraph