Skip to content

Commit 53c145f

Browse files
committed
python3 fixes
1 parent 0f7cb6f commit 53c145f

14 files changed

+18
-17
lines changed

Diff for: bootstrap.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22

33
import predict
44
import sklearn.metrics

Diff for: calctop.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22

33
import numpy as np
44
import os, sys

Diff for: clustering.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22

33

44
from Bio.PDB.PDBParser import PDBParser

Diff for: combine_fold_results.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22

33
import numpy as np
44
import matplotlib

Diff for: combine_rows.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22

33
'''Combine the output of compute_rows.py into a pickle file for clustering.py'''
44

Diff for: compute_row.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22

33
'''Compute a single row of a distance matrix from a pdbinfo file.
44
This allows for distributed processing'''

Diff for: compute_seqs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22

33
'''Given a pdbinfo file output sequence information for each chain'''
44

Diff for: create_caches.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22

33
'''Takes a bunch of types training files. First argument is what index the receptor starts on
44
(ligand is assumed to be right after). Reads in the gninatypes files specified in these types

Diff for: create_caches2.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22

33
'''Takes a bunch of types training files. First argument is what index the receptor starts on
44
(ligands are assumed to be right after). Reads in the gninatypes files specified in these types
@@ -9,7 +9,7 @@
99
'''
1010

1111
import os, sys
12-
import struct, argparse
12+
import struct, argparse, traceback
1313

1414

1515
def writemol(fname, out):
@@ -18,12 +18,13 @@ def writemol(fname, out):
1818
with open(fname,'rb') as gninatype:
1919
data = gninatype.read()
2020
assert(len(data) % 16 == 0)
21-
natoms = len(data)/16
21+
natoms = len(data)//16
2222
out.write(struct.pack('i',natoms))
2323
out.write(data)
2424
except Exception as e:
2525
print(fname)
2626
print(e)
27+
traceback.print_exc()
2728

2829
def create_cache2(molfiles, data_root, outfile):
2930
'''Create an outfile molcache2 file from the list molfiles stored at data_root.'''
@@ -46,7 +47,7 @@ def create_cache2(molfiles, data_root, outfile):
4647
if len(mol) > 255:
4748
print("Skipping",mol,"since filename is too long")
4849
continue
49-
s = bytes(mol)
50+
s = bytes(mol, encoding='UTF-8')
5051
out.write(struct.pack('B',len(s)))
5152
out.write(s)
5253
out.write(struct.pack('L',offsets[mol]))

Diff for: predict.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22

33
import numpy as np
44
import matplotlib

Diff for: pymol_arrows.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22

33

44
import sys

Diff for: show_xyz_arrows.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
'''Adds show_arrows command to pymol, which takes an xyz file'''
33

44
import sys

Diff for: timemodel.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22

33
'''quick script for generating a real model and caffe time command'''
44
import argparse,sys

Diff for: train.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22

33
import numpy as np
44
import matplotlib

0 commit comments

Comments
 (0)