Open source code for AlphaFold

**Software Category:** URL:

For detailed information, visit the AlphaFold website.

Available Versions

The current installation of AlphaFold incorporates the most popular packages. To find the available versions and learn how to load them, run:

module spider alphafold

The output of the command shows the available AlphaFold module versions.

For detailed information about a particular AlphaFold module, including how to load the module, run the module spider command with the module’s full version label. For example:

module spider alphafold/2.1.2
ModuleVersion Module Load Command
alphafold2.1.2 module load singularity/3.7.1 alphafold/2.1.2
alphafold2.2.0 module load singularity/3.7.1 alphafold/2.2.0
alphafold2.2.2 module load singularity/3.7.1 alphafold/2.2.2
alphafold2.3.0 module load singularity/3.7.1 alphafold/2.3.0

AlphaFold Installation Details


We prepared a Docker image based on the official Dockerfile with some modifications.

  • AlphaFold does not use TensorFlow on the GPU (instead it uses JAX). See issue. Changed tensorflow to tensorflow-cpu.
  • There is no need to have system CUDA libraries since they are already included in the conda environment.
  • Switched to micromamba instead of Miniconda.

With a three-stage build, our Docker image is only 5.4 GB on disk (2.1 GB compressed on DockerHub), almost half the size using the official Dockerfile (10.1 GB).

For further details see here.

AlphaFold launch command

Please refer to for all available options.

Launch script run

For your convenience, we have prepared a launch script run that takes care of the Singularity command and the database paths, since these are unlikely to change. If you do need to customize anything please use the full Singularity command.

singularity run -B $(realpath $ALPHAFOLD_DATA_PATH):/data \
                -B $(realpath $ALPHAFOLD_DATA_PATH/../bfd):/data/bfd \
                -B $(realpath $ALPHAFOLD_DATA_PATH/../mgnify):/data/mgnify \
                -B $(realpath $ALPHAFOLD_DATA_PATH/../pdb70):/data/pdb70 \
                -B $(realpath $ALPHAFOLD_DATA_PATH/../small_bfd):/data/small_bfd \
                -B $(realpath $ALPHAFOLD_DATA_PATH/../uniclust30):/data/uniclust30 \
                -B $(realpath $ALPHAFOLD_DATA_PATH/../uniref90):/data/uniref90 \
                -B .:/etc \
                --pwd /app/alphafold \
                --nv $CONTAINERDIR/alphafold-${EBVERSIONALPHAFOLD}.sif \
    --data_dir=/data \
    --uniref90_database_path=/data/uniref90/uniref90.fasta \
    --mgnify_database_path=/data/mgnify/mgy_clusters.fa \
    --template_mmcif_dir=/data/pdb_mmcif/mmcif_files \
    --obsolete_pdbs_path=/data/pdb_mmcif/obsolete.dat \

Explanation of Singularity flags

  1. The database and models are stored in $ALPHAFOLD_DATA_PATH.
  2. A cache file will be written to /etc, which is not allowed on Rivanna. The workaround is to bind-mount e.g. the current working directory to /etc inside the container. [-B .:/etc]
  3. You must launch AlphaFold from /app/alphafold inside the container due to this issue. [--pwd /app/alphafold]
  4. The --nv flag enables GPU support.

Explanation of AlphaFold flags

  1. The default command of the container is /app/
  2. As a consequence of the Singularity --pwd flag, the fasta and output paths must be full paths (e.g. /scratch/$USER/mydir, not relative paths (e.g. ./mydir). You may use $PWD as demonstrated.
  3. The max_template_date is of the form YYYY-MM-DD.
  4. Only the database paths in mark_flags_as_required of are included because the optional paths depend on db_preset (full_dbs or reduced_dbs) and model_preset.

Slurm Script

Below are some Slurm script templates for version 2.3.

Monomer with full_dbs

#SBATCH -A mygroup      # your allocation account
#SBATCH -p gpu          # partition
#SBATCH --gres=gpu:1    # number of GPUs
#SBATCH -C "v100|a100"  # request a V100 or A100 GPU
#SBATCH -N 1            # number of nodes
#SBATCH -c 8            # number of cores
#SBATCH -t 10:00:00     # time

module purge
module load singularity alphafold

run --fasta_paths=$PWD/your_fasta_file \
    --output_dir=$PWD/outdir \
    --model_preset=monomer \
    --db_preset=full_dbs \
    --bfd_database_path=/data/bfd/bfd_metaclust_clu_complete_id30_c90_final_seq.sorted_opt \
    --pdb70_database_path=/data/pdb70/pdb70 \
    --uniref30_database_path=/data/uniref30/UniRef30_2021_03 \
    --max_template_date=YYYY-MM-DD \

Multimer with reduced_dbs

#SBATCH -A mygroup      # your allocation account
#SBATCH -p gpu          # partition
#SBATCH --gres=gpu:1    # number of GPUs
#SBATCH -C "v100|a100"  # request a V100 or A100 GPU
#SBATCH -N 1            # number of nodes
#SBATCH -c 8            # number of cores
#SBATCH -t 10:00:00     # time

module purge
module load singularity alphafold

run --fasta_paths=$PWD/your_fasta_file \
    --output_dir=$PWD/outdir \
    --model_preset=multimer \
    --db_preset=reduced_dbs \
    --pdb_seqres_database_path=/data/pdb_seqres/pdb_seqres.txt \
    --uniprot_database_path=/data/uniprot/uniprot.fasta \
    --small_bfd_database_path=/data/small_bfd/bfd-first_non_consensus_sequences.fasta \
    --max_template_date=YYYY-MM-DD \


  1. Before upgrading to a newer version, please always check the official repo for details, especially on any changes to the parameters, databases, and flags.

  2. You may need to request 8 CPU cores due to this line printed in the output:

    Launching subprocess "/usr/bin/jackhmmer -o /dev/null -A /tmp/tmpys2ocad8/output.sto --noali --F1 0.0005 --F2 5e-05 --F3 5e-07 --incE 0.0001 -E 0.0001 --cpu 8 -N 1 ./seq.fasta /share/resources/data/alphafold/mgnify/mgy_clusters.fa"
  3. You must provide a value for --max_template_date. If you are predicting the structure of a protein that is already in PDB and you wish to avoid using it as a template, then max_template_date must be set to be before the release date of the structure. If you do not need to specify a date, by default you can set today’s date. For example, if you are running the simulation on August 7th 2021, set -–max_template_date = 2021-08-07. See here.

  4. The flag --use_gpu_relax is only for version 2.1.2 and above.

  5. You are not required to use the run wrapper script. You can always provide the full singularity command.