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

Example updates

parent 949699dc
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
# Dataset Description

This example is based on the DUD-E group; it contained 102
datasets that were designed for the evaluation of methods to
predict interactions between proteins and small molecules


Mysinger, Michael M., et al. "Directory of useful decoys, enhanced (DUD-E): better ligands and decoys for better benchmarking." Journal of medicinal chemistry 55.14 (2012): 6582-6594.
This example featurizes binding pockets extracted from the
PDBBind dataset and trains a random forest model to predict the
binding score of a ligand to this binding pocket.
+15 −1
Original line number Diff line number Diff line
@@ -17,7 +17,21 @@ import deepchem as dc

def compute_binding_pocket_features(pocket_featurizer, ligand_featurizer,
                                    pdb_subdir, pdb_code, threshold=.3):
  """Compute features for a given complex"""
  """Compute binding pocket features for a given complex

  Params
  ------
  pocket_featurizer: dc.feat.BindingPocketFeaturizer
    Pocket featurizer to use
  ligand_featurizer: dc.feat.Featurizer
    Ligand Featurizer to use
  pdb_subdir: str
    Directory holding PDB files
  pdb_code: str
    The 4 character PDB code for the protein
  threshold: float, optional
    TODO: Is this needed?
  """
  protein_file = os.path.join(pdb_subdir, "%s_protein.pdb" % pdb_code)
  ligand_file = os.path.join(pdb_subdir, "%s_ligand.sdf" % pdb_code)
  ligand_mol2 = os.path.join(pdb_subdir, "%s_ligand.mol2" % pdb_code)
+1 −5
Original line number Diff line number Diff line
"""
Script that trains Sklearn RF models on PDBbind Pockets dataset.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals

import os
import deepchem as dc
import numpy as np
@@ -15,7 +11,7 @@ from binding_pocket_datasets import load_pdbbind_pockets
np.random.seed(123)

split = "random"
subset = "full"
subset = "core"
pdbbind_tasks, pdbbind_datasets, transformers = load_pdbbind_pockets(
    split=split, subset=subset)
train_dataset, valid_dataset, test_dataset = pdbbind_datasets
+1 −1
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ model = dc.models.DAGModel(
    mode='regression')

# Fit trained model
model.fit(train_dataset, nb_epoch=50, checkpoint_interval=100)
model.fit(train_dataset, nb_epoch=10, checkpoint_interval=100)
print("Evaluating model")
train_scores = model.evaluate(train_dataset, [metric], transformers)
valid_scores = model.evaluate(valid_dataset, [metric], transformers)