orinsid / localcolabfold

ColabFold on your local PC

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LocalColabFold

ColabFold on your local PC (or macOS). See also ColabFold repository.

What is LocalColabFold?

LocalColabFold is an installer script designed to make ColabFold functionality available on local users' machines. It supports wide range of operating systems, such as Windows 10 or later (using Windows Subsystem for Linux 2), macOS, and Linux.

Advantages of LocalColabFold

  • Structure inference and relaxation will be accelerated if your PC has Nvidia GPU and CUDA drivers.
  • No Time out (90 minutes and 12 hours)
  • No GPU limitations
  • NOT necessary to prepare the large database required for native AlphaFold2.

Note (Jun 18, 2022)

ColabFold now depends on JAX == 0.3.13 and jaxlib > 0.3.7, so you may encounter this error message after updating your localcolabfold using ./update_linux.sh:

  File "/path/to/colabfold_batch/colabfold-conda/lib/python3.7/site-packages/jax/_src/lib/__init__.py", line 91, in check_jaxlib_version
    raise RuntimeError(msg)
RuntimeError: jaxlib is version 0.1.72, but this version of jax requires version >= 0.3.7.

To fix this issue, please upgrade your jax and jaxlib:

# '/path/to/your/colabfold_batch' should be substituted to your path, e.g. '/home/moriwaki/Desktop/colabfold_batch'
# install GPU-supported jaxlib
/path/to/your/colabfold_batch/colabfold-conda/bin/python3.7 -m pip install https://storage.googleapis.com/jax-releases/cuda11/jaxlib-0.3.10+cuda11.cudnn82-cp37-none-manylinux2014_x86_64.whl
/path/to/your/colabfold_batch/colabfold-conda/bin/python3.7 -m pip install jax==0.3.13

New Updates

  • 16Jun2022, version 1.4.0 released. See Release v1.4.0
  • 07May2022, Updated update_linux.sh. See also How to update. Please use a new option --use-gpu-relax if GPU relaxation is required (recommended).
  • 12Apr2022, version 1.3.0 released. See Release v1.3.0
  • 09Dec2021, version 1.2.0-beta released. easy-to-use updater scripts added. See How to update.
  • 04Dec2021, LocalColabFold is now compatible with the latest pip installable ColabFold. In this repository, I will provide a script to install ColabFold with some external parameter files to perform relaxation with AMBER. The weight parameters of AlphaFold and AlphaFold-Multimer will be downloaded automatically at your first run.

Installation

For Linux

  1. Make sure curl, git, and wget commands are already installed on your PC. If not present, you need install them at first. For Ubuntu, type sudo apt -y install curl git wget.

  2. Make sure your Cuda compiler driver is 11.1 or later (If you don't have a GPU or don't plan to use a GPU, you can skip this section) :

    $ nvcc --version
    nvcc: NVIDIA (R) Cuda compiler driver
    Copyright (c) 2005-2020 NVIDIA Corporation
    Built on Mon_Oct_12_20:09:46_PDT_2020
    Cuda compilation tools, release 11.1, V11.1.105
    Build cuda_11.1.TC455_06.29190527_0
    
    DO NOT use nvidia-smi to check the version.
    See NVIDIA CUDA Installation Guide for Linux if you haven't installed it.

  3. Make sure your GNU compiler version is 4.9 or later because GLIBCXX_3.4.20 is required:

    $ gcc --version
    gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
    Copyright (C) 2019 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    
    If the version is 4.8.5 or older (e.g. CentOS 7), install a new one and add PATH to it.

  4. Download install_colabbatch_linux.sh from this repository:

    $ wget https://raw.githubusercontent.com/YoshitakaMo/localcolabfold/main/install_colabbatch_linux.sh
    and run it in the directory where you want to install:
    $ bash install_colabbatch_linux.sh
    About 5 minutes later, colabfold_batch directory will be created. Do not move this directory after the installation.

    Keep the network unblocked. And check the log output to see if there are any errors.

    If you find errors in the output log, the easiest way is to check the network and delete the colabfold_batch directory, then re-run the installation script.

  5. Add environment variable PATH:

    # For bash or zsh
    # e.g. export PATH="/home/moriwaki/Desktop/colabfold_batch/bin:$PATH"
    export PATH="<COLABFOLDBATCH_DIR>/bin:$PATH"
    It is recommended to add this export command to ~/.bashrc and restart bash (~/.bashrc will be executed every time bash is started)

  6. To run the prediction, type

    colabfold_batch --amber --templates --num-recycle 3 --use-gpu-relax inputfile outputdir/ 
    The result files will be created in the outputdir. Just use cpu to run the prediction, type
    colabfold_batch --amber --templates --num-recycle 3 --use-gpu-relax inputfile outputdir/ --cpu
    To run the AlphaFold2-multimer, type
    colabfold_batch --amber --templates --num-recycle 3 --use-gpu-relax --model-type AlphaFold2-multimer inputfile outputdir/
    The inputfile can be in csv format like this
    id,sequence
    Complex,<SEQUENCE>:<SEQUENCE>:<SEQUENCE>:<SEQUENCE>
    replace <SEQUENCE> with your sequence

    For more details, see colabfold_batch --help.

For WSL2 (in windows)

Before running the prediction:

export TF_FORCE_UNIFIED_MEMORY="1"
export XLA_PYTHON_CLIENT_MEM_FRACTION="4.0"
export XLA_PYTHON_CLIENT_ALLOCATOR="platform"
export TF_FORCE_GPU_ALLOW_GROWTH="true"

