class_docstr: Localize partial charges of atoms in macromolecular complexes.
  
  Given a macromolecular complex made up of multiple
  constitutent molecules, compute the partial (Gasteiger
  charge) on each molecule. For each atom, localize this
  partial charge in the voxel in which it originated to create
  a local charge array. Sum contributions to get an effective
  charge at each voxel.
  
  Let `voxels_per_edge = int(box_width/voxel_width)`.  Creates a
  tensor output of shape `(voxels_per_edge, voxels_per_edge,
  voxels_per_edge, 1)` for each macromolecular complex that computes
  the effective charge at each voxel.
class_docstr_tok: ["Localize","partial","charges","of","atoms","in","macromolecular","complexes",".","Given","a","macromolecular","complex","made","up","of","multiple","constitutent","molecules",",","compute","the","partial","(","Gasteiger","charge",")","on","each","molecule",".","For","each","atom",",","localize","this","partial","charge","in","the","voxel","in","which","it","originated","to","create","a","local","charge","array",".","Sum","contributions","to","get","an","effective","charge","at","each","voxel",".","Let","`","voxels_per_edge","=","int","(","box_width\/voxel_width",")","`",".","Creates","a","tensor","output","of","shape","`","(","voxels_per_edge",",","voxels_per_edge",",","voxels_per_edge",",","1",")","`","for","each","macromolecular","complex","that","computes","the","effective","charge","at","each","voxel","."]
docstr: Parameters
  ----------
  cutoff: float (default 4.5)
      Distance cutoff in angstroms for molecules in complex.
  box_width: float, optional (default 16.0)
      Size of a box in which voxel features are calculated. Box
      is centered on a ligand centroid.
  voxel_width: float, optional (default 1.0)
      Size of a 3D voxel in a grid.
  reduce_to_contacts: bool, optional
      If True, reduce the atoms in the complex to those near a contact
      region.
code: def __init__(
      self,
      cutoff: float = 4.5,
      box_width: float = 16.0,
      voxel_width: float = 1.0,
      reduce_to_contacts: bool = True,
  ):
      """
      Parameters
      ----------
      cutoff: float (default 4.5)
          Distance cutoff in angstroms for molecules in complex.
      box_width: float, optional (default 16.0)
          Size of a box in which voxel features are calculated. Box
          is centered on a ligand centroid.
      voxel_width: float, optional (default 1.0)
          Size of a 3D voxel in a grid.
      reduce_to_contacts: bool, optional
          If True, reduce the atoms in the complex to those near a contact
          region.
      """
      self.cutoff = cutoff
      self.box_width = box_width
      self.voxel_width = voxel_width
      self.reduce_to_contacts = reduce_to_contacts
  
imports: import itertools
  import logging
  import numpy
  from deepchem.utils import rdkit_utils
  from deepchem.feat import ComplexFeaturizer
  from deepchem.utils.voxel_utils import voxelize
  from deepchem.utils.voxel_utils import convert_atom_to_voxel
  from deepchem.utils.voxel_utils import convert_atom_pair_to_voxel
  from deepchem.utils.noncovalent_utils import compute_salt_bridges
  from deepchem.utils.noncovalent_utils import compute_binding_pocket_cation_pi
  from deepchem.utils.noncovalent_utils import compute_pi_stack
  from deepchem.utils.noncovalent_utils import compute_hydrogen_bonds
  from deepchem.utils.rdkit_utils import MoleculeLoadException
  from deepchem.utils.rdkit_utils import compute_contact_centroid
  from deepchem.utils.geometry_utils import compute_pairwise_distances
  from deepchem.utils.geometry_utils import subtract_centroid
  from deepchem.utils.fragment_utils import get_partial_charge
  from deepchem.utils.fragment_utils import reduce_molecular_complex_to_contacts
  from typing import List, Tuple, Optional
label_desc: Use image node_id 1 to create a new ChargeVoxelizer object from inherited base classes: ComplexFeaturizer with example: obj = ChargeVoxelizer(cutoff, box_width, voxel_width, reduce_to_contacts)