Installing OpenFold Locally on O2

Set Up for Install

First, start an interactive session that uses GPU resources ( :

$ srun --pty -p gpu --gres=gpu:1 -t 0-05:00 --mem 24G -c 4 bash

Load modules needed for later steps:

$ module load gcc/9.2.0 miniconda3/4.10.3 cuda/11.7 git/2.35.3 cmake/3.22.2

Navigate to the directory you would like to install OpenFold in and clone the repository:

$ git clone $ cd openfold $ openfold_dir=$PWD

Install Main OpenFold Conda Package

While inside the OpenFold directory, create a Conda ( environment. In this example the name of the environment we will create is openfold_test. This can be changed here, but it will carry over to other options in some later steps.

$ sed -i '4i\ - nvidia' environment.yml $ sed -i 's/conda-forge::cudatoolkit==11.3/conda-forge::cudatoolkit==11.6/g' environment.yml $ conda env create --name=openfold_test -f environment.yml

Activate this new environment using the command

$ source activate openfold_test

The prompt inside the terminal should change to contain the Conda environment name in parenthesis, in this case (openfold_test). We will add additional python modules and set up CUDA kernels using the commands below

# - This next command is optional, at this time if there are any errors from installing # - flash-attention, skip the step. (openfold_test)$ python3 -m pip install git+ (openfold_test)$ python3 -m pip install nvidia-pyindex (openfold_test)$ conda install -c conda-forge openmm=7.5.1 (openfold_test)$ wget -qnc --no-check-certificate (openfold_test)$ (cd ${openfold_dir}/openfold-conda/lib/python3.7/site-packages; patch -s -p0 < openmm.patch) (openfold_test)$ python3 install

Download Parameters and Other Components

Here, we will open another terminal and ssh into This node is configured to efficiently download data to O2. For more information, please visit .

$ ssh <HMS_ID> $ cd /path/to/openfold/directory

Download dependent files. These files are put into the correct directory automatically as long as we are in the OpenFold directory cloned earlier.

#Download Folding Resources $ wget -q -P openfold/resources \ #Needed For Certian Tests $ mkdir -p tests/test_data/alphafold/common $ ln -rs openfold/resources/stereo_chemical_props.txt tests/test_data/alphafold/common #Download OpenFold Parameters $ bash scripts/ openfold/resources #Download Alphafold Parameters $ wget $ mkdir -p openfold/resources/params $ tar -xvf alphafold_params_2022-01-19.tar -C openfold/resources/params #Decompress test data $ gunzip tests/test_data/sample_feats.pickle.gz

Export Paths

Afterwards, we will export the path to this directory. If you would like to have this program featured every time you log in , add the export line to your .bashrc file.

(openfold_test)$ export PATH=$openfold_dir:$PATH

Note: When OpenFold is running it will require HH-Suite, which is now installed as a module on O2. Run module load hh-suite/3.3.0 to enable to enable the module during runs.