Using Alphafold3

Creation date: 11/19/2024 12:22 PM    Updated: 11/19/2024 12:22 PM
This document provides comprehensive instructions for utilizing AlphaFold3 within the Hoffman2 High Performance Computing (HPC) environment, leveraging the AlphaFold container, a specialized software package containing AlphaFold3. This container can be executed on Hoffman2 through the Apptainer container runtime application.

Downloading Data

Start a job on a compute node

You will need to first start a job to use AlphaFold3 and Apptainer

qrsh -l h_data=10G,h_rt=12:00:00

This example using 10GB of memory and 12 hour time limit. Note, you can use a non-GPU node if you are just downloading data. You can also use a qsub job script instead to submit this as a non-interactive job

Setting Up the Data Directory

Before initiating AlphaFold, it's essential to download the required datasets. Start by setting the directory for data download:

export DOWNLOAD_DIR=$SCRATCH/alphafoldtest/data


Execute the data download script

Utilize the download scripts provided by AlphaFold3 for setting up databases. These scripts are located at /app/alphafoldwithin the container. Refer to the Alphafold3 github for a detailed list of these scripts.

Run the following command to download all necessary data:

module load apptainer

apptainer exec $H2_CONTAINER_LOC/h2-alphafold3.sif bash /app/alphafold/fetch_databases.sh $DOWNLOAD_DIR

Note: Ensure there is adequate storage space in the specified directory for the downloaded data.

Running AlphaFold

Start a job on a compute node

You will need to first start a job to use AlphaFold and Apptainer

qrsh -l h_data=10G,h_rt=12:00:00,gpu,A100

This example using 10GB of memory and 12 hour time limit, using a A100 GPU compute node. You can also use a qsub job script instead to submit this as a non-interactive job

Setting Environment Variables:

Establish the required environment variables for the data and output directories, as well as the path to your FASTA file:

export DOWNLOAD_DIR=$SCRATCH/alphafoldtest/data
export OUTPUT_DIR=$SCRATCH/alphafoldtest/output
export JSON_PATHS=alphafold_input.json

Obtaining Model Parameters

Contact AlphaFold for get access to model parameters
Once you get access can transfer the model parameters to Hoffman2, you can setup the varaible

export MODEL_PATH=/Path/To/Models


Executing AlphaFold:

AlphaFold can be run using the run_alphafold.py script, located at /app/alphafold/run_alphafold.py within the container. Execute AlphaFold with the following command

module load apptainer

apptainer exec --nv $H2_CONTAINER_LOC/h2-alphafold3.sif python /app/alphafold/run_alphafold.py \
  --json_path=$JSON_PATHS \
  --model_dir=$MODEL_PATH \
  --output_dir=$OUTPUT_DIR