Skip to content

Commit 66c30c2

Browse files
authored
Update inputs.py (#239)
1 parent e258e55 commit 66c30c2

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

alphafold3_pytorch/inputs.py

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2697,10 +2697,28 @@ def pdb_input_to_molecule_input(
26972697
# NOTE: this is the template cutoff date for all inference tasks
26982698
template_cutoff_date = datetime.strptime("2021-09-30", "%Y-%m-%d")
26992699

2700-
if exists(i.max_num_template_tokens) and num_tokens * i.num_templates_per_chain > i.max_num_template_tokens:
2701-
raise ValueError(
2702-
f"The number of tokens ({num_tokens}) multiplied by the number of templates per structure ({i.num_templates_per_chain}) must not exceed the maximum total number of template tokens {(i.max_num_template_tokens)}. "
2703-
"Skipping this example."
2700+
if (
2701+
exists(i.max_num_template_tokens)
2702+
and num_tokens * i.num_templates_per_chain > i.max_num_template_tokens
2703+
):
2704+
logger.warning(
2705+
f"The number of tokens ({num_tokens}) multiplied by the number of templates per structure ({i.num_templates_per_chain}) exceeds the maximum total number of template tokens {(i.max_num_template_tokens)}. "
2706+
"Skipping curation of template features for this example."
2707+
)
2708+
template_features = {}
2709+
else:
2710+
template_features = load_templates_from_templates_dir(
2711+
# NOTE: if templates are not locally available, no template features will be used
2712+
i.templates_dir,
2713+
mmcif_dir,
2714+
file_id,
2715+
chain_id_to_residue,
2716+
max_templates_per_chain=i.max_templates_per_chain,
2717+
num_templates_per_chain=i.num_templates_per_chain,
2718+
kalign_binary_path=i.kalign_binary_path,
2719+
template_cutoff_date=template_cutoff_date,
2720+
randomly_sample_num_templates=exists(i.training) and i.training,
2721+
verbose=verbose,
27042722
)
27052723

27062724
template_features = load_templates_from_templates_dir(

0 commit comments

Comments
 (0)