class_docstr: Counts hydrogen bonds between atoms in macromolecular complexes.
  
  Given a macromolecular complex made up of multiple
  constitutent molecules, count the number of hydrogen bonds
  between atoms in the macromolecular complex.
  
  Creates a scalar output of shape `(3,)` (assuming the default value
  ofor `distance_bins` with 3 bins) for each macromolecular complex
  that computes the total number of hydrogen bonds.
class_docstr_tok: ["Counts","hydrogen","bonds","between","atoms","in","macromolecular","complexes",".","Given","a","macromolecular","complex","made","up","of","multiple","constitutent","molecules",",","count","the","number","of","hydrogen","bonds","between","atoms","in","the","macromolecular","complex",".","Creates","a","scalar","output","of","shape","`","(","3",",",")","`","(","assuming","the","default","value","ofor","`","distance_bins","`","with","3","bins",")","for","each","macromolecular","complex","that","computes","the","total","number","of","hydrogen","bonds","."]
docstr: Compute featurization for a single mol/protein complex
  
  Parameters
  ----------
  datapoint: Tuple[str, str]
      Filenames for molecule and protein.
code: def _featurize(self, datapoint, **kwargs):  # -> Optional[np.ndarray]:
      """
      Compute featurization for a single mol/protein complex
  
      Parameters
      ----------
      datapoint: Tuple[str, str]
          Filenames for molecule and protein.
      """
      if "complex" in kwargs:
          datapoint = kwargs.get("complex")
          raise DeprecationWarning(
              'Complex is being phased out as a parameter, please pass "datapoint" instead.'
          )
      try:
          fragments = rdkit_utils.load_complex(
              datapoint, add_hydrogens=False
          )
  
      except MoleculeLoadException:
          logger.warning(
              "This molecule cannot be loaded by Rdkit. Returning None"
          )
          return None
      pairwise_features = []
      # We compute pairwise contact fingerprints
      # centroid = compute_contact_centroid(fragments, cutoff=self.cutoff)
      if self.reduce_to_contacts:
          fragments = reduce_molecular_complex_to_contacts(
              fragments, self.cutoff
          )
      # We compute pairwise contact fingerprints
      for frag1_ind, frag2_ind in itertools.combinations(
          range(len(fragments)), 2
      ):
          frag1, frag2 = fragments[frag1_ind], fragments[frag2_ind]
          distances = compute_pairwise_distances(frag1[0], frag2[0])
          # frag1_xyz = subtract_centroid(frag1[0], centroid)
          # frag2_xyz = subtract_centroid(frag2[0], centroid)
          # xyzs = [frag1_xyz, frag2_xyz]
          # rdks = [frag1[1], frag2[1]]
          pairwise_features.append(
              np.concatenate(
                  [
                      np.array([len(hbond_list)])
                      for hbond_list in compute_hydrogen_bonds(
                          frag1,
                          frag2,
                          distances,
                          self.distance_bins,
                          self.angle_cutoffs,
                      )
                  ],
                  axis=-1,
              )
          )
      # Features are of shape (voxels_per_edge, voxels_per_edge, voxels_per_edge, 1) so we should concatenate on the last axis.
      return np.concatenate(pairwise_features, axis=-1)
  
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 2 for calling the HydrogenBondCounter obj's underlying member method code with example usage: obj._featurize(datapoint) and returns: np, None