It is recommended to add these export commands to ~/.bashrc and restart bash (~/.bashrc will be executed every time bash is started)

For macOS

Caution: Due to the lack of Nvidia GPU/CUDA driver, the structure prediction on macOS are 5-10 times slower than on Linux+GPU. For the test sequence (58 a.a.), it may take 30 minutes. However, it may be useful to play with it before preparing Linux+GPU environment.

You can check whether your Mac is Intel or Apple Silicon by typing uname -m on Terminal.

$ uname -m
x86_64 # Intel
arm64  # Apple Silicon

Please use the correct installer for your Mac.

For Mac with Intel CPU

  1. Install Homebrew if not present:
    $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  2. Install wget, gnu-sed, HH-suite and kalign using Homebrew:
    $ brew install wget gnu-sed
    $ brew install brewsci/bio/hh-suite brewsci/bio/kalign
  3. Download install_colabbatch_intelmac.sh from this repository:
    $ wget https://raw.githubusercontent.com/YoshitakaMo/localcolabfold/main/install_colabbatch_intelmac.sh
    and run it in the directory where you want to install:
    $ bash install_colabbatch_intelmac.sh
    About 5 minutes later, colabfold_batch directory will be created. Do not move this directory after the installation.
  4. The rest procedure is the same as "For Linux".

For Mac with Apple Silicon (M1 chip)

Note: This installer is experimental because most of the dependent packages are not fully tested on Apple Silicon Mac.

  1. Install Homebrew if not present:
    $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  2. Install several commands using Homebrew (Now kalign 3.3.2 is available!):
    $ brew install wget cmake gnu-sed
    $ brew install brewsci/bio/hh-suite
    $ brew install brewsci/bio/kalign
  3. Install miniforge command using Homebrew:
    $ brew install --cask miniforge
  4. Download install_colabbatch_M1mac.sh from this repository:
    $ wget https://raw.githubusercontent.com/YoshitakaMo/localcolabfold/main/install_colabbatch_M1mac.sh
    and run it in the directory where you want to install:
    $ bash install_colabbatch_M1mac.sh
    About 5 minutes later, colabfold_batch directory will be created. Do not move this directory after the installation. You can ignore the installation errors that appear along the way.
  5. The rest procedure is the same as "For Linux".

A Warning message appeared when you run the prediction:

You are using an experimental build of OpenMM v7.5.1.
This is NOT SUITABLE for production!
It has not been properly tested on this platform and we cannot guarantee it provides accurate results.

This message is due to Apple Silicon, but I think we can ignore it.

How to update

Since ColabFold is still a work in progress, your localcolabfold should be also updated frequently to use the latest features. An easy-to-use update script is provided for this purpose.

To update your localcolabfold, simply type in the colabfold_batch directory:

# set your OS. Select one of the following variables {linux,intelmac,M1mac}
$ OS=linux # if Linux
# get the latest updater
$ wget https://raw.githubusercontent.com/YoshitakaMo/localcolabfold/main/update_${OS}.sh -O update_${OS}.sh
$ chmod +x update_${OS}.sh
# execute it.
$ ./update_${OS}.sh .

FAQ

  • What else do I need to do before installation? Do I need sudo privileges?
    • No, except for installation of curl and wget commands.
  • Do I need to prepare the large database such as PDB70, BFD, Uniclust30, MGnify...?
    • No. it is not necessary. Generation of MSA is performed by the MMseqs2 web server, just as implemented in ColabFold.
  • Are the pLDDT score and PAE figures available?
    • Yes, they will be generated just like the ColabFold.
  • Is it possible to predict homooligomers and complexes?
  • Is it possible to create MSA by jackhmmer?
    • No, it is not currently supported.
  • I want to use multiple GPUs to perform the prediction.
    • AlphaFold and ColabFold does not support multiple GPUs. Only One GPU can model your protein.
  • I got an error message CUDA_ERROR_ILLEGAL_ADDRESS: an illegal memory access was encountered.
    • You may not have updated to CUDA 11.1 or later. Please check the version of Cuda compiler with nvcc --version command, not nvidia-smi.
  • Is this available on Windows 10?
    • You can run LocalColabFold on your Windows 10 with WSL2.
  • (New!)I want to use a custom MSA file in the format of a3m.
    • ColabFold can accept various input files now. See the help messsage. You can set your own A3M file, a fasta file that contains multiple sequences (in FASTA format), or a directory that contains multiple fasta files.

Tutorials & Presentations

  • ColabFold Tutorial presented at the Boston Protein Design and Modeling Club. [video] [slides].

Acknowledgments

How do I reference this work?

  • Mirdita M, Schütze K, Moriwaki Y, Heo L, Ovchinnikov S and Steinegger M. ColabFold - Making protein folding accessible to all.
    Nature Methods (2022) doi: 10.1038/s41592-022-01488-1
  • If you’re using AlphaFold, please also cite:
    Jumper et al. "Highly accurate protein structure prediction with AlphaFold."
    Nature (2021) doi: 10.1038/s41586-021-03819-2
  • If you’re using AlphaFold-multimer, please also cite:
    Evans et al. "Protein complex prediction with AlphaFold-Multimer."
    BioRxiv (2021) doi: 10.1101/2021.10.04.463034v1
  • If you are using RoseTTAFold, please also cite:
    Minkyung et al. "Accurate prediction of protein structures and interactions using a three-track neural network."
    Science (2021) doi: 10.1126/science.abj8754

DOI

About

ColabFold on your local PC

License:MIT License


Languages

Language:Python 75.4%Language:Shell 24.6%