Skip to content

Commit

Permalink
Minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobdurrant committed Dec 19, 2023
1 parent cb12234 commit ac1bc25
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
8 changes: 8 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -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
-----

Expand Down
12 changes: 7 additions & 5 deletions deepfrag.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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]

Expand Down
3 changes: 2 additions & 1 deletion scripts/split_moad.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down

0 comments on commit ac1bc25

Please sign in to comment.