class_docstr: Featurizer for MolGAN de-novo molecular generation [1]_.
  The default representation is in form of GraphMatrix object.
  It is wrapper for two matrices containing atom and bond type information.
  The class also provides reverse capabilities.
  
  Examples
  --------
  >>> import deepchem as dc
  >>> from rdkit import Chem
  >>> rdkit_mol, smiles_mol = Chem.MolFromSmiles('CCC'), 'C1=CC=CC=C1'
  >>> molecules = [rdkit_mol, smiles_mol]
  >>> featurizer = dc.feat.MolGanFeaturizer()
  >>> features = featurizer.featurize(molecules)
  >>> len(features) # 2 molecules
  2
  >>> type(features[0])
  <class 'deepchem.feat.molecule_featurizers.molgan_featurizer.GraphMatrix'>
  >>> molecules = featurizer.defeaturize(features) # defeaturization
  >>> type(molecules[0])
  <class 'rdkit.Chem.rdchem.Mol'>
docstr: Calculate adjacency matrix and nodes features for RDKitMol.
  It strips any chirality and charges
  
  Parameters
  ----------
  datapoint: rdkit.Chem.rdchem.Mol
      RDKit mol object.
  
  Returns
  -------
  graph: GraphMatrix
      A molecule graph with some features.
docstr_tok: ["Calculate","adjacency","matrix","and","nodes","features","for","RDKitMol",".","It","strips","any","chirality","and","charges","Parameters","--","--","--","--","--","datapoint",":","rdkit.Chem.rdchem.Mol","RDKit","mol","object",".","Returns","--","--","--","-","graph",":","GraphMatrix","A","molecule","graph","with","some","features","."]
code: def _featurize(
      self, datapoint: RDKitMol, **kwargs
  ) -> Optional[GraphMatrix]:
      """
      Calculate adjacency matrix and nodes features for RDKitMol.
      It strips any chirality and charges
  
      Parameters
      ----------
      datapoint: rdkit.Chem.rdchem.Mol
          RDKit mol object.
  
      Returns
      -------
      graph: GraphMatrix
          A molecule graph with some features.
  
      """
  
      try:
          from rdkit import Chem
      except ModuleNotFoundError:
          raise ImportError(
              "This method requires RDKit to be installed."
          )
      if "mol" in kwargs:
          datapoint = kwargs.get("mol")
          raise DeprecationWarning(
              'Mol is being phased out as a parameter, please pass "datapoint" instead.'
          )
  
      if self.kekulize:
          Chem.Kekulize(datapoint)
  
      A = np.zeros(
          shape=(self.max_atom_count, self.max_atom_count),
          dtype=np.float32,
      )
      bonds = datapoint.GetBonds()
  
      begin, end = [b.GetBeginAtomIdx() for b in bonds], [
          b.GetEndAtomIdx() for b in bonds
      ]
      bond_type = [self.bond_encoder[b.GetBondType()] for b in bonds]
  
      A[begin, end] = bond_type
      A[end, begin] = bond_type
  
      degree = np.sum(
          A[: datapoint.GetNumAtoms(), : datapoint.GetNumAtoms()],
          axis=-1,
      )
      X = np.array(
          [
              self.atom_encoder[atom.GetAtomicNum()]
              for atom in datapoint.GetAtoms()
          ]
          + [0] * (self.max_atom_count - datapoint.GetNumAtoms()),
          dtype=np.int32,
      )
      graph = GraphMatrix(A, X)
  
      return graph if (degree > 0).all() else None
  
file_path: deepchem/deepchem/feat/molecule_featurizers/molgan_featurizer.py
imports: import logging
  import numpy
  from deepchem.utils.typing import RDKitBond, RDKitMol, List
  from deepchem.feat.base_classes import MolecularFeaturizer
  from deepchem.utils.typing import OneOrMany
  from typing import Optional
label_desc: Use image node_id 2 for calling the MolGanFeaturizer obj's underlying member method code with example usage: obj._featurize(datapoint) and returns: unknown