Skip to content

[BUG] IndexError: list index out of range #18

@chAwater

Description

@chAwater

Hi, I encountered an error when running the code.

python /THE_PATH/IPSAE/ipsae.py MODEL_confidences.json MODEL_model.cif 10 10
Traceback (most recent call last):
  File "/THE_PATH/IPSAE/ipsae.py", line 527, in <module>
    iptm_af3[chain1][chain2]=af3_chain_pair_iptm_data[nchain1][nchain2]
IndexError: list index out of range

The issue is caused by the way nchain is calculated, it assumes the chain IDs start from A and are continuous, which I think is not necessary.

IPSAE/ipsae.py

Lines 521 to 527 in b0a5493

af3_chain_pair_iptm_data=data_summary['chain_pair_iptm']
for chain1 in unique_chains:
nchain1= ord(chain1) - ord('A') # map A,B,C... to 0,1,2...
for chain2 in unique_chains:
if chain1 == chain2: continue
nchain2=ord(chain2) - ord('A')
iptm_af3[chain1][chain2]=af3_chain_pair_iptm_data[nchain1][nchain2]

In my input, the chain IDs are not continuous. For example, I have chain A and chain E, which causes nchain to be out of range.


Similar bug for Boltz1 - KeyError

IPSAE/ipsae.py

Lines 467 to 473 in b0a5493

boltz1_chain_pair_iptm_data=data_summary['pair_chains_iptm']
for chain1 in unique_chains:
nchain1= ord(chain1) - ord('A') # map A,B,C... to 0,1,2...
for chain2 in unique_chains:
if chain1 == chain2: continue
nchain2=ord(chain2) - ord('A')
iptm_boltz1[chain1][chain2]=boltz1_chain_pair_iptm_data[str(nchain1)][str(nchain2)]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions