Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tolerate inconsistencies between pdb_assembly and multi_label #119

Merged
merged 2 commits into from
May 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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