Resources chevron_right Protocols chevron_right ColabFold
Protocol // Protein Structure

ColabFold

Predict the structure of proteins using AlphaFold2 locally or via Google Colab — fast, accessible, and GPU-accelerated.

Protein Structure codeGitHub languageLocal Install menu_bookPaper scheduleMarch 31, 2026
open_in_new

Web version available on Google Colaboratory: AlphaFold2.ipynb

Installation

Make sure curl, git and wget are installed in your system, otherwise run the following command:

sudo apt -y install curl git wget

Check the version of your GNU compiler. It must be 4.9 or later. If not, install the newest version and add it to the PATH.

Download the installation file

wget https://raw.githubusercontent.com/YoshitakaMo/localcolabfold/main/install_colabbatch_linux.sh

Run it in the directory you want to install it:

bash install_colabbatch_linux.sh

A folder called localcolabfold will be created. Don't move this folder after the installation.

Open the ~/.bashrc file in a text editor in your terminal, and add the following lines to it:

export PATH="/home/ColabFold/localcolabfold/colabfold-conda/bin:$PATH"
export __GL_SHADER_DISK_CACHE="/scratch/Colabfold/"

Restart your bash terminal.

Run

Add the program to the PATH

Example SLURM job script for running ColabFold on a GPU cluster:

#!/bin/bash

#SBATCH --job-name=Colabfold
#SBATCH --time=10-00:00:00
#SBATCH --cpus-per-task=
#SBATCH --mem=40GB
#SBATCH -w 
#SBATCH --gres=gpu:1
#SBATCH --partition=
#SBATCH --output=%x_%j_stdout.txt
#SBATCH --error=%x_%j_stderr.txt

#SBATCH --mail-type=ALL
#SBATCH --mail-user=

export PATH="/vol/home/ColabFold/localcolabfold/colabfold-conda/bin:$PATH"
export __GL_SHADER_DISK_CACHE="/scratch/Colabfold/"
colabfold_batch --templates --amber --num-recycle 3 --num-models 1 --zip input output_directory
Parameter Description
input Directory containing your FASTA files; can also be a multi-FASTA file
output_directory Folder where the outputs will be saved
--templates Enables the use of templates for the prediction
--amber Enable amber relaxation
--num-recycle How many times the new structure will be fed to the original alignment to refine the model
--num-models Number of models to be generated

Output

There are a few parameters that are important to check to understand the quality of your predictions.

Metric Description
MSA depth Number of sequences used in your MSA. Important to have more than 30 sequences. From 100+ sequences it doesn't change much.
pTM score Predicted template modelling score — closest to 1 means more reliable predicted structure compared to the template (above 0.5 is considered good).
pLDDT Predicted local distance difference test — confidence metric for the prediction. It's a percentage, so closest to 100 is better.
RMSD Root mean square deviation — weighted average distance between corresponding atoms when two similar structures are superimposed. Smaller is better; two identical structures give 0 Å. RMSD > 2–3 Å suggests substantially different structures.
PAE Predicted aligned error — confidence that one residue in your protein is interacting with another. Lower value is better.
ipTM Interface predicted template modelling — accuracy of the predicted structure of a multimer (AlphaFold-Multimer). Measures accuracy of the predicted interface between subunits of the protein-protein complex.

Recover Quality Info

When running locally it might be tricky to recover the pTM and pLDDT measures for each prediction. The following script helps with that:

#!/bin/bash

# Function to display usage information
usage() {
    echo "Usage: $0 -i input_file -o output_file"
    exit 1
}

# Parse command-line arguments
while getopts ":i:o:" opt; do
    case $opt in
        i) input_file="$OPTARG" ;;
        o) output_file="$OPTARG" ;;
        *) usage ;;
    esac
done

# Check if both input and output files are provided
if [ -z "$input_file" ] || [ -z "$output_file" ]; then
    usage
fi

# Initialize variables
query_line=""
ptm_line=""
found_query=false

# Clear the output file if it already exists
> "$output_file"

# Read the input file line by line
while IFS= read -r line; do
    if [[ $line == *"Query"* ]]; then
        # Store the query line and set the flag
        query_line=$line
        found_query=true
    elif [[ $found_query == true && $line == *"pTM"* ]]; then
        # Store the pTM line and reset the flag
        ptm_line=$line
        found_query=false
        # Write the query and pTM lines to the output file in tab-separated format
        echo -e "${query_line}\t${ptm_line}" >> "$output_file"
    fi
done < "$input_file"

echo "Processing complete. Results are saved in $output_file."

Make the script executable:

chmod +x ColabFold_quality-recovery.sh

To execute the script, add the input file (the log file from ColabFold) and a name for your output file:

./ColabFold_quality-recovery.sh -i input.txt -o output.tab

Using ColabFold or Batch Prediction

open_in_new

Batch prediction notebook on Google Colaboratory: AlphaFold2_batch.ipynb

We need a folder with individual FASTA files on the same Google Drive account as ColabFold is running.

The format of the path in the Drive to use as the input folder (and also for the Results) is like this:

/content/drive/MyDrive/Colab_files/Cox/Recover_faa

Pay attention

warning

The files must have the extension .fasta

Make sure there are no "weird" characters in your sequences. Examples: * or -

Multimer Prediction

The sequences whose interaction you want to predict should be input with : between them.

info

Use the ipTM score to evaluate multimer prediction quality — it measures the accuracy of the predicted interface between subunits of the protein-protein complex.