install_third_party_dependencies.sh 1.62 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
echo "Attempting to install FlashAttention"
Gustaf Ahdritz's avatar
Gustaf Ahdritz committed
21
22
23
24
25
26
git clone https://github.com/HazyResearch/flash-attention
CUR_DIR=$PWD
cd flash-attention
git checkout 5b838a8bef
python3 setup.py install
cd $CUR_DIR
27

Gustaf Ahdritz's avatar
Gustaf Ahdritz committed
28
29
# Install DeepMind's OpenMM patch
OPENFOLD_DIR=$PWD
30
pushd lib/conda/envs/$ENV_NAME/lib/python3.7/site-packages/ \
Gustaf Ahdritz's avatar
Gustaf Ahdritz committed
31
32
33
34
    && patch -p0 < $OPENFOLD_DIR/lib/openmm.patch \
    && popd

# Download folding resources
35
wget --no-check-certificate -P openfold/resources \
Gustaf Ahdritz's avatar
Gustaf Ahdritz committed
36
37
    https://git.scicore.unibas.ch/schwede/openstructure/-/raw/7102c63615b64735c4941278d92b554ec94415f8/modules/mol/alg/src/stereo_chemical_props.txt

38
39
# Certain tests need access to this file
mkdir -p tests/test_data/alphafold/common
40
ln -rs openfold/resources/stereo_chemical_props.txt tests/test_data/alphafold/common
41

Gustaf Ahdritz's avatar
Gustaf Ahdritz committed
42
echo "Downloading OpenFold parameters..."
Gustaf Ahdritz's avatar
Gustaf Ahdritz committed
43
bash scripts/download_openfold_params.sh openfold/resources
Gustaf Ahdritz's avatar
Gustaf Ahdritz committed
44
45
46

echo "Downloading AlphaFold parameters..."
bash scripts/download_alphafold_params.sh openfold/resources
Gustaf Ahdritz's avatar
Gustaf Ahdritz committed
47
48
49

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