ColabFold icon indicating copy to clipboard operation
ColabFold copied to clipboard

Predicting a complex with pair_mode="unpaired" fails

Open moritzschaefer opened this issue 4 years ago • 1 comments

Expected Behavior

Runs fine

Current Behavior

The program fails, due to the lack of the paired_msa variable.

Steps to Reproduce (for bugs)

  • Predict a complex using the AlphaFold2.ipynb notebook
  • Choose parameter pair_mode="unpaired"

ColabFold Output (for bugs)

2022-04-02 08:51:28,698 Could not generate input features 3f5wcomplex_da929: 'NoneType' object is not subscriptable Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/colabfold/batch.py", line 1141, in run model_type, File "/usr/local/lib/python3.7/dist-packages/colabfold/batch.py", line 839, in generate_input_feature paired_msa[sequence_index] TypeError: 'NoneType' object is not subscriptable 2022-04-02 08:51:28,700 Done

Context

Three relatively short chains that are not necessarily found as complexes in nature.

Your Environment

Current main branch (https://github.com/sokrypton/ColabFold/commit/b532e910b15434f707f0b7460abc25c70fcb9b26), running on Google Colab

moritzschaefer avatar Apr 02 '22 09:04 moritzschaefer

One of my friends encountered the same issue. The problem is the variable "paired_msa" is None. I think this code block should be fixed in either way:

                if is_complex and (paired_msa is not None):
                    all_seq_features = build_multimer_feature(
                        paired_msa[sequence_index]
                    )
                    feature_dict.update(all_seq_features)

or

                if is_complex:
                    if paired_msa is None:
                        pass # do something for single sequence?
                    else:
                        all_seq_features = build_multimer_feature(
                            paired_msa[sequence_index]
                        )
                    feature_dict.update(all_seq_features)

I tried to make a PR for this issue but was not sure which one would be correct.

huhlim avatar Apr 08 '22 16:04 huhlim