Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions clustering.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,15 +318,15 @@ def computeLigandSimilarity(target_names, fname):
ligand_threshold = args.ligand_similarity #this actually is a sim

if args.cpickle:
with open(args.cpickle, 'r') as file:
with open(args.cpickle, 'rb') as file:
(distanceMatrix, target_names,ligandsim) = pickle.load(file)
elif args.pdbfiles:
if args.verbose: print("reading pdbs...")
target_names, targets = readPDBfiles(args.pdbfiles)
if args.verbose: print("calculating distance matrix...")
distanceMatrix = calcDistanceMatrix(targets)
ligandsim = computeLigandSimilarity(target_names, args.pdbfiles) #returns similarity matrix indexed according to target_names
pickle.dump((distanceMatrix, target_names, ligandsim), open(args.pdbfiles+'.pickle','w'),-1)
pickle.dump((distanceMatrix, target_names, ligandsim), open(args.pdbfiles+'.pickle','wb'),-1)
else:
exit('error: need --cpickle or --pdbfiles to compute target distance matrix')
if args.verbose: print('Number of targets: {}'.format(len(target_names)))
Expand Down
2 changes: 1 addition & 1 deletion combine_rows.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@
print("Missing ligand_sim for",targets[i],targets[j])


pickle.dump((m, target_names, lm), open('matrix.pickle','w'),-1)
pickle.dump((m, target_names, lm), open('matrix.pickle','wb'),-1)