AlphaFold3

AlphaFold3 runs via Singularity/Apptainer container on GPU nodes with the af3 GRES constraint.

Loading the Module

module load alphafold3

This automatically loads Apptainer and sets the following environment variables:

Variable Description
$AF3_CONTAINER Path to the Singularity container
$AF3_MODELS Path to model parameters
$AF3_DB Path to the database
$AF3_SRC Path to AlphaFold3 source directory

Bind Mounts

Singularity requires bind mounts to expose host directories inside the container:

--bind /path/on/host:/path/inside/container

Your input folder can be bound to any path inside the container — /root/af_input is not required, it's just an example.

Running AlphaFold3

singularity exec --nv \
    --bind $AF3_SRC:/root/custom_folder \
    --bind /tmp:/root/af_output \
    --bind $AF3_MODELS:/root/models \
    --bind $AF3_DB:/root/public_databases \
    --bind /home/user/alphafold_inputs:/root/custom_folder \
    $AF3_CONTAINER \
    python /root/custom_folder/run_alphafold.py \
        --json_path=/root/custom_folder/fold_input.json \
        --model_dir=/root/models \
        --db_dir=/root/public_databases \
        --output_dir=/root/af_output

Replace /home/user/alphafold_inputs with the actual path to your input folder.

For input file format, see the AlphaFold3 Input File Guide.

Listing All Available Flags

singularity exec --nv \
    --bind $AF3_SRC:/root/custom_folder \
    --bind /tmp:/root/af_output \
    --bind $AF3_MODELS:/root/models \
    --bind $AF3_DB:/root/public_databases \
    $AF3_CONTAINER \
    python /root/custom_folder/run_alphafold.py --helpfull

Example Job Script

#!/bin/bash
#SBATCH --job-name=alphafold3
#SBATCH --partition=gpu-general
#SBATCH --gres=gpu:1,af3
#SBATCH --cpus-per-task=8
#SBATCH --mem=64G
#SBATCH --time=1-00:00:00
#SBATCH --output=alphafold3_%j.out
#SBATCH --error=alphafold3_%j.err

module load alphafold3

singularity exec --nv \
    --bind $AF3_SRC:/root/custom_folder \
    --bind /tmp:/root/af_output \
    --bind $AF3_MODELS:/root/models \
    --bind $AF3_DB:/root/public_databases \
    --bind /home/user/alphafold_inputs:/root/custom_folder \
    $AF3_CONTAINER \
    python /root/custom_folder/run_alphafold.py \
        --json_path=/root/custom_folder/fold_input.json \
        --model_dir=/root/models \
        --db_dir=/root/public_databases \
        --output_dir=/root/af_output

Unloading

module unload alphafold3

This also unloads the Apptainer module.

Troubleshooting


Created 2026-06-14 08:24:45 UTC by levk
Updated 2026-06-14 08:25:18 UTC by levk