Commit 080d140b authored by leswing's avatar leswing
Browse files

Formatting

parent 03ef391a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -64,7 +64,8 @@ def load_molecule(molecule_file, add_hydrogens=True, calc_charges=True):
  elif ".pdbqt" in molecule_file:
    raise MoleculeLoadException("Don't support pdbqt files yet")
  elif ".pdb" in molecule_file:
    my_mol = Chem.MolFromPDBFile(str(molecule_file), sanitize=False, removeHs=False)
    my_mol = Chem.MolFromPDBFile(
        str(molecule_file), sanitize=False, removeHs=False)
  else:
    raise ValueError("Unrecognized file type")

+3 −2
Original line number Diff line number Diff line
@@ -132,12 +132,12 @@ def compute_single_pdbbind_feature(x):
    return None
  return ind, computed_feature


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)
  features = grid_featurizer.featurize_complexes([ligand_file],
                                                 [protein_file])
  features = grid_featurizer.featurize_complexes([ligand_file], [protein_file])
  features = np.squeeze(features)
  return features

@@ -163,5 +163,6 @@ def load_pdbbind_grid(split="index", featurizer="grid", subset="full"):

  return tasks, (train, valid, test), transformers


if __name__ == "__main__":
  load_pdbbind_grid()