original_docstring: 
          subsample_patch_coords: Read the geodesic coordinates in an easy to access format.
          pdb: the id of the protein pair in PDBID_CHAIN1_CHAIN2 format.
          pid: 'p1' if you want to read CHAIN1, 'p2' if you want to read CHAIN2
          cv: central vertex 
          frac: subsample the patch for speed. Not recommended.
          radius: the radius of the patch used for alignment.
      
docstring: Read the geodesic coordinates in an easy to access format.
  pdb: the id of the protein pair in PDBID_CHAIN1_CHAIN2 format.
  pid: 'p1' if you want to read CHAIN1, 'p2' if you want to read CHAIN2
  cv: central vertex
  frac: subsample the patch for speed. Not recommended.
  radius: the radius of the patch used for alignment.
docstring_tokens: Read the geodesic coordinates in an easy to access format . pdb : the id of the protein pair in PDBID_CHAIN1_CHAIN2 format . pid : ' p1 ' if you want to read CHAIN1 ' p2 ' if you want to read CHAIN2 cv : central vertex frac : subsample the patch for speed . Not recommended . radius : the radius of the patch used for alignment .
code: def subsample_patch_coords(pdb, pid, cv=None, frac=1.0, radius=9.0):
      """
          subsample_patch_coords: Read the geodesic coordinates in an easy to access format.
          pdb: the id of the protein pair in PDBID_CHAIN1_CHAIN2 format.
          pid: 'p1' if you want to read CHAIN1, 'p2' if you want to read CHAIN2
          cv: central vertex 
          frac: subsample the patch for speed. Not recommended.
          radius: the radius of the patch used for alignment.
      """
      patch_coords = spio.load_npz(os.path.join(coord_dir, pdb, pid + ".npz"))
  
      if cv is None:
          D = np.squeeze(
              np.asarray(patch_coords[:, : patch_coords.shape[1] // 2].todense())
          )
      else:
          D = np.squeeze(
              np.asarray(patch_coords[cv, : patch_coords.shape[1] // 2].todense())
          )
      # Get nonzero fields, points under radius.
      idx = np.where(np.logical_and(D > 0.0, D < radius))
  
      # Convert to dictionary;
  
      pc = {}
      for ii in range(len(idx[0])):
          # With probability frac, ignore this entry point - always include the center poitn.
          if cv is None:
              cvix = idx[0][ii]
              val = idx[1][ii]
          else:
              cvix = cv
              val = idx[0][ii]
          if np.random.random() < frac or cvix == val:
              if cvix not in pc:
                  pc[cvix] = []
              pc[cvix].append(val)
  
      return pc
code_tokens: def subsample_patch_coords ( pdb , pid , cv = None , frac = 1.0 , radius = 9.0 ) : patch_coords = spio . load_npz ( os . path . join ( coord_dir , pdb , pid + ".npz" ) ) if cv is None : D = np . squeeze ( np . asarray ( patch_coords [ : , : patch_coords . shape [ 1 ] // 2 ] . todense ( ) ) ) else : D = np . squeeze ( np . asarray ( patch_coords [ cv , : patch_coords . shape [ 1 ] // 2 ] . todense ( ) ) ) idx = np . where ( np . logical_and ( D > 0.0 , D < radius ) ) pc = { } for ii in range ( len ( idx [ 0 ] ) ) : if cv is None : cvix = idx [ 0 ] [ ii ] val = idx [ 1 ] [ ii ] else : cvix = cv val = idx [ 0 ] [ ii ] if np . random . random ( ) < frac or cvix == val : if cvix not in pc : pc [ cvix ] = [ ] pc [ cvix ] . append ( val ) return pc
short_docstring: subsample_patch_coords: Read the geodesic coordinates in an easy to access format.
short_docstring_tokens: subsample_patch_coords : Read the geodesic coordinates in an easy to access format .
comment: """
          subsample_patch_coords: Read the geodesic coordinates in an easy to access format.
          pdb: the id of the protein pair in PDBID_CHAIN1_CHAIN2 format.
          pid: 'p1' if you want to read CHAIN1, 'p2' if you want to read CHAIN2
          cv: central vertex 
          frac: subsample the patch for speed. Not recommended.
          radius: the radius of the patch used for alignment.
      """$SEP$# Get nonzero fields, points under radius.$SEP$# Convert to dictionary;$SEP$# With probability frac, ignore this entry point - always include the center poitn.