diff --git a/CHANGES.md b/CHANGES.md index 5336b63..bec2142 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,14 @@ Changes ======= +WIP +--- + +* Updated packages in requirements.txt +* Fingerprint now cast as float instead of np.float +* Fixed an error that prevented DeepFrag from loading PDB files without .pdb + extension. (Affects only recent versions of prody?) + 1.0.3 ----- diff --git a/deepfrag.py b/deepfrag.py index 1abfd8f..75ff418 100644 --- a/deepfrag.py +++ b/deepfrag.py @@ -104,7 +104,8 @@ def load_pdb(pdb_id, resnum): if not os.path.exists(complex_path): download_pdb(pdb_id, complex_path) - m = prody.parsePDB(str(complex_path)) + with open(str(complex_path), 'r') as f: + m = prody.parsePDBStream(f) rec = m.select('not (nucleic or hetatm) and not water') lig = m.select('resnum %d' % resnum) @@ -194,13 +195,14 @@ def preprocess_ligand_with_removal_point(lig, conn, rvec): def lookup_atom_name(lig_path, name): """Try to look up an atom by name. Returns the coordinate of the atom if found.""" - p = prody.parsePDB(lig_path) - p = p.select('name %s' % name) + with open(lig_path, 'r') as f: + p = prody.parsePDBStream(f) + p = p.select(f'name {name}') if p is None: - print('[!] Error: no atom with name "%s" in ligand' % name) + print(f'[!] Error: no atom with name "{name}" in ligand') exit(-1) elif len(p) > 1: - print('[!] Error: multiple atoms with name "%s" in ligand' % name) + print(f'[!] Error: multiple atoms with name "{name}" in ligand') exit(-1) return p.getCoords()[0] diff --git a/scripts/split_moad.py b/scripts/split_moad.py index c161a77..79a914e 100644 --- a/scripts/split_moad.py +++ b/scripts/split_moad.py @@ -26,7 +26,8 @@ def load_example(path, target): - m = prody.parsePDB(path) + with open(path, 'r') as f: + m = prody.parsePDBStream(f) rec = m.select('not (nucleic or hetatm) and not water')