Commit 6f6b9ad1 authored by Bharath Ramsundar's avatar Bharath Ramsundar
Browse files

Cleanup

parent 65f7c28f
Loading
Loading
Loading
Loading
+0 −19
Original line number Diff line number Diff line
@@ -29,11 +29,6 @@ def get_xyz_from_ob(ob_mol):
  returns an m x 3 np array of 3d coords
  of given openbabel molecule
  """
  ######################################################### DEBUG
  #print("get_xyz_from_ob")
  #print("ob_mol.NumAtoms()")
  #print(ob_mol.NumAtoms())
  ######################################################### DEBUG
  xyz = np.zeros((ob_mol.NumAtoms(), 3))
  for i, atom in enumerate(ob.OBMolAtomIter(ob_mol)):
    xyz[i, 0] = atom.x()
@@ -891,10 +886,6 @@ class GridFeaturizer(ComplexFeaturizer):
  def _featurize_complex(self, ligand_ext, ligand_lines, protein_pdb_lines):
    tempdir = tempfile.mkdtemp()

    ############################################################### DEBUG
    #print("ligand_lines")
    #print(ligand_lines)
    ############################################################### DEBUG
    ############################################################## TIMING
    time1 = time.time()
    ############################################################## TIMING
@@ -968,12 +959,6 @@ class GridFeaturizer(ComplexFeaturizer):
    if not self.ligand_only:
      protein_xyz, protein_ob = load_molecule(
          protein_pdb, calc_charges=False)
      ############################################################ DEBUG
      #print("protein_pdb")
      #print(protein_pdb)
      #print("protein_xyz")
      #print(protein_xyz)
      ############################################################ DEBUG
    ############################################################## TIMING
    time2 = time.time()
    log("TIMING: Loading protein coordinates took %0.3f s" % (time2-time1),
@@ -1026,10 +1011,6 @@ class GridFeaturizer(ComplexFeaturizer):
          _featurize_binding_pocket_ecfp(
              protein_xyz, protein_ob, ligand_xyz, ligand_ob,
              pairwise_distances, cutoff=4.5, ecfp_degree=self.ecfp_degree))
      ################################################################ DEBUG
      #print("protein_ecfp_dict")
      #print(protein_ecfp_dict)
      ################################################################ DEBUG
      ############################################################## TIMING
      time2 = time.time()
      log("TIMING: ecfp voxel computataion took %0.3f s" % (time2-time1),
+1 −18
Original line number Diff line number Diff line
@@ -32,12 +32,6 @@ def compute_pdbbind_features(grid_featurizer, pdb_subdir, pdb_code):
  """Compute features for a given complex"""
  protein_file = os.path.join(pdb_subdir, "%s_protein.pdb" % pdb_code)
  ligand_file = os.path.join(pdb_subdir, "%s_ligand.sdf" % pdb_code)
  ################################################################ DEBUG
  #print("protein_file")
  #print(protein_file)
  #print("ligand_file")
  #print(ligand_file)
  ################################################################ DEBUG
  features = grid_featurizer.featurize_complexes(
    [ligand_file], [protein_file])
  features = np.squeeze(features)
@@ -85,12 +79,8 @@ def load_core_pdbbind_grid(split="index", feat="grid"):
  feature_len = None
  y_inds = []
  for ind, pdb_code in enumerate(ids):
    print("Processing %s" % str(pdb_code))
    print("Processing complex %d, %s" % (ind, str(pdb_code)))
    pdb_subdir = os.path.join(pdbbind_dir, pdb_code)
    ######################################################## DEBUG
    #print("pdb_subdir, pdb_code")
    #print(pdb_subdir, pdb_code)
    ######################################################## DEBUG
    computed_feature = compute_pdbbind_features(
        featurizer, pdb_subdir, pdb_code)
    if feature_len is None:
@@ -100,13 +90,6 @@ def load_core_pdbbind_grid(split="index", feat="grid"):
      continue
    y_inds.append(ind)
    features.append(computed_feature)
    ######################################################## DEBUG
    #print("np.count_nonzero(computed_feature)")
    #print(np.count_nonzero(computed_feature))
    #print("computed_feature")
    #print(computed_feature)
    ##assert 0 == 1
    ######################################################## DEBUG
  y = y[y_inds]
  X = np.vstack(features)
  w = np.ones_like(y)