Installing ROCKET

How to get started

1. Install OpenFold

We forked OpenFold and cleaned up a few installation details for ROCKET users.

circle-info

Plan for a GPU machine, enough free disk space, and a clean environment before you start.

Note: The ⁠openfold installation requires approximately 6 GB of free space to download weights. Please ensure you start in a directory with sufficient available space.

Note: To ensure a smooth installation and execution of ROCKET, install on a GPU machine that matches the hardware you’ll use in production. In other words, for HPC users, if you plan to run your code on a node with a particular GPU model, request the same GPU model when you install OpenFold. This is important because the installation process performs hardware-specific compilation. We also recommend using GPUs with CUDA Compute Capability 8.0 or higher.

  1. Clone our fork of the OpenFold repo, switch to the pl_upgrades branch to work with CUDA 12:

    git clone https://github.com/minhuanli/rocket_openfold.git
    cd rocket_openfold
    git checkout pl_upgrades
  2. Create a conda or mamba environment with environment.yml. Mamba is recommended because the dependency set is large. If you use Conda instead, replace mamba with conda in the commands below.

    Note: If you work with an HPC cluster with package management like module, purge all your modules before this step to avoid conflicts.

    mamba env create -n <env_name_you_like> -f environment.yml
    mamba activate <env_name_you_like>

    We keep flash-attn outside the YAML so you can install a compatible version manually. This OpenFold branch uses PyTorch 2.1. The latest flash-attn will not work. The --no-build-isolation flag also lets ninja speed up compilation.

  3. Install a compatible flash-attn build:

    pip install flash-attn==2.2.2 --no-build-isolation
  4. Run the setup script:

    ./scripts/install_third_party_dependencies.sh

    Add the following lines to <path_to_your_conda_env>/etc/conda/activate.d/env_vars.sh. Create the file if it does not exist.

    #!/bin/sh
    
    export LIBRARY_PATH=$CONDA_PREFIX/lib:$LIBRARY_PATH
    export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH

    This makes the library path update happen automatically whenever the environment is activated.

  5. Download AlphaFold2 weights and set the resource path:

    ./scripts/download_alphafold_params.sh ./openfold/resources

    Note: You can also download OpenFold weights if you want to test them.

    Append the following line to the same env_vars.sh file:

    export OPENFOLD_RESOURCES="<ABSOLUTE_PATH_TO_OPENFOLD_FOLDER>/openfold/resources"

    <ABSOLUTE_PATH_TO_OPENFOLD_FOLDER> should be the output of pwd -P you get from the OpenFold repo path.

    Deactivate and reactivate your environment. Then confirm the path:

    echo $OPENFOLD_RESOURCES 
  6. Check your OpenFold build with unit tests:

    ./scripts/run_unit_tests.sh

    Ensure you see no errors:

    ...
    Time to load evoformer_attn op: 243.8257336616516 seconds
    ............s...s.sss.ss.....sssssssss.sss....ssssss..s.s.s.ss.s......s.s..ss...ss.s.s....s........
    ----------------------------------------------------------------------
    Ran 117 tests in 275.889s
    
    OK (skipped=41)

2. Install Phenix

Required for automatic preprocessing and post-refinement.

circle-exclamation

Phenixarrow-up-right is required for automatic data preprocessing and for post-refinement when polishing final model geometry. Follow the steps below to install it and add the path to the system environment variables:

  1. Download the latest Python 3 nightly build from https://phenix-online.org/downloadarrow-up-right. Use at least version 2.0-5936.

  2. Run the installer

    You will be prompted to type your preferred path of installation, after specifying it, you will see:

    Note: <phenix_directory> must be an absolute path. The installer will create <phenix_directory>/phenix-2.0-5936 and install there.

  3. Append the following line to the same env_vars.sh file:

    <phenix_directory> is the path you chose in the previous step.

    Deactivate and reactivate your environment. Then confirm the path:

3. Install ROCKET

Move to a separate parent directory, clone ROCKET, then install it with pip:

This also installs dependencies such as SFcalculator and reciprocalspaceship.

Note: If you get errors about incompatibility of prompt_toolkit, ignore them.

For editable install mode, run:

Run rk.score --help after installation. If it prints normal help text without errors, the install is ready.

circle-check

Create an issuearrow-up-right in our repo

Last updated