sokrypton / sokrypton/ColabFold

ValueError: attempt to get argmax of an empty sequence

Open
#269 7 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

Expected Behavior

trying to get produced relaxed models of tcr-pmhc complexes running on the terminal (prior to the update it worked)

Current Behavior

In the fasta file contains the sequences of mhc:peptide:tcr-alpha:linker:tcr-beta (in that respective order separated by ':')
In the script, the only thing I changed is the max template date to 2018-04-30 instead of 2100-01-01 as that is my cutoff as AlphaFold is trained on protein chains in the PDB released before 2018-04-30.

Steps to Reproduce (for bugs)

/piercehome/cheungm/colabfold_batch/batch.py --amber --templates --num-recycle 3 --use-gpu-relax /piercehome/cheungm/FASTA_linker/Class_1/6l9l_linker.fasta /piercehome/cheungm/colabfold_batch/output_new/

ColabFold Output (for bugs)

2022-07-14 01:52:35,852 Running colabfold 1.3.0 (d9adee4372a543fc3ecd104476f5da476dc85a3a)
2022-07-14 01:52:37,498 --max-msa can not be used in combination with AlphaFold2-multimer (--max-msa ignored)
WARNING: You are welcome to use the default MSA server, however keep in mind that it's a limited shared resource only capable of processing a few thousand MSAs per day. Please submit jobs only from a single IP address. We reserve the right to limit access to the server case-by-case when usage exceeds fair use.

If you require more MSAs:

  • You can precompute all MSAs with colabfold_search or

  • You can host your own API and pass it to --host-url
    2022-07-14 01:52:43,639 Found 8 citations for tools or databases
    2022-07-14 01:52:46,400 Query 1/1: 6l9l (length 415)
    2022-07-14 01:52:47,026 Sleeping for 10s. Reason: PENDING
    2022-07-14 01:52:57,617 Sleeping for 5s. Reason: RUNNING
    2022-07-14 01:53:03,198 Sleeping for 5s. Reason: RUNNING
    2022-07-14 01:53:08,802 Sleeping for 6s. Reason: RUNNING
    2022-07-14 01:53:15,389 Sleeping for 10s. Reason: RUNNING
    2022-07-14 01:53:25,988 Sleeping for 7s. Reason: RUNNING
    2022-07-14 01:53:33,596 Sleeping for 9s. Reason: RUNNING
    2022-07-14 01:53:43,226 Sleeping for 5s. Reason: RUNNING
    2022-07-14 01:53:48,835 Sleeping for 10s. Reason: RUNNING
    2022-07-14 01:53:59,435 Sleeping for 6s. Reason: RUNNING
    COMPLETE: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 750/750 [elapsed: 01:21 remaining: 00:00]
    2022-07-14 01:54:30,835 Sequence 0 found templates: ['3nfn_A', '1k5n_A', '1lk2_A', '6eny_F', '1s7q_A', '1s7v_D', '6at5_A', '1tmc_A', '3e3q_Y', '4nhu_E', '4ms8_A', '2qrs_A', '2qrt_A', '4nhu_E', '6at5_A', '6eny_F', '1s7v_D', '4nhu_E']
    2022-07-14 01:54:30,836 Sequence 1 found no templates
    2022-07-14 01:54:39,089 Sequence 2 found templates: ['5yax_A', '5yax_B', '6at6_A', '5fcs_L', '3wlw_D', '5wca_L', '3n9g_L', '5fcs_L', '4iml_B', '4iml_L', '5yax_A', '5yax_B', '5t93_A', '3wlw_D', '5wca_L', '3n9g_L', '4iml_B', '4iml_L', '6at6_A']
    2022-07-14 01:54:39,413 Sequence 3 found templates: []
    2022-07-14 01:54:51,460 Sequence 4 found templates: ['3e3q_F', '2apt_B', '3tf7_C', '3tf7_K', '2p1y_A', '1bwm_A', '2bnu_B', '4p46_B', '4p23_B', '2apx_A', '2p1y_A', '4ww1_B', '5e9d_E', '3tf7_C', '3tf7_K', '3r8b_D', '4h1l_H', '1bwm_A', '4p23_B', '4p46_B']
    COMPLETE: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 750/750 [elapsed: 00:01 remaining: 00:00]
    2022-07-14 01:54:53,595 Could not generate input features 6l9l: attempt to get argmax of an empty sequence
    Traceback (most recent call last):
    File "/piercehome/cheungm/colabfold_batch/batch.py", line 1353, in run
    model_type,
    File "/piercehome/cheungm/colabfold_batch/batch.py", line 1039, in generate_input_feature
    input_feature = process_multimer_features(features_for_chain)
    File "/piercehome/cheungm/colabfold_batch/batch.py", line 886, in process_multimer_features
    chain_features, chain_id
    File "/piercehome/cheungm/colabfold_batch/colabfold-conda/lib/python3.7/site-packages/alphafold/data/pipeline_multimer.py", line 88, in convert_monomer_features
    feature = np.argmax(feature, axis=-1).astype(np.int32)
    File "<array_function internals>", line 6, in argmax
    File "/piercehome/cheungm/colabfold_batch/colabfold-conda/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 1195, in argmax
    return _wrapfunc(a, 'argmax', axis=axis, out=out)
    File "/piercehome/cheungm/colabfold_batch/colabfold-conda/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 57, in _wrapfunc
    return bound(*args, **kwds)
    ValueError: attempt to get argmax of an empty sequence

Context

originally i got the same error in the now closed regarding the release date error (https://github.com/sokrypton/ColabFold/issues/267), however, after reinstalling colabfold on my cluster, leads to this new error which im unable to bypass.

Your Environment

prior to running i use a different cluster (that has more gpu's), module load gcc/cuda, and conda activate colabfold_conda

thank you in advance!

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 batch.py, especially generate_input_feature and process_multimer_features, then inspect AlphaFold's pipeline_multimer.py at convert_monomer_features. Reproduce the 6l9l command and compare the empty feature reaching np.argmax with the log showing that sequence 3 has no templates. Done means the reported input can complete feature generation without this ValueError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
bioinformatics, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.