Skip to content

Commit

Permalink
Update io.py
Browse files Browse the repository at this point in the history
  • Loading branch information
gandrianov authored Jul 13, 2021
1 parent 2188577 commit 42dcb04
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions utils/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,12 @@ def solve_problem(mol):

def read_pdb(filename, add_hs=True, remove_hs=False, proximity_bonding=False, sanitize=False, params=None):

mol = Chem.MolFromPDBFile(filename, removeHs=remove_hs,
with open(filename, "r") as pdb:
pdb = pdb.read().split("\n")
pdb = [p for p in pdb if p.startswith("ATOM") or p.startswith("HETATM")]
pdb = "\n".join(pdb)

mol = Chem.MolFromPDBBlock(filename, removeHs=remove_hs,
proximityBonding=proximity_bonding,
sanitize=sanitize)

Expand Down Expand Up @@ -398,4 +403,4 @@ def get_atoms_names(mol):
except:
pass

return dic
return dic

0 comments on commit 42dcb04

Please sign in to comment.