boltz icon indicating copy to clipboard operation
boltz copied to clipboard

KeyError: 'test_' when using custom FASTA headers instead of A/B chain names

Open shahryary opened this issue 9 months ago • 0 comments

I encountered a KeyError: 'test_' when running Boltz-1 with a custom FASTA file. The traceback indicates the issue arises from the chain name not matching the expected keys in chain_to_msa.

It turns out that the input FASTA requires the chain headers to be exactly:

>A|protein|./examples/msa/seq1.a3m
QLEDSEVEAVAKGLEEMYANGVTEDNFKNYVKNNFAQQEISSVEEELNV
>B|protein|./examples/msa/seq2.a3m
CVANKIKDEFFAMISISAIVKAAQKKAWKELAVTVLRFAKANGLKTNAIIV

Using anything else (e.g., >test_ instead of >A or >B) results in a failure during schema parsing.

Full report:

Traceback (most recent call last):
  File "/boltz/bin/boltz", line 8, in <module>
    sys.exit(cli())
  File "/boltz/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/boltz/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/boltz/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/boltz/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/boltz/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/boltz/src/boltz/main.py", line 683, in predict
    process_inputs(
  File "/boltz/lib/python3.10/site-packages/lightning_utilities/core/rank_zero.py", line 41, in wrapped_fn
    return fn(*args, **kwargs)
  File "/boltz/src/boltz/main.py", line 480, in process_inputs
    raise e
  File "/boltz/src/boltz/main.py", line 384, in process_inputs
    target = parse_fasta(path, ccd)
  File "/boltz/src/boltz/data/parse/fasta.py", line 129, in parse_fasta
    return parse_boltz_schema(name, data, ccd)
  File "/boltz/src/boltz/data/parse/schema.py", line 1250, in parse_boltz_schema
    msa_id=chain_to_msa[chain["name"]],
KeyError: 'test_'

shahryary avatar May 16 '25 14:05 shahryary