Skip to content

Commit

Permalink
remove pyc
Browse files Browse the repository at this point in the history
  • Loading branch information
Wengong Jin committed Jan 28, 2019
1 parent 4ed4755 commit e25a4e2
Show file tree
Hide file tree
Showing 25 changed files with 10,512 additions and 37,288 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
smiles/
*.pyc
525 changes: 0 additions & 525 deletions diff_vae_gan/drd2/ste-h300s8b1.0/LOG

This file was deleted.

13 changes: 0 additions & 13 deletions diff_vae_gan/drd2/ste-h300s8b1.0/summary.txt

This file was deleted.

10,882 changes: 0 additions & 10,882 deletions diff_vae_gan/results.drd2

This file was deleted.

15,362 changes: 0 additions & 15,362 deletions diff_vae_gan/results.qed

This file was deleted.

20,988 changes: 10,494 additions & 10,494 deletions diff_vae_gan/results/results.drd2

Large diffs are not rendered by default.

Binary file removed fast_jtnn/__init__.pyc
Binary file not shown.
Binary file removed fast_jtnn/chemutils.pyc
Binary file not shown.
Binary file removed fast_jtnn/datautils.pyc
Binary file not shown.
Binary file removed fast_jtnn/diff_vae.pyc
Binary file not shown.
Binary file removed fast_jtnn/jtmpn.pyc
Binary file not shown.
Binary file removed fast_jtnn/jtnn_dec.pyc
Binary file not shown.
Binary file removed fast_jtnn/jtnn_enc.pyc
Binary file not shown.
Binary file removed fast_jtnn/mol_tree.pyc
Binary file not shown.
Binary file removed fast_jtnn/mpn.pyc
Binary file not shown.
Binary file removed fast_jtnn/nnutils.pyc
Binary file not shown.
Binary file removed fast_jtnn/scaff_gan.pyc
Binary file not shown.
Binary file removed props/__init__.pyc
Binary file not shown.
Binary file removed props/drd2_scorer.pyc
Binary file not shown.
Binary file removed props/properties.pyc
Binary file not shown.
Binary file removed props/sascorer.pyc
Binary file not shown.
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
rdkit
scikit-learn
torch
numpy
25 changes: 13 additions & 12 deletions scripts/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from multiprocessing import Pool

import math, random, sys
from optparse import OptionParser
import cPickle as pickle
import argparse

from fast_jtnn import *
import rdkit
Expand Down Expand Up @@ -34,21 +34,21 @@ def tensorize_pair(smiles_pair):
lg = rdkit.RDLogger.logger()
lg.setLevel(rdkit.RDLogger.CRITICAL)

parser = OptionParser()
parser.add_option("-t", "--train", dest="train_path")
parser.add_option("-n", "--split", dest="nsplits")
parser.add_option("-m", "--mode", dest="mode")
opts,args = parser.parse_args()
parser = argparse.ArgumentParser()
parser.add_argument('--train', required=True)
parser.add_argument('--mode', type=str, default='pair')
parser.add_argument('--ncpu', type=int, default=4)
args = parser.parse_args()

pool = Pool(12)
num_splits = int(opts.nsplits)
pool = Pool(args.ncpu)

if opts.mode == 'pair':
if args.mode == 'pair':
#dataset contains molecule pairs
with open(opts.train_path) as f:
with open(args.train) as f:
data = [line.strip("\r\n ").split()[:2] for line in f]

all_data = pool.map(tensorize_pair, data)
num_splits = len(data) / 10000

le = (len(all_data) + num_splits - 1) / num_splits

Expand All @@ -59,12 +59,13 @@ def tensorize_pair(smiles_pair):
with open('tensors-%d.pkl' % split_id, 'wb') as f:
pickle.dump(sub_data, f, pickle.HIGHEST_PROTOCOL)

elif opts.mode == 'single':
elif args.mode == 'single':
#dataset contains single molecules
with open(opts.train_path) as f:
with open(args.train) as f:
data = [line.strip("\r\n ").split()[0] for line in f]

all_data = pool.map(tensorize, data)
num_splits = len(data) / 10000

le = (len(all_data) + num_splits - 1) / num_splits

Expand Down

0 comments on commit e25a4e2

Please sign in to comment.