Created
February 27, 2018 00:19
-
-
Save ravila4/fc968318d87d66fb7d48e57efbe5c61a to your computer and use it in GitHub Desktop.
Test script to to generate features on the PDBbind dataset, using DeepChem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ricardo Avila | |
# Script to use grid featurizer on the PDBbind dataset | |
import glob | |
import csv | |
import deepchem as dc | |
from deepchem.feat.rdkit_grid_featurizer import RdkitGridFeaturizer | |
receptors = glob.glob("./refined-set/*/*protein.pdb") | |
ligands = glob.glob("./refined-set/*/*ligand.sdf") | |
names = [n.split("/")[2] for n in glob.glob("./refined-set/*/*protein.pdb")] | |
GridFeaturizer = RdkitGridFeaturizer(voxel_width=16.0, | |
feature_types=["all_combined"], | |
ecfp_power=5, | |
splif_power=5, | |
flatten=True) | |
# Get features | |
for i in range(len(names)): | |
try: | |
print("Receptor", names[i]) | |
GridFeaturizer.featurize_complexes([ligands[i]], [receptors[i]]) | |
except: | |
print("There was an error") | |
#for feature in features: | |
# print(feature) | |
# print("Number of features:", len(feature)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment