class_docstr: A class that represents a fragment of a molecule.
  
  It's often convenient to represent a fragment of a molecule. For
  example, if two molecules form a molecular complex, it may be useful
  to create two fragments which represent the subsets of each molecule
  that's close to the other molecule (in the contact region).
  
  Ideally, we'd be able to do this in RDKit direct, but manipulating
  molecular fragments doesn't seem to be supported functionality.
  
  Examples
  --------
  >>> import numpy as np
  >>> from rdkit import Chem
  >>> mol = Chem.MolFromSmiles("C")
  >>> coords = np.array([[0.0, 0.0, 0.0]])
  >>> atom = mol.GetAtoms()[0]
  >>> fragment = MolecularFragment([atom], coords)
class_docstr_tok: ["A","class","that","represents","a","fragment","of","a","molecule",".","It","'s","often","convenient","to","represent","a","fragment","of","a","molecule",".","For","example",",","if","two","molecules","form","a","molecular","complex",",","it","may","be","useful","to","create","two","fragments","which","represent","the","subsets","of","each","molecule","that","'s","close","to","the","other","molecule","(","in","the","contact","region",")",".","Ideally",",","we","'d","be","able","to","do","this","in","RDKit","direct",",","but","manipulating","molecular","fragments","does","n't","seem","to","be","supported","functionality",".","Examples","--","--","--","--",">",">",">","import","numpy","as","np",">",">",">","from","rdkit","import","Chem",">",">",">","mol","=","Chem.MolFromSmiles","(","``","C","''",")",">",">",">","coords","=","np.array","(","[","[","0.0",",","0.0",",","0.0","]","]",")",">",">",">","atom","=","mol.GetAtoms","(",")","[","0","]",">",">",">","fragment","=","MolecularFragment","(","[","atom","]",",","coords",")"]
docstr: Initialize this object.
  
  Parameters
  ----------
  atoms: Iterable[rdkit.Chem.rdchem.Atom]
      Each entry in this list should be a RDKit Atom.
  coords: np.ndarray
      Array of locations for atoms of shape `(N, 3)` where `N ==
      len(atoms)`.
docstr_tok: ["Initialize","this","object",".","Parameters","--","--","--","--","--","atoms",":","Iterable","[","rdkit.Chem.rdchem.Atom","]","Each","entry","in","this","list","should","be","a","RDKit","Atom",".","coords",":","np.ndarray","Array","of","locations","for","atoms","of","shape","`","(","N",",","3",")","`","where","`","N","==","len","(","atoms",")","`","."]
code: def __init__(self, atoms: Sequence[RDKitAtom], coords: np.ndarray):
      """Initialize this object.
  
      Parameters
      ----------
      atoms: Iterable[rdkit.Chem.rdchem.Atom]
          Each entry in this list should be a RDKit Atom.
      coords: np.ndarray
          Array of locations for atoms of shape `(N, 3)` where `N ==
          len(atoms)`.
      """
      if not isinstance(coords, np.ndarray):
          raise ValueError(
              "Coords must be a numpy array of shape (N, 3)"
          )
      if coords.shape != (len(atoms), 3):
          raise ValueError(
              "Coords must be a numpy array of shape `(N, 3)` where `N == len(atoms)`."
          )
      self.atoms = [
          AtomShim(x.GetAtomicNum(), get_partial_charge(x), coords[ind])
          for ind, x in enumerate(atoms)
      ]
      self.coords = coords
  
imports: import itertools
  import numpy
  from typing import List, Optional, Sequence, Set, Tuple, Union
  import logging
  from deepchem.utils.typing import RDKitAtom, RDKitMol
  from deepchem.utils.geometry_utils import compute_pairwise_distances
label_desc: Use image node_id 1 to create a new MolecularFragment object from inherited base classes: object with example: obj = MolecularFragment(atoms, coords)