sokrypton / sokrypton/ColabFold

Max number of chains for multimer

Open
#309 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
2.9k
Forks
747
PR merge metrics
No merged PRs in 30d

Description

Steps to Reproduce (for bugs)

Example input: RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK:RIIIIK

with more than 62 chains, colabfold will throw the following error:

ColabFold Output (for bugs)

Traceback (most recent call last):
File "/home/zhouj0d/software/anaconda3/envs/af2/lib/python3.8/site-packages/colabfold/batch.py", line 1352, in run
(input_features, domain_names) = generate_input_feature(
File "/home/zhouj0d/software/anaconda3/envs/af2/lib/python3.8/site-packages/colabfold/batch.py", line 1030, in generate_input_feature
features_for_chain[protein.PDB_CHAIN_IDS[chain_cnt]] = feature_dict
IndexError: string index out of range

Reason

The maximum number of chains is fixed to 62 in the alphafold package, indexed with ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.

Solution

To work around and support unlimited number of chains, we can modify line 30 at alphafold/common/protein.py from

PDB_CHAIN_IDS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'

to

PDB_CHAIN_IDS = [str(i) for i in range(10000)]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with alphafold/common/protein.py, especially PDB_CHAIN_IDS, then trace its use in colabfold/batch.py at generate_input_feature. Reproduce the failure with the provided input containing more than 62 chains and verify that processing no longer raises IndexError for that case.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
bioinformatics
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.