Skip to content

Commit

Permalink
use python3.9 (Google Colab compatibility)
Browse files Browse the repository at this point in the history
  • Loading branch information
YoshitakaMo committed Mar 9, 2023
1 parent ec1ec7a commit 20a8206
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 39 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ See also Change log: https://github.com/sokrypton/ColabFold/wiki/v1.5.0

## New Updates

- 09Mar2023, version 1.5.2 released. The base directory has been changed to `localcolabfold` from `colabfold_batch` to distinguish it from the execution command.
- 05Feb2023, version 1.5.0-pre released.
- 16Jun2022, version 1.4.0 released. See [Release v1.4.0](https://github.com/YoshitakaMo/localcolabfold/releases/tag/v1.4.0)
- 07May2022, **Updated `update_linux.sh`.** See also [How to update](#how-to-update). Please use a new option `--use-gpu-relax` if GPU relaxation is required (recommended).
Expand Down
18 changes: 9 additions & 9 deletions beta_install_colabbatch_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type wget || { echo "wget command is not installed. Please install it at first u
type curl || { echo "curl command is not installed. Please install it at first using apt or yum. " ; exit 1 ; }

CURRENTPATH=`pwd`
COLABFOLDDIR="${CURRENTPATH}/colabfold_batch"
COLABFOLDDIR="${CURRENTPATH}/localcolabfold"

mkdir -p ${COLABFOLDDIR}
cd ${COLABFOLDDIR}
Expand All @@ -13,30 +13,30 @@ bash ./Miniconda3-latest-Linux-x86_64.sh -b -p ${COLABFOLDDIR}/conda
rm Miniconda3-latest-Linux-x86_64.sh
. "${COLABFOLDDIR}/conda/etc/profile.d/conda.sh"
export PATH="${COLABFOLDDIR}/conda/condabin:${PATH}"
conda create -p $COLABFOLDDIR/colabfold-conda python=3.8 -y
conda create -p $COLABFOLDDIR/colabfold-conda python=3.9 -y
conda activate $COLABFOLDDIR/colabfold-conda
conda update -n base conda -y
conda install -c conda-forge python=3.8 cudnn==8.2.1.32 cudatoolkit==11.1.1 openmm==7.5.1 pdbfixer -y
conda install -c conda-forge python=3.9 cudnn==8.2.1.32 cudatoolkit==11.1.1 openmm==7.5.1 pdbfixer -y
# Download the updater
wget -qnc https://raw.githubusercontent.com/YoshitakaMo/localcolabfold/main/update_linux.sh --no-check-certificate
chmod +x update_linux.sh
# install alignment tools
conda install -c conda-forge -c bioconda kalign2=2.04 hhsuite=3.3.0 mmseqs2=14.7e284 -y
# install ColabFold and Jaxlib
# colabfold-conda/bin/python3.8 -m pip install "colabfold[alphafold] @ git+https://github.com/sokrypton/ColabFold"
colabfold-conda/bin/python3.8 -m pip install -q --no-warn-conflicts "colabfold[alphafold-minus-jax] @ git+https://github.com/sokrypton/ColabFold@beta"
colabfold-conda/bin/python3.8 -m pip install https://storage.googleapis.com/jax-releases/cuda11/jaxlib-0.3.25+cuda11.cudnn82-cp38-cp38-manylinux2014_x86_64.whl
colabfold-conda/bin/python3.8 -m pip install jax==0.3.25 biopython==1.79
# colabfold-conda/bin/python3.9 -m pip install "colabfold[alphafold] @ git+https://github.com/sokrypton/ColabFold"
colabfold-conda/bin/python3.9 -m pip install -q --no-warn-conflicts "colabfold[alphafold-minus-jax] @ git+https://github.com/sokrypton/ColabFold@beta"
colabfold-conda/bin/python3.9 -m pip install https://storage.googleapis.com/jax-releases/cuda11/jaxlib-0.3.25+cuda11.cudnn82-cp39-cp39-manylinux2014_x86_64.whl
colabfold-conda/bin/python3.9 -m pip install jax==0.3.25 biopython==1.79

# Use 'Agg' for non-GUI backend
cd ${COLABFOLDDIR}/colabfold-conda/lib/python3.8/site-packages/colabfold
cd ${COLABFOLDDIR}/colabfold-conda/lib/python3.9/site-packages/colabfold
sed -i -e "s#from matplotlib import pyplot as plt#import matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt#g" plot.py
# modify the default params directory
sed -i -e "s#appdirs.user_cache_dir(__package__ or \"colabfold\")#\"${COLABFOLDDIR}/colabfold\"#g" download.py

# start downloading weights
cd ${COLABFOLDDIR}
colabfold-conda/bin/python3.8 -m colabfold.download
colabfold-conda/bin/python3.9 -m colabfold.download
cd ${CURRENTPATH}

echo "Download of alphafold2 weights finished."
Expand Down
2 changes: 1 addition & 1 deletion beta_update_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ python3.8 -m pip uninstall alphafold-colabfold -y
python3.8 -m pip install --no-warn-conflicts "colabfold[alphafold-minus-jax] @ git+https://github.com/sokrypton/ColabFold@beta"

# use 'agg' for non-GUI backend
pushd ${COLABFOLDDIR}/colabfold-conda/lib/python3.8/site-packages/colabfold
pushd ${COLABFOLDDIR}/colabfold-conda/lib/python3.9/site-packages/colabfold
sed -i -e "s#from matplotlib import pyplot as plt#import matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt#g" plot.py
sed -i -e "s#appdirs.user_cache_dir(__package__ or \"colabfold\")#\"${COLABFOLDDIR}/colabfold\"#g" download.py
popd
Expand Down
24 changes: 12 additions & 12 deletions install_colabbatch_M1mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,33 +28,33 @@ else
fi

CURRENTPATH=`pwd`
COLABFOLDDIR="${CURRENTPATH}/colabfold_batch"
COLABFOLDDIR="${CURRENTPATH}/localcolabfold"

mkdir -p ${COLABFOLDDIR}
cd ${COLABFOLDDIR}
. "/opt/homebrew/Caskroom/miniforge/base/etc/profile.d/conda.sh"
conda create -p $COLABFOLDDIR/colabfold-conda python=3.8 -y
conda create -p $COLABFOLDDIR/colabfold-conda python=3.9 -y
conda activate $COLABFOLDDIR/colabfold-conda
conda update -n base conda -y

conda install -y -c conda-forge python=3.8 openmm==7.5.1 pdbfixer jupyter matplotlib py3Dmol tqdm biopython==1.79 immutabledict==2.0.0
conda install -y -c conda-forge python=3.9 openmm==7.5.1 pdbfixer jupyter matplotlib py3Dmol tqdm biopython==1.79 immutabledict==2.0.0
conda install -y -c apple tensorflow-deps
# Download the updater
wget -qnc https://raw.githubusercontent.com/YoshitakaMo/localcolabfold/main/update_M1mac.sh --no-check-certificate
chmod +x update_M1mac.sh
# install ColabFold and Jaxlib
colabfold-conda/bin/python3.8 -m pip install https://files.pythonhosted.org/packages/bd/57/88cea9e14dacaea82ca86fac2bf6ecb8b7fd99622d776e4131786ce5b65e/tensorflow_macos-2.7.0-cp38-cp38-macosx_11_0_arm64.whl
colabfold-conda/bin/python3.8 -m pip install git+https://github.com/deepmind/tree.git
colabfold-conda/bin/python3.8 -m pip install git+https://github.com/google/ml_collections.git
colabfold-conda/bin/python3.8 -m pip install dm-haiku appdirs pandas absl-py docker
colabfold-conda/bin/python3.8 -m pip install alphafold-colabfold --no-deps --no-color
colabfold-conda/bin/python3.8 -m pip install "colabfold[alphafold] @ git+https://github.com/sokrypton/ColabFold" --no-deps --no-color
colabfold-conda/bin/python3.8 -m pip install jaxlib==0.3.25 --no-deps --no-color
colabfold-conda/bin/python3.8 -m pip install jax==0.3.25 chex scipy toolz --no-deps --no-color
colabfold-conda/bin/python3.9 -m pip install https://files.pythonhosted.org/packages/bd/57/88cea9e14dacaea82ca86fac2bf6ecb8b7fd99622d776e4131786ce5b65e/tensorflow_macos-2.7.0-cp38-cp38-macosx_11_0_arm64.whl
colabfold-conda/bin/python3.9 -m pip install git+https://github.com/deepmind/tree.git
colabfold-conda/bin/python3.9 -m pip install git+https://github.com/google/ml_collections.git
colabfold-conda/bin/python3.9 -m pip install dm-haiku appdirs pandas absl-py docker
colabfold-conda/bin/python3.9 -m pip install alphafold-colabfold --no-deps --no-color
colabfold-conda/bin/python3.9 -m pip install "colabfold[alphafold] @ git+https://github.com/sokrypton/ColabFold" --no-deps --no-color
colabfold-conda/bin/python3.9 -m pip install jaxlib==0.3.25 --no-deps --no-color
colabfold-conda/bin/python3.9 -m pip install jax==0.3.25 chex scipy toolz --no-deps --no-color

# start downloading weights
cd ${COLABFOLDDIR}
colabfold-conda/bin/python3.8 -m colabfold.download
colabfold-conda/bin/python3.9 -m colabfold.download
cd ${CURRENTPATH}

echo "Download of alphafold2 weights finished."
Expand Down
16 changes: 8 additions & 8 deletions install_colabbatch_intelmac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ else
fi

CURRENTPATH=`pwd`
COLABFOLDDIR="${CURRENTPATH}/colabfold_batch"
COLABFOLDDIR="${CURRENTPATH}/localcolabfold"

mkdir -p ${COLABFOLDDIR}
cd ${COLABFOLDDIR}
Expand All @@ -34,22 +34,22 @@ bash ./Miniconda3-latest-MacOSX-x86_64.sh -b -p ${COLABFOLDDIR}/conda
rm Miniconda3-latest-MacOSX-x86_64.sh
. "${COLABFOLDDIR}/conda/etc/profile.d/conda.sh"
export PATH="${COLABFOLDDIR}/conda/condabin:${PATH}"
conda create -p $COLABFOLDDIR/colabfold-conda python=3.8 -y
conda create -p $COLABFOLDDIR/colabfold-conda python=3.9 -y
conda activate $COLABFOLDDIR/colabfold-conda
conda update -n base conda -y
conda install -c conda-forge python=3.8 openmm==7.5.1 pdbfixer -y
conda install -c conda-forge python=3.9 openmm==7.5.1 pdbfixer -y
# Download the updater
wget -qnc https://raw.githubusercontent.com/YoshitakaMo/localcolabfold/main/update_intelmac.sh --no-check-certificate
chmod +x update_intelmac.sh
# install ColabFold and Jaxlib
colabfold-conda/bin/python3.8 -m pip install "colabfold[alphafold] @ git+https://github.com/sokrypton/ColabFold"
colabfold-conda/bin/python3.8 -m pip install jaxlib==0.3.25
colabfold-conda/bin/python3.8 -m pip install jax==0.3.25
colabfold-conda/bin/python3.8 -m pip install biopython==1.79
colabfold-conda/bin/python3.9 -m pip install "colabfold[alphafold] @ git+https://github.com/sokrypton/ColabFold"
colabfold-conda/bin/python3.9 -m pip install jaxlib==0.3.25
colabfold-conda/bin/python3.9 -m pip install jax==0.3.25
colabfold-conda/bin/python3.9 -m pip install biopython==1.79

# start downloading weights
cd ${COLABFOLDDIR}
colabfold-conda/bin/python3.8 -m colabfold.download
colabfold-conda/bin/python3.9 -m colabfold.download
cd ${CURRENTPATH}

echo "Download of alphafold2 weights finished."
Expand Down
19 changes: 10 additions & 9 deletions install_colabbatch_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type wget || { echo "wget command is not installed. Please install it at first u
type curl || { echo "curl command is not installed. Please install it at first using apt or yum. " ; exit 1 ; }

CURRENTPATH=`pwd`
COLABFOLDDIR="${CURRENTPATH}/colabfold_batch"
COLABFOLDDIR="${CURRENTPATH}/localcolabfold"

mkdir -p ${COLABFOLDDIR}
cd ${COLABFOLDDIR}
Expand All @@ -13,23 +13,24 @@ bash ./Miniconda3-latest-Linux-x86_64.sh -b -p ${COLABFOLDDIR}/conda
rm Miniconda3-latest-Linux-x86_64.sh
. "${COLABFOLDDIR}/conda/etc/profile.d/conda.sh"
export PATH="${COLABFOLDDIR}/conda/condabin:${PATH}"
conda create -p $COLABFOLDDIR/colabfold-conda python=3.8 -y
conda create -p $COLABFOLDDIR/colabfold-conda python=3.9 -y
conda activate $COLABFOLDDIR/colabfold-conda
conda update -n base conda -y
conda install -c conda-forge python=3.8 cudnn==8.2.1.32 cudatoolkit==11.1.1 openmm==7.5.1 pdbfixer -y
conda install -c conda-forge python=3.9 cudnn==8.2.1.32 cudatoolkit==11.1.1 openmm==7.5.1 pdbfixer -y
# Download the updater
wget -qnc https://raw.githubusercontent.com/YoshitakaMo/localcolabfold/main/update_linux.sh --no-check-certificate
chmod +x update_linux.sh
# install alignment tools
conda install -c conda-forge -c bioconda kalign2=2.04 hhsuite=3.3.0 mmseqs2=14.7e284 -y
# install ColabFold and Jaxlib
# colabfold-conda/bin/python3.8 -m pip install "colabfold[alphafold] @ git+https://github.com/sokrypton/ColabFold"
colabfold-conda/bin/python3.8 -m pip install -q --no-warn-conflicts "colabfold[alphafold-minus-jax] @ git+https://github.com/sokrypton/ColabFold"
colabfold-conda/bin/python3.8 -m pip install https://storage.googleapis.com/jax-releases/cuda11/jaxlib-0.3.25+cuda11.cudnn82-cp38-cp38-manylinux2014_x86_64.whl
colabfold-conda/bin/python3.8 -m pip install jax==0.3.25 biopython==1.79
# colabfold-conda/bin/python3.9 -m pip install "colabfold[alphafold] @ git+https://github.com/sokrypton/ColabFold"
colabfold-conda/bin/python3.9 -m pip install --upgrade pip
colabfold-conda/bin/python3.9 -m pip install --no-warn-conflicts "colabfold[alphafold-minus-jax] @ git+https://github.com/sokrypton/ColabFold"
colabfold-conda/bin/python3.9 -m pip install https://storage.googleapis.com/jax-releases/cuda11/jaxlib-0.3.25+cuda11.cudnn82-cp39-cp39-manylinux2014_x86_64.whl
colabfold-conda/bin/python3.9 -m pip install jax==0.3.25 biopython==1.79

# Use 'Agg' for non-GUI backend
cd ${COLABFOLDDIR}/colabfold-conda/lib/python3.8/site-packages/colabfold
cd ${COLABFOLDDIR}/colabfold-conda/lib/python3.9/site-packages/colabfold
sed -i -e "s#from matplotlib import pyplot as plt#import matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt#g" plot.py
# modify the default params directory
sed -i -e "s#appdirs.user_cache_dir(__package__ or \"colabfold\")#\"${COLABFOLDDIR}/colabfold\"#g" download.py
Expand All @@ -38,7 +39,7 @@ rm -rf __pycache__

# start downloading weights
cd ${COLABFOLDDIR}
colabfold-conda/bin/python3.8 -m colabfold.download
colabfold-conda/bin/python3.9 -m colabfold.download
cd ${CURRENTPATH}

echo "Download of alphafold2 weights finished."
Expand Down

0 comments on commit 20a8206

Please sign in to comment.