Giter VIP home page Giter VIP logo

localcolabfold's Introduction

LocalColabFold

ColabFold / AlphaFold2_advanced on your local PC (or macOS)

Installation

For Linux

  1. Make sure curl 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 wget.
  2. Make sure your Cuda compiler driver is 11.1 or later:
    $ 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 for checking the version.
    See NVIDIA CUDA Installation Guide for Linux if you haven't installed it.
  3. Download install_colabfold_linux.sh from this repository:
    $ wget https://raw.githubusercontent.com/YoshitakaMo/localcolabfold/main/install_colabfold_linux.sh
    and run it in the directory where you want to install:
    $ bash install_colabfold_linux.sh
    About 5 minutes later, colabfold directory will be created. Do not move this directory after the installation.
  4. Type cd colabfold to enter the directory.
  5. Modify the variables such as sequence = 'PIAQIHILEGRSDEQKETLIREVSEAISRSLDAPLTSVRVIITEMAKGHFGIGGELASK', jobname = "test", and etc. in runner.py for your prediction. For more information, please refer to the original ColabFold / AlphaFold2_advanced.
  6. To run the prediction, type
    $ colabfold-conda/bin/python3.7 runner.py
    in the colabfold directory. The result files will be created in the predition_<jobname>_<hash> in the colabfold directory. After the prediction finished, you may move the results from the colabfold directory.

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 command using Homebrew:
    $ brew install wget
  3. Download install_colabfold_intelmac.sh from this repository:
    $ wget https://raw.githubusercontent.com/YoshitakaMo/localcolabfold/main/install_colabfold_intelmac.sh
    and run it in the directory where you want to install:
    $ bash install_colabfold_intelmac.sh
    About 5 minutes later, colabfold 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 wget and cmake commands using Homebrew:
    $ brew install wget cmake
  3. Install miniforge command using Homebrew:
    $ brew install --cask miniforge
  4. Download install_colabfold_M1mac.sh from this repository:
    $ wget https://raw.githubusercontent.com/YoshitakaMo/localcolabfold/main/install_colabfold_M1mac.sh
    and run it in the directory where you want to install:
    $ bash install_colabfold_M1mac.sh
    About 5 minutes later, colabfold directory will be created. Do not move this directory after the installation.
  5. Type cd colabfold to enter the directory.
  6. Modify the variables such as sequence = 'PIAQIHILEGRSDEQKETLIREVSEAISRSLDAPLTSVRVIITEMAKGHFGIGGELASK', jobname = "test", and etc. in runner.py for your prediction. For more information, please refer to the original ColabFold / AlphaFold2_advanced.
  7. To run the prediction, type
    $ colabfold-conda/bin/python3.8 runner.py
    in the colabfold directory. The result files will be created in the predition_<jobname>_<hash> in the colabfold directory. After the prediction finished, you may move the results from the colabfold directory.

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.

Usage of runner_af2advanced.py

runner_af2advanced.py is a python script that can take command-line arguments. This is more helpful for users who want to predict many sequences.

  1. Download runner_af2advanced.py on your colabfold directory:
    $ cd /path/to/colabfold 
    $ wget https://raw.githubusercontent.com/YoshitakaMo/localcolabfold/main/runner_af2advanced.py
  2. Place a FASTA file that contains the sequence you want to predict (e.g. 6x9z.fasta).
  3. run the file with command-line arguments. For example,
    # python3.7 for Linux and Intel Mac Users, otherwise python3.8
    $ colabfold-conda/bin/python3.7 runner_af2advanced.py \
    --input 6x9z.fasta \
    --output_dir 6x9z \
    --max_recycle 18 \
    --use_ptm \
    --use_turbo \
    --num_relax Top5
    
    where the input sequence 6x9z.fasta is
    >6X9Z_1|Chain A|Transmembrane beta-barrels|synthetic construct (32630)
    MEQKPGTLMVYVVVGYNTDNTVDVVGGAQYAVSPYLFLDVGYGWNNSSLNFLEVGGGVSYKVSPDLEPYVKAGFEYNTDNTIKPTAGAGALYRVSPNLALMVEYGWNNSSLQKVAIGIAYKVKD
    
    This will predict a protein structure 6x9z with increasing the number of 'recycling' to 18. This may be effective for de novo structure prediction. For another example, PDB: 3KUD,
    # python3.7 for Linux and Intel Mac Users, otherwise python3.8
    $ colabfold-conda/bin/python3.7 runner_af2advanced.py \
    --input 3kud_complex.fasta \
    --output_dir 3kud \
    --homooligomer 1:1 \
    --use_ptm \
    --use_turbo \
    --max_recycle 3 \
    --num_relax Top5
    where the input sequence 3kud_complex.fasta is
    >3KUD_complex
    MTEYKLVVVGAGGVGKSALTIQLIQNHFVDEYDPTIEDSYRKQVVIDGETCLLDILDTAGQEEYSAMRDQYMRTGEGFLCVFAINNTKSFEDIHQYREQIKRVKDSDDVPMVLVGNKCDLAARTVESRQAQDLARSYGIPYIETSAKTRQGVEDAFYTLVREIRQH:
    PSKTSNTIRVFLPNKQRTVVNVRNGMSLHDCLMKALKVRGLQPECCAVFRLLHEHKGKKARLDWNTDAASLIGEELQVDFL
    
    This will predict a hetelooligomer. For more information about the options, type colabfold-conda/bin/python3.7 runner_af2advanced.py --help or refer to the original ColabFold / AlphaFold2_advanced.

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.

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 run the predictions step-by-step like Google Colab.
  • I want to use multiple GPUs to perform the prediction.
    • You need to set the environment variables TF_FORCE_UNIFIED_MEMORY,XLA_PYTHON_CLIENT_MEM_FRACTION before execution. See this discussion.
  • I want to solve the ResourceExhausted error when trying to predict for a sequence with > 1000 residues.
    • See the same discussion as above.
  • 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.

Tutorials & Presentations

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

Acknowledgments

How do I reference this work?

  • Mirdita M, Ovchinnikov S and Steinegger M. ColabFold - Making protein folding accessible to all. bioRxiv, doi: 10.1101/2021.08.15.456425 (2021)
    I, Yoshitaka Moriwaki, am credited in the acknowlegment of the paper.
  • John Jumper, Richard Evans, Alexander Pritzel, et al. - Highly accurate protein structure prediction with AlphaFold. Nature, 1โ€“11, doi: 10.1038/s41586-021-03819-2 (2021)

DOI

localcolabfold's People

Contributors

yoshitakamo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.