diff --git a/colabfold/utils.py b/colabfold/utils.py index 1cc9b94c..20fe35fa 100644 --- a/colabfold/utils.py +++ b/colabfold/utils.py @@ -205,8 +205,9 @@ def _save_dict(self, out_file): chain_idx = 1 for model in self.structure: for chain in model: - label_asym_id = asym_id_auth_to_label[chain.get_id()] - out_file.write(f"{label_asym_id} {chain_idx}\n") + if chain.get_id() in asym_id_auth_to_label: + label_asym_id = asym_id_auth_to_label[chain.get_id()] + out_file.write(f"{label_asym_id} {chain_idx}\n") chain_idx += 1 out_file.write("#\n")