install_third_party_dependencies.sh 1.59 KB
Newer Older
Gustaf Ahdritz's avatar
Gustaf Ahdritz committed
1
#!/bin/bash
2
CONDA_INSTALL_URL=${CONDA_INSTALL_URL:-"https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh"}
Gustaf Ahdritz's avatar
Gustaf Ahdritz committed
3

Gustaf Ahdritz's avatar
Gustaf Ahdritz committed
4
5
source scripts/vars.sh

Gustaf Ahdritz's avatar
Gustaf Ahdritz committed
6
7
# Install Miniconda locally
rm -rf lib/conda
8
rm -f /tmp/Miniconda3-latest-Linux-x86_64.sh
Karl Leswing's avatar
Karl Leswing committed
9
10
wget -P /tmp \
    "${CONDA_INSTALL_URL}" \
Gustaf Ahdritz's avatar
Gustaf Ahdritz committed
11
12
13
14
    && bash /tmp/Miniconda3-latest-Linux-x86_64.sh -b -p lib/conda \
    && rm /tmp/Miniconda3-latest-Linux-x86_64.sh

# Grab conda-only packages
Karl Leswing's avatar
Karl Leswing committed
15
export PATH=lib/conda/bin:$PATH
16
lib/conda/bin/python3 -m pip install nvidia-pyindex
Karl Leswing's avatar
Karl Leswing committed
17
conda env create --name=${ENV_NAME} -f environment.yml
18
source scripts/activate_conda_env.sh
Marta's avatar
Marta committed
19

20
21
22
echo "Attempting to install FlashAttention"
pip install git+https://github.com/HazyResearch/flash-attention.git@5b838a8bef78186196244a4156ec35bbb58c337d && echo "Installation successful"

Gustaf Ahdritz's avatar
Gustaf Ahdritz committed
23
24
# Install DeepMind's OpenMM patch
OPENFOLD_DIR=$PWD
25
pushd lib/conda/envs/$ENV_NAME/lib/python3.7/site-packages/ \
Gustaf Ahdritz's avatar
Gustaf Ahdritz committed
26
27
28
29
    && patch -p0 < $OPENFOLD_DIR/lib/openmm.patch \
    && popd

# Download folding resources
Gustaf Ahdritz's avatar
Gustaf Ahdritz committed
30
wget -q -P openfold/resources \
Gustaf Ahdritz's avatar
Gustaf Ahdritz committed
31
32
    https://git.scicore.unibas.ch/schwede/openstructure/-/raw/7102c63615b64735c4941278d92b554ec94415f8/modules/mol/alg/src/stereo_chemical_props.txt

33
34
# Certain tests need access to this file
mkdir -p tests/test_data/alphafold/common
35
ln -rs openfold/resources/stereo_chemical_props.txt tests/test_data/alphafold/common
36

Gustaf Ahdritz's avatar
Gustaf Ahdritz committed
37
echo "Downloading OpenFold parameters..."
Gustaf Ahdritz's avatar
Gustaf Ahdritz committed
38
bash scripts/download_openfold_params.sh openfold/resources
Gustaf Ahdritz's avatar
Gustaf Ahdritz committed
39
40
41

echo "Downloading AlphaFold parameters..."
bash scripts/download_alphafold_params.sh openfold/resources
Gustaf Ahdritz's avatar
Gustaf Ahdritz committed
42
43
44

# Decompress test data
gunzip tests/test_data/sample_feats.pickle.gz