Skip to content

Commit

Permalink
tolerate inconsistencies between pdb_assembly and multi_label (dptech…
Browse files Browse the repository at this point in the history
…-corp#119)

* tolerate inconsistencies between pdb_assembly and multi_label

* Update dataset.py
  • Loading branch information
ZiyaoLi committed May 11, 2023
1 parent a94b03c commit a272252
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions unifold/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,10 +443,15 @@ def __getitem__(self, idx):
else:
pdb_id = self.get_pdb_name(label_id)
if pdb_id in self.pdb_assembly and self.mode == "train":
label_ids = [
pdb_id + "_" + id for id in self.pdb_assembly[pdb_id]["chains"]
]
symmetry_operations = [t for t in self.pdb_assembly[pdb_id]["opers"]]
label_ids = []
symmetry_operations = []
for cid, op in zip(self.pdb_assembly[pdb_id]["chains"], self.pdb_assembly[pdb_id]["opers"]):
lid = pdb_id + "_" + cid
if lid not in self.inverse_multi_label:
logger.warning(f"sequence id of {lid} cannot be found. chain ignored in the assembly.")
else:
label_ids.append(lid)
symmetry_operations.append(op)
else:
label_ids = self.pdb_chains[pdb_id]
symmetry_operations = None
Expand Down

0 comments on commit a272252

Please sign in to comment.