Opened 2 years ago

Closed 2 years ago

#10115 closed defect (fixed)

Update AlphaFold prediction to fix error "SVD did not converge"

Reported by: dmargulies@… Owned by: Tom Goddard
Priority: moderate Milestone:
Component: Structure Prediction Version:
Keywords: Cc:
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description (last modified by Tom Goddard)

Begin forwarded message:

From: "Margulies, David (NIH/NIAID)
Subject: [chimerax-users] Alphafold2_multimer on chimeraX
Date: November 8, 2023 at 7:41:29 AM PST
To: "chimerax-users@…" <chimerax-users@…>
Reply-To: "Margulies, David (NIH/NIAID) [E]"

Beginning yesterday, I have had repeated failure of alphafold2_multimer running through chimerax to generate models of two protein complexes (Ab H cand L chains, for instance). Individual chains work fine. The error from Colab AI says:

The error is due to a bug in the ColabFold library. The kabsch function in the colabfold.py file is using the linalg.svd function to calculate the singular value decomposition of a matrix. However, the linalg.svd function is not guaranteed to converge, and in some cases it can fail to converge. This can cause the kabsch function to fail, and in turn cause the plot_protein_backbone function to fail.

The bug has been fixed in the latest version of the ColabFold library, which is available on GitHub. To fix the error, you can upgrade to the latest version of the library. You can do this by running the following command in the Colab notebook:

content_copy
!pip install colabfold --upgrade
Use code with caution
Once you have upgraded to the latest version of the library, you can run the code again and the error should be fixed.

Can you advise? Thanks for your help.

D

David H. Margulies, MD, PhD
Chief, Molecular Biology Section
Laboratory of Immune System Biology
National Institute of Allergy and
Infectious Diseases
National Institutes of Health

Change History (1)

comment:1 by Tom Goddard, 2 years ago

Description: modified (diff)
Resolution: fixed
Status: assignedclosed

Fixed.

I updated ColabFold to the November 1, 2023 github source code. This error had been reported before to the ColabFold github

https://github.com/sokrypton/ColabFold/issues/508

The problem arose because Google Colab updated CUDA version from 11 to 12 that required a jax update (jax is the library Colabfold uses to run calculations on the GPU with CUDA) and the jax update broke the Colabfold call to singular value decomposition (SVD) that was being used to orient the molecules when plotting them in the output. The fix had been hacked into the ColabFold repository in its web server script by changing a line in AlphaFold, and the ChimeraX code to install Colabfold needed to do the same hack. Here were the added lines

# patch for jax > 0.3.25
sed -i 's/weights = jax.nn.softmax(logits)/logits=jnp.clip(logits,-1e8,1e8);weights=jax.nn.softmax(logits)/g' /usr/local/lib/python{python_version}/dist-packages/alphafold/model/modules.py

I tested predicting chains A and B in PDB 1a0m which exhibited the error and now runs correctly.

Note: See TracTickets for help on using tickets.