From 4f79c783149258ade7f6ae1cf2620e601ae30941 Mon Sep 17 00:00:00 2001 From: Clay Moore Date: Thu, 30 Jul 2026 15:34:15 -0500 Subject: [PATCH] Fix loading input JSON written by AlphaFold 3 <= 3.0.3 Templates written before 3.0.4 serialize an empty query_to_template_map as "templateIndices": null. The write side was fixed in 62136ec, but the read side passes the null into zip(), raising TypeError. Reading older input JSON is supported (JSON_VERSIONS is (1, 2, 3, 4)). Also add strict=True so mismatched queryIndices/templateIndices lengths are rejected rather than silently truncated. --- src/alphafold3/common/folding_input.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/alphafold3/common/folding_input.py b/src/alphafold3/common/folding_input.py index 5ac92bf6..c66cde7c 100644 --- a/src/alphafold3/common/folding_input.py +++ b/src/alphafold3/common/folding_input.py @@ -386,7 +386,12 @@ def from_dict( if mmcif_path: mmcif = _read_file(path=mmcif_path, json_path=json_path) query_to_template_map = dict( - zip(raw_template['queryIndices'], raw_template['templateIndices']) + zip( + raw_template['queryIndices'], + # AlphaFold 3 <= 3.0.3 wrote null here for an empty map. + raw_template['templateIndices'] or [], + strict=True, + ) ) templates.append( Template(mmcif=mmcif, query_to_template_map=query_to_template_map)