From b2f86e6369cf129751c4bd0f5a8034e5075255f4 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Tue, 12 Sep 2023 22:04:56 -0700 Subject: [PATCH] Don't confuse chains even if molecule name == chain ID Add the type to the map key so that a molecule name can never match a chain ID. --- modules/mmcif/pyext/src/data.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/mmcif/pyext/src/data.py b/modules/mmcif/pyext/src/data.py index 4dd5678360..8508a17d0a 100644 --- a/modules/mmcif/pyext/src/data.py +++ b/modules/mmcif/pyext/src/data.py @@ -117,7 +117,11 @@ def _handle_chain(self, chain): mol = get_molecule(chain) asym_id = chain.get_id() name = mol.get_name() if mol else None - map_key = name or asym_id + # Avoid conflict between name="A" and asym_id="A" + if name: + map_key = "name", name + else: + map_key = "asym_id", asym_id else: modeled = False asym_id = None