From 7f6edd04a4aeffa65d349d51b1ca81cfd34549af Mon Sep 17 00:00:00 2001 From: Augustin Zidek Date: Fri, 31 Jan 2025 08:54:37 -0800 Subject: [PATCH] Fix templates to work with empty a3m Second fix needed for https://github.com/google-deepmind/alphafold3/issues/244 PiperOrigin-RevId: 721790067 Change-Id: Ib3eebf30f270b45d08cc94057a4feca5b4753d63 --- src/alphafold3/data/templates.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/alphafold3/data/templates.py b/src/alphafold3/data/templates.py index 7e80754..0de9eb1 100644 --- a/src/alphafold3/data/templates.py +++ b/src/alphafold3/data/templates.py @@ -517,6 +517,9 @@ def from_hmmsearch_a3m( """ def hit_generator(a3m: str): + if not a3m: + return # Hmmsearch could return an empty string if there are no hits. + for hit_seq, hit_desc in parsers.lazy_parse_fasta_string(a3m): pdb_id, auth_chain_id, start, end, full_length = _parse_hit_description( hit_desc