Skip to content

Commit 652f293

Browse files
committed
Update v1.2.0-alpha
1 parent b374358 commit 652f293

14 files changed

+411
-53
lines changed

README.md

Lines changed: 26 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
[ColabFold / AlphaFold2_advanced](https://colab.research.google.com/github/sokrypton/ColabFold/blob/main/beta/AlphaFold2_advanced.ipynb) on your local PC (or macOS)
44

5+
## New Updates
6+
7+
- 04Dec2021, LocalColabFold is now compatible with the latest [pip installable ColabFold](https://github.com/sokrypton/ColabFold#running-locally). 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.
8+
59
## Installation
610

711
### For Linux
@@ -14,10 +18,9 @@ Built on Mon_Oct_12_20:09:46_PDT_2020
1418
Cuda compilation tools, release 11.1, V11.1.105
1519
Build cuda_11.1.TC455_06.29190527_0
1620
</pre>DO NOT use `nvidia-smi` for checking the version.<br>See [NVIDIA CUDA Installation Guide for Linux](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html) if you haven't installed it.
17-
1. Download `install_colabfold_linux.sh` from this repository:<pre>$ wget https://raw.githubusercontent.com/YoshitakaMo/localcolabfold/main/install_colabfold_linux.sh</pre> and run it in the directory where you want to install:<pre>$ bash install_colabfold_linux.sh</pre>About 5 minutes later, `colabfold` directory will be created. Do not move this directory after the installation.
18-
1. Type `cd colabfold` to enter the directory.
19-
1. 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](https://colab.research.google.com/github/sokrypton/ColabFold/blob/main/beta/AlphaFold2_advanced.ipynb).
20-
1. To run the prediction, type <pre>$ colabfold-conda/bin/python3.7 runner.py</pre>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.
21+
1. Download `install_colabbatch_linux.sh` from this repository:<pre>$ wget https://raw.githubusercontent.com/YoshitakaMo/localcolabfold/main/install_colabbatch_linux.sh</pre> and run it in the directory where you want to install:<pre>$ bash install_colabbatch_linux.sh</pre>About 5 minutes later, `colabfold_batch` directory will be created. Do not move this directory after the installation.
22+
1. Add environment variable PATH:<pre># bash<br>export PATH="<COLABFOLDBATCH_DIR>/bin:\$PATH"<br>#i.e. export PATH="/home/moriwaki/Desktop/colabfold_batch/bin:\$PATH"</pre>
23+
2. To run the prediction, type <pre>colabfold_batch --amber --templates --num-recycle 3 inputfile outputdir/ </pre>The result files will be created in the `outputdir`. For more details, see `colabfold_batch --help`.
2124

2225
### For macOS
2326

@@ -36,54 +39,16 @@ Please use the correct installer for your Mac.
3639
#### For Mac with Intel CPU
3740

3841
1. Install [Homebrew](https://brew.sh/index_ja) if not present:<pre>$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"</pre>
39-
1. Install `wget` command using Homebrew:<pre>$ brew install wget</pre>
40-
1. Download `install_colabfold_intelmac.sh` from this repository:<pre>$ wget https://raw.githubusercontent.com/YoshitakaMo/localcolabfold/main/install_colabfold_intelmac.sh</pre> and run it in the directory where you want to install:<pre>$ bash install_colabfold_intelmac.sh</pre>About 5 minutes later, `colabfold` directory will be created. Do not move this directory after the installation.
42+
1. Install `wget` command using Homebrew:<pre>$ brew install wget gnu-sed<br>\$ brew install brewsci/bio/hh-suite brewsci/bio/kalign</pre>
43+
1. Download `install_colabbatch_intelmac.sh` from this repository:<pre>$ wget https://raw.githubusercontent.com/YoshitakaMo/localcolabfold/main/install_colabbatch_intelmac.sh</pre> and run it in the directory where you want to install:<pre>$ bash install_colabbatch_intelmac.sh</pre>About 5 minutes later, `colabfold_batch` directory will be created. Do not move this directory after the installation.
4144
1. The rest procedure is the same as "For Linux".
4245

4346
#### For Mac with Apple Silicon (M1 chip)
4447

45-
**Note: This installer is experimental because most of the dependent packages are not fully tested on Apple Silicon Mac.**
46-
47-
1. Install [Homebrew](https://brew.sh/index_ja) if not present:<pre>$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"</pre>
48-
1. Install `wget` and `cmake` commands using Homebrew:<pre>$ brew install wget cmake</pre>
49-
1. Install `miniforge` command using Homebrew:<pre>$ brew install --cask miniforge</pre>
50-
1. Download `install_colabfold_M1mac.sh` from this repository:<pre>$ wget https://raw.githubusercontent.com/YoshitakaMo/localcolabfold/main/install_colabfold_M1mac.sh</pre> and run it in the directory where you want to install:<pre>$ bash install_colabfold_M1mac.sh</pre>About 5 minutes later, `colabfold` directory will be created. Do not move this directory after the installation.
51-
1. Type `cd colabfold` to enter the directory.
52-
1. 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](https://colab.research.google.com/github/sokrypton/ColabFold/blob/main/beta/AlphaFold2_advanced.ipynb).
53-
1. To run the prediction, type <pre>$ colabfold-conda/bin/python3.8 runner.py</pre>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.
54-
55-
A Warning message appeared when you run the prediction:
56-
```
57-
You are using an experimental build of OpenMM v7.5.1.
58-
This is NOT SUITABLE for production!
59-
It has not been properly tested on this platform and we cannot guarantee it provides accurate results.
60-
```
61-
62-
This message is due to Apple Silicon, but I think we can ignore it.
63-
64-
## Usage of `colabfold` shell script (Linux)
65-
66-
An executable `colabfold` shell script is installed in `/path/to/colabfold/bin` directory. This is more helpful for installation on a shared computer and users who want to predict many sequences.
67-
68-
1. Prepare a FASTA file containing the amino acid sequence for which you want to predict the structure (e.g. `6x9z.fasta`).<pre>>6X9Z_1|Chain A|Transmembrane beta-barrels|synthetic construct (32630)
69-
MEQKPGTLMVYVVVGYNTDNTVDVVGGAQYAVSPYLFLDVGYGWNNSSLNFLEVGGGVSYKVSPDLEPYVKAGFEYNTDNTIKPTAGAGALYRVSPNLALMVEYGWNNSSLQKVAIGIAYKVKD</pre>
70-
2. Type `export PATH="/path/to/colabfold/bin:$PATH"` to add a path to the PATH environment variable. For example, `export PATH="/home/foo/bar/colabfold/bin:$PATH"` if you installed localcolabfold on `/home/foo/bar/colabfold`.
71-
3. Run colabfold command with your FASTA file. For example,<pre>$ colabfold --input 6x9z.fasta \\
72-
--output_dir 6x9z \\
73-
--max_recycle 18 \\
74-
--use_ptm \\
75-
--use_turbo \\
76-
--num_relax Top5</pre>This will predict a protein structure [6x9z](https://www.rcsb.org/structure/6x9z) with increasing the number of 'recycling' to 18. This may be effective for *de novo* structure prediction. For another example, [PDB: 3KUD](https://www.rcsb.org/structure/3KUD), <pre>$ colabfold --input 3kud_complex.fasta \\
77-
--output_dir 3kud \\
78-
--homooligomer 1:1 \\
79-
--use_ptm \\
80-
--use_turbo \\
81-
--max_recycle 3 \\
82-
--num_relax Top5</pre>where the input sequence `3kud_complex.fasta` is<pre>>3KUD_complex
83-
MTEYKLVVVGAGGVGKSALTIQLIQNHFVDEYDPTIEDSYRKQVVIDGETCLLDILDTAGQEEYSAMRDQYMRTGEGFLCVFAINNTKSFEDIHQYREQIKRVKDSDDVPMVLVGNKCDLAARTVESRQAQDLARSYGIPYIETSAKTRQGVEDAFYTLVREIRQH:
84-
PSKTSNTIRVFLPNKQRTVVNVRNGMSLHDCLMKALKVRGLQPECCAVFRLLHEHKGKKARLDWNTDAASLIGEELQVDFL</pre>This will predict a heterooligomer. For more information about the options, type `colabfold --help` or refer to the original [ColabFold / AlphaFold2_advanced](https://colab.research.google.com/github/sokrypton/ColabFold/blob/main/beta/AlphaFold2_advanced.ipynb).
48+
Currently not supported.
8549

8650
## Advantages of LocalColabFold
51+
8752
- **Structure inference and relaxation will be accelerated if your PC has Nvidia GPU and CUDA drivers.**
8853
- **No Time out (90 minutes and 12 hours)**
8954
- **No GPU limitations**
@@ -100,16 +65,15 @@ MEQKPGTLMVYVVVGYNTDNTVDVVGGAQYAVSPYLFLDVGYGWNNSSLNFLEVGGGVSYKVSPDLEPYVKAGFEYNTDN
10065
- Yes, the sequence input is the same as ColabFold. See [ColabFold / AlphaFold2_advanced](https://colab.research.google.com/github/sokrypton/ColabFold/blob/main/beta/AlphaFold2_advanced.ipynb).
10166
- Is it possible to create MSA by jackhmmer?
10267
- **No, it is not currently supported**.
103-
- I want to run the predictions step-by-step like Google Colab.
104-
- You can use VSCode and Python plugin to do the same. See https://code.visualstudio.com/docs/python/jupyter-support-py.
10568
- I want to use multiple GPUs to perform the prediction.
106-
- You need to set the environment variables `TF_FORCE_UNIFIED_MEMORY`,`XLA_PYTHON_CLIENT_MEM_FRACTION` before execution. See [this discussion](https://github.com/YoshitakaMo/localcolabfold/issues/7#issuecomment-923027641).
107-
- I want to solve the `ResourceExhausted` error when trying to predict for a sequence with > 1000 residues.
108-
- See the same discussion as above.
69+
- **AlphaFold and ColabFold does not support multiple GPUs**. Only One GPU can model your protein.
10970
- I got an error message `CUDA_ERROR_ILLEGAL_ADDRESS: an illegal memory access was encountered`.
11071
- 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`.
11172
- Is this available on Windows 10?
11273
- You can run LocalColabFold on your Windows 10 with [WSL2](https://docs.microsoft.com/en-us/windows/wsl/install-win10).
74+
- I want to use a custom MSA file in the format of a3m.
75+
- **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.
76+
11377

11478
## Tutorials & Presentations
11579

@@ -121,7 +85,16 @@ MEQKPGTLMVYVVVGYNTDNTVDVVGGAQYAVSPYLFLDVGYGWNNSSLNFLEVGGGVSYKVSPDLEPYVKAGFEYNTDN
12185

12286
## How do I reference this work?
12387

124-
- Mirdita M, Schuetze K, Moriwaki Y, Heo L, Ovchinnikov S and Steinegger M. ColabFold - Making protein folding accessible to all. *bioRxiv*, doi: [10.1101/2021.08.15.456425](https://www.biorxiv.org/content/10.1101/2021.08.15.456425v2) (2021)
125-
- 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](https://www.nature.com/articles/s41586-021-03819-2) (2021)
88+
- Mirdita M, Schütze K, Moriwaki Y, Heo L, Ovchinnikov S and Steinegger M. ColabFold - Making protein folding accessible to all. <br />
89+
bioRxiv (2021) doi: [10.1101/2021.08.15.456425](https://www.biorxiv.org/content/10.1101/2021.08.15.456425v2)
90+
- If you’re using **AlphaFold**, please also cite: <br />
91+
Jumper et al. "Highly accurate protein structure prediction with AlphaFold." <br />
92+
Nature (2021) doi: [10.1038/s41586-021-03819-2](https://doi.org/10.1038/s41586-021-03819-2)
93+
- If you’re using **AlphaFold-multimer**, please also cite: <br />
94+
Evans et al. "Protein complex prediction with AlphaFold-Multimer." <br />
95+
biorxiv (2021) doi: [10.1101/2021.10.04.463034v1](https://www.biorxiv.org/content/10.1101/2021.10.04.463034v1)
96+
- If you are using **RoseTTAFold**, please also cite: <br />
97+
Minkyung et al. "Accurate prediction of protein structures and interactions using a three-track neural network." <br />
98+
Science (2021) doi: [10.1126/science.abj8754](https://doi.org/10.1126/science.abj8754)
12699

127100
[![DOI](https://zenodo.org/badge/doi/10.5281/zenodo.5123296.svg)](https://doi.org/10.5281/zenodo.5123296)

install_colabbatch_intelmac.sh

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#!/bin/bash
2+
3+
# check commands
4+
type wget || { echo "wget command is not installed. Please install it at first using Homebrew." ; exit 1 ; }
5+
type gsed || { echo "gnu-sed command is not installed. Please install it at first using Homebrew." ; exit 1 ; }
6+
type hhsearch || { echo "hhsearch command is not installed. Please install it at first using Homebrew." ; exit 1 ; }
7+
type kalign || { echo "kalign command is not installed. Please install it at first using Homebrew." ; exit 1 ; }
8+
9+
# check whether Apple Silicon (M1 mac) or Intel Mac
10+
arch_name="$(uname -m)"
11+
12+
if [ "${arch_name}" = "x86_64" ]; then
13+
if [ "$(sysctl -in sysctl.proc_translated)" = "1" ]; then
14+
echo "Running on Rosetta 2"
15+
else
16+
echo "Running on native Intel"
17+
fi
18+
elif [ "${arch_name}" = "arm64" ]; then
19+
echo "Running on Apple Silicon (M1 mac)"
20+
echo "This installer is only for intel Mac. Use install_colabfold_M1mac.sh to install on this Mac."
21+
exit 1
22+
else
23+
echo "Unknown architecture: ${arch_name}"
24+
exit 1
25+
fi
26+
27+
CURRENTPATH=`pwd`
28+
COLABFOLDDIR="${CURRENTPATH}/colabfold_batch"
29+
30+
mkdir -p ${COLABFOLDDIR}
31+
cd ${COLABFOLDDIR}
32+
wget https://git.scicore.unibas.ch/schwede/openstructure/-/raw/7102c63615b64735c4941278d92b554ec94415f8/modules/mol/alg/src/stereo_chemical_props.txt --no-check-certificate
33+
wget -q -P . https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
34+
bash ./Miniconda3-latest-MacOSX-x86_64.sh -b -p ${COLABFOLDDIR}/conda
35+
rm Miniconda3-latest-MacOSX-x86_64.sh
36+
. "${COLABFOLDDIR}/conda/etc/profile.d/conda.sh"
37+
export PATH="${COLABFOLDDIR}/conda/condabin:${PATH}"
38+
conda create -p $COLABFOLDDIR/colabfold-conda python=3.7 -y
39+
conda activate $COLABFOLDDIR/colabfold-conda
40+
conda update -n base conda -y
41+
conda install -c conda-forge python=3.7 openmm==7.5.1 pdbfixer -y
42+
# patch to openmm
43+
wget -qnc https://raw.githubusercontent.com/deepmind/alphafold/main/docker/openmm.patch --no-check-certificate
44+
(cd ${COLABFOLDDIR}/colabfold-conda/lib/python3.7/site-packages; patch -s -p0 < ${COLABFOLDDIR}/openmm.patch)
45+
rm openmm.patch
46+
# install ColabFold and Jaxlib
47+
colabfold-conda/bin/python3.7 -m pip install "colabfold[alphafold] @ git+https://github.com/sokrypton/ColabFold"
48+
colabfold-conda/bin/python3.7 -m pip install https://storage.googleapis.com/jax-releases/mac/jaxlib-0.1.74-cp37-none-macosx_10_9_x86_64.whl
49+
50+
# bin directory to run
51+
mkdir -p $COLABFOLDDIR/bin
52+
cd $COLABFOLDDIR/bin
53+
cat << EOF > colabfold_batch
54+
#!/bin/sh
55+
$COLABFOLDDIR/colabfold-conda/bin/colabfold_batch --cpu \$@
56+
EOF
57+
chmod +x colabfold_batch
58+
59+
# hack to share the parameter files in a workstation.
60+
gsed -i -e "s#props_path = \"stereo_chemical_props.txt\"#props_path = \"${COLABFOLDDIR}/stereo_chemical_props.txt\"#" ${COLABFOLDDIR}/colabfold-conda/lib/python3.7/site-packages/colabfold/batch.py
61+
gsed -i -e "s#kalign_binary_path=\"kalign\"#kalign_binary_path=\"/usr/local/bin/kalign\"#g" ${COLABFOLDDIR}/colabfold-conda/lib/python3.7/site-packages/colabfold/batch.py
62+
gsed -i -e "s#binary_path=\"hhsearch\"#binary_path=\"/usr/local/bin/hhsearch\"#g" ${COLABFOLDDIR}/colabfold-conda/lib/python3.7/site-packages/colabfold/batch.py
63+
gsed -i -e "s#Path(appdirs.user_cache_dir(__package__ or \"colabfold\"))#${COLABFOLDDIR}#g" ${COLABFOLDDIR}/colabfold-conda/lib/python3.7/site-packages/colabfold/download.py
64+
65+
echo "Installation of colabFold_batch finished."
66+
echo "Note: AlphaFold2 weight parameters will be donwloaded at ${COLABFOLDDIR}/params directory in the first run."
67+
echo "Please set your PATH to ${COLABFOLDDIR}/bin to run 'colabfold_batch'."
68+
echo "i.e. For Bash, export PATH=\"${COLABFOLDDIR}/bin:\$PATH\""
69+
echo "For more details, please type 'colabfold_batch --help'."

install_colabbatch_linux.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/bin/bash
2+
3+
type wget || { echo "wget command is not installed. Please install it at first using apt or yum." ; exit 1 ; }
4+
type curl || { echo "curl command is not installed. Please install it at first using apt or yum. " ; exit 1 ; }
5+
6+
CURRENTPATH=`pwd`
7+
COLABFOLDDIR="${CURRENTPATH}/colabfold_batch"
8+
9+
mkdir -p ${COLABFOLDDIR}
10+
cd ${COLABFOLDDIR}
11+
wget https://git.scicore.unibas.ch/schwede/openstructure/-/raw/7102c63615b64735c4941278d92b554ec94415f8/modules/mol/alg/src/stereo_chemical_props.txt --no-check-certificate
12+
wget -q -P . https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
13+
bash ./Miniconda3-latest-Linux-x86_64.sh -b -p ${COLABFOLDDIR}/conda
14+
rm Miniconda3-latest-Linux-x86_64.sh
15+
. "${COLABFOLDDIR}/conda/etc/profile.d/conda.sh"
16+
export PATH="${COLABFOLDDIR}/conda/condabin:${PATH}"
17+
conda create -p $COLABFOLDDIR/colabfold-conda python=3.7 -y
18+
conda activate $COLABFOLDDIR/colabfold-conda
19+
conda update -n base conda -y
20+
conda install -c conda-forge python=3.7 cudnn==8.2.1.32 cudatoolkit==11.1.1 openmm==7.5.1 pdbfixer -y
21+
# patch to openmm
22+
wget -qnc https://raw.githubusercontent.com/deepmind/alphafold/main/docker/openmm.patch --no-check-certificate
23+
(cd ${COLABFOLDDIR}/colabfold-conda/lib/python3.7/site-packages; patch -s -p0 < ${COLABFOLDDIR}/openmm.patch)
24+
rm openmm.patch
25+
# install alignment tools
26+
conda install -c conda-forge -c bioconda kalign3=3.2.2 hhsuite=3.3.0 -y
27+
# install ColabFold and Jaxlib
28+
colabfold-conda/bin/python3.7 -m pip install "colabfold[alphafold] @ git+https://github.com/sokrypton/ColabFold"
29+
colabfold-conda/bin/python3.7 -m pip install https://storage.googleapis.com/jax-releases/cuda111/jaxlib-0.1.72+cuda111-cp37-none-manylinux2010_x86_64.whl
30+
31+
# bin directory to run
32+
mkdir -p $COLABFOLDDIR/bin
33+
cd $COLABFOLDDIR/bin
34+
cat << EOF > colabfold_batch
35+
#!/bin/sh
36+
export TF_FORCE_UNIFIED_MEMORY="1"
37+
export XLA_PYTHON_CLIENT_MEM_FRACTION="4.0"
38+
$COLABFOLDDIR/colabfold-conda/bin/colabfold_batch \$@
39+
EOF
40+
chmod +x colabfold_batch
41+
42+
# hack to share the parameter files in a workstation.
43+
cd ${COLABFOLDDIR}/colabfold-conda/lib/python3.7/site-packages/colabfold
44+
sed -i -e "s#props_path = \"stereo_chemical_props.txt\"#props_path = \"${COLABFOLDDIR}/stereo_chemical_props.txt\"#" batch.py
45+
sed -i -e "s#kalign_binary_path=\"kalign\"#kalign_binary_path=\"${COLABFOLDDIR}/colabfold-conda/bin/kalign\"#g" ${COLABFOLDDIR}/colabfold-conda/lib/python3.7/site-packages/colabfold/batch.py
46+
sed -i -e "s#binary_path=\"hhsearch\"#binary_path=\"${COLABFOLDDIR}/colabfold-conda/bin/hhsearch\"#g" ${COLABFOLDDIR}/colabfold-conda/lib/python3.7/site-packages/colabfold/batch.py
47+
sed -i -e "s#Path(appdirs.user_cache_dir(__package__ or \"colabfold\"))#\"${COLABFOLDDIR}\"#g" download.py
48+
cd ${COLABFOLDDIR}/colabfold-conda/lib/python3.7/site-packages/alphafold/relax
49+
sed -i -e 's/CPU/CUDA/g' amber_minimize.py
50+
51+
echo "Installation of colabFold_batch finished."
52+
echo "Note: AlphaFold2 weight parameters will be donwloaded at ${COLABFOLDDIR}/params directory in the first run."
53+
echo "Please set your PATH to ${COLABFOLDDIR}/bin to run 'colabfold_batch'."
54+
echo "i.e. For Bash, export PATH=\"${COLABFOLDDIR}/bin:\$PATH\""
55+
echo "For more details, please type 'colabfold_batch --help'."

0 commit comments

Comments
 (0)