Skip to content

AlphaFold2 and ColabFold: Predicting 3D Protein Structures Using Free Cloud GPUs

For over half a century, the protein folding problem stood as one of the grand challenge problems in biophysics: how does a one-dimensional linear sequence of amino acids fold into a unique, biologically active three-dimensional macromolecular architecture? In 2020 at CASP14, DeepMind demonstrated with AlphaFold2 that deep learning architectures could predict atomic coordinates for single-chain proteins with accuracy competitive with experimental X-ray crystallography and cryo-electron microscopy.

However, standard AlphaFold2 pipelines originally required downloading over 3 terabytes of genetic sequence databases (BFD, MGnify, UniRef90) and demanded high-end local workstation clusters. ColabFold (developed by Milot Mirdita, Martin Steinegger, and Sergey Ovchinnikov, Nature Methods 2022) solved this computational bottleneck. By pairing the AlphaFold2 deep learning inference engine with ultra-fast MMseqs2 cloud homology searches, ColabFold predicts protein structures in minutes using free cloud GPUs.

This guide provides a comprehensive tutorial for predicting monomers, oligomeric assemblies, and protein-protein complexes using ColabFold, interpreting per-residue confidence scores (pLDDT) and Predicted Aligned Error (PAE) matrices, and rendering publication-ready molecular graphics.

If you plan to assess how these predicted targets bind small-molecule drug candidates, explore our Structural Prediction Theory, Structure Visualization with PyMOL & Chimera, or consult our turnkey Molecular Dynamics Simulation Services.


1. Introduction & Real-World Biological Context

Proteins carry out nearly every catalytic, signaling, structural, and transport function in living organisms. Yet, experimental structural determination remains resource-intensive:

  • X-Ray Crystallography: Demands milligrams of pure, crystallizable protein; fails on flexible linkers, membrane proteins, or transient multi-protein complexes.
  • Cryo-EM: Expensive instrument time; lower resolution on proteins under 100 kDa without symmetry.
  • NMR Spectroscopy: Technically restricted to small proteins (under 30–40 kDa).

How AlphaFold2 and ColabFold Work Under the Hood

AlphaFold2 rejects traditional physics-based fragment assembly in favor of an end-to-end differentiable neural network:

  1. Multiple Sequence Alignment (MSA) & Covariation: Homologous sequences preserve spatial contacts through correlated evolutionary mutations. If residue i mutates from positive to negative, residue j in spatial proximity often mutates from negative to positive to maintain salt-bridge stability.
  2. The Evoformer Architecture: 48 iterative attention blocks exchange spatial information between the MSA representation and a 2D pairwise distance representation through row-wise and column-wise self-attention.
  3. The Invariant Point Attention (IPA) Structural Module: Operates directly in 3D Euclidean space on 3D rigid-body frames (translation and rotation vectors of each amino acid backbone), generating atomic coordinate predictions without templates.
  4. ColabFold Optimization: Instead of running CPU-bound JackHMMER searches for 30–60 minutes, ColabFold queries a remote server cluster running MMseqs2 against UniRef30 and ColabFoldDB, completing MSA construction in 15–45 seconds.

2. Prerequisites & Environment Setup

ColabFold can be executed directly inside Google Colab using free cloud T4/V100/A100 GPUs or deployed on your local Linux computing cluster via colabfold-conda.

Option A: Running on Google Colab (Zero Installation)

  1. Open the official ColabFold AlphaFold2 Notebook.
  2. From the top menu, select Runtime > Change runtime type.
  3. Set Hardware accelerator to GPU (T4 or A100 if subscribed to Colab Pro).
  4. Review our primer on Working with Google Colab in Bioinformatics.

Option B: Local / HPC Command-Line Installation (colabfold_batch)

To execute hundreds of sequences in batch mode without browser timeouts:

Terminal window
# Download the automated local installer script
wget https://raw.githubusercontent.com/YoshitakaMo/localcolabfold/main/install_colabbatch_linux.sh
# Run installation (creates an isolated conda environment with PyTorch and JAX)
bash install_colabbatch_linux.sh
# Add localcolabfold binary to your shell PATH
export PATH="${HOME}/localcolabfold/colabfold-conda/bin:${PATH}"
# Verify CUDA and JAX GPU detection
python -c "import jax; print('JAX detected devices:', jax.devices())"

3. Input Data Format & Preprocessing

The primary input is standard FASTA format. To achieve high structural accuracy, follow rigorous sequence hygiene:

3.1 Sequence Hygiene Checklist

  • Remove Signal Peptides: Cleaved secretory signal peptides (e.g., predicted by SignalP 6.0) lack native folding partners and disrupt AlphaFold’s MSA alignment.
  • Strip Purification Tags: Long poly-histidine tags (HHHHHH), FLAG tags, or TEV protease cleavage sites are intrinsically disordered and generate misleading low-confidence loops.
  • Unnatural Amino Acids: Replace non-standard letters (e.g., U, O, X) with closest natural analogs or wild-type residues.

3.2 Monomer vs. Multimer Query Syntax

For a monomer (e.g., human Cyclin-Dependent Kinase 2):

>CDK2_HUMAN
MENFQKVEKIGEGTYGVVYKARNKLTGEVVALKKIRLDTETEGVPSTAIREISLLKELNH
PNIVKLLDVIHTENKLYLVFEFLHQDLKKFMDASALTGIPLPLIKSYLFQLLQGLAFCHS
HRVLHRDLKPQNLLINTEGAIKLADFGLARAFGVPVRTYTHEVVTLWYRAPEILLGCKYY
STAVDIWSLGCIFAEMVTRRALFPGDSEIDQLFRIFRTLGTPDEVVWPGVTSMPDYKPSF
PKWARQDFSKVVPPLDEDGRSLLSQMLHYDPNKRISAKAALAHPFFQDVTKPVPHLRL

For a homooligomer or heterodimer (e.g., CDK2 bound to Cyclin A2), separate distinct chains with a colon (:):

>CDK2_CyclinA2_Heterodimer
MENFQKVEKIGEGTYGVVYKARNKLTGEVVALKKIRLDTETEGVPSTAIREISLLKELNHPNIVKLLDVIHTENKLYLVFEFLHQDLKKFMDASALTGIPLPLIKSYLFQLLQGLAFCHSHRVLHRDLKPQNLLINTEGAIKLADFGLARAFGVPVRTYTHEVVTLWYRAPEILLGCKYYSTAVDIWSLGCIFAEMVTRRALFPGDSEIDQLFRIFRTLGTPDEVVWPGVTSMPDYKPSFPKWARQDFSKVVPPLDEDGRSLLSQMLHYDPNKRISAKAALAHPFFQDVTKPVPHLRL:MAETGVPSTAIREISLLKELNHPNIVKLLDVIHTENKLYLVFEFLHQDLKKFMDASALTGIPLPLIKSYLFQLLQGLAFCHSHRVLHRDLKPQNLLINTEGAIKLADFGLARAFGVPVRTYTHEVVTLWYRAPEILLGCKYYSTAVDIWSLGCIFAEMVTRRALFPGDSEIDQLFRIFR

4. The Step-by-Step Computational Workflow

[FASTA Query] ---> [MMseqs2 Cloud Search] ---> [MSA Pair Construction]
|
[PDB / Metric Extraction] <--- [Amber Relaxation] <--- [Evoformer + Structural Module]

Step 1: Multiple Sequence Alignment (MSA) Generation

When you submit a sequence to ColabFold, it contacts the MMseqs2 API server:

  • Sequences are aligned against UniRef30 (a sequence cluster dataset clustered at 30% sequence identity) and ColabFoldDB (a combination of BFD and environmental metagenomic databases).
  • MSA depth directly correlates with prediction reliability: sequences with fewer than 30 effective sequences (N_eff < 30) frequently produce lower-confidence predictions.

Step 2: Critical Hyperparameter Configuration

ParameterRecommended SettingTechnical Rationale
model_typeauto (or alphafold2_multimer_v3)Automatically switches to Multimer v3 when colons are detected in the FASTA header.
num_recycles3 (standard) or 6–12 (complex)Recycles feed structural module outputs back through Evoformer blocks. Difficult targets and multimer interfaces stabilize with higher recycles.
num_models5Generates 5 distinct models seeded with different pseudorandom weights. Essential for sampling conformational flexibility.
use_ambertrueExecutes post-prediction energy minimization using OpenMM to resolve stereochemical bond overlaps and peptide clashes.
max_msa512:1024 (default)MSA depth subsampling. Lowering to 256:512 enables prediction of proteins up to 2,000 residues on 16 GB GPUs.

Step 3: Batch Prediction Execution via Command Line

Run colabfold_batch on your prepared FASTA input:

Terminal window
# Execute AlphaFold2 multimer prediction with Amber relaxation
colabfold_batch \
--model-type alphafold2_multimer_v3 \
--num-recycle 3 \
--amber \
--use-gpu-relax \
targets.fasta \
./prediction_results

Step 4: Output File Decomposition

Inside the output folder, ColabFold generates:

  1. target_relaxed_rank_001_alphafold2_multimer_v3_model_1_seed_000.pdb: The top-ranked, energy-minimized coordinate file. The B-factor column stores per-atom pLDDT scores (0–100).
  2. target_scores_rank_001_*.json: Array of per-residue pLDDT values, overall pTM, and ipTM (for multimers).
  3. target_predicted_aligned_error_v1.json: Full $L \times L$ pairwise distance error matrix.
  4. target_coverage.png: Depth of the MSA across sequence coordinates.

5. Data Visualization & Metric Interpretation

Accurately interpreting AlphaFold2 output requires understanding two foundational metrics: pLDDT and PAE.

5.1 Understanding the pLDDT Scale

The predicted Local Distance Difference Test (pLDDT) ranges from 0 to 100, measuring local backbone stereochemical accuracy:

  • pLDDT > 90 (Very High Confidence): Atomic coordinates are comparable to high-resolution crystal structures. Side-chain rotamers are highly reliable. Ideal for virtual screening, docking, and catalytic site analysis.
  • 70 to 90 pLDDT (Confident): Good backbone prediction; loops and surface rotamers show minor divergence.
  • 50 to 70 pLDDT (Low Confidence): General fold topology may be correct, but secondary structure elements are imprecise.
  • pLDDT < 50 (Very Low Confidence): Strong indicator of Intrinsically Disordered Regions (IDRs). These segments do not form a stable 3D structure in isolation in solution. Do not attempt to dock drug molecules into regions with pLDDT under 50!

5.2 Interpreting the Predicted Aligned Error (PAE)

The PAE matrix shows the estimated error (in Ångströms, 0–30 Å) at residue x when the predicted structure is aligned on residue y:

  • Dark Blue / Low Error off-diagonal blocks: Indicate that two distant domains maintain a rigid, well-defined relative orientation.
  • Light Green / Orange off-diagonal blocks: Indicate that while individual domains are folded with high pLDDT internally, their relative orientation or packing angle is flexible or indeterminate.
  • Inter-subunit PAE: In multimers, low PAE between Chain A and Chain B confirms stable physical interaction.

5.3 Plotting Publication Metrics in Python

Use this Python script to parse ColabFold JSON score files and render a publication-grade metric panel:

import json
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
# 1. Load ColabFold JSON results
with open("target_scores_rank_001.json", "r") as f:
score_data = json.load(f)
plddt = np.array(score_data["plddt"])
pae = np.array(score_data["pae"])
# Create multi-panel figure
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(14, 6))
# Panel A: Per-Residue pLDDT Plot
residues = np.arange(1, len(plddt) + 1)
ax1.plot(residues, plddt, color="#1e293b", linewidth=1.5, label="pLDDT")
# Highlight confidence tiers
ax1.axhspan(90, 100, color="#2563eb", alpha=0.15, label="Very High (>90)")
ax1.axhspan(70, 90, color="#38bdf8", alpha=0.15, label="Confident (70-90)")
ax1.axhspan(50, 70, color="#fbbf24", alpha=0.15, label="Low (50-70)")
ax1.axhspan(0, 50, color="#f87171", alpha=0.15, label="Disordered (<50)")
ax1.set_ylim(0, 100)
ax1.set_xlabel("Residue Position", fontsize=12)
ax1.set_ylabel("Predicted LDDT Score", fontsize=12)
ax1.set_title(f"Per-Residue Confidence (Mean pLDDT = {plddt.mean():.1f})", fontsize=13)
ax1.legend(loc="lower right", frameon=True)
ax1.grid(True, linestyle="--", alpha=0.5)
# Panel B: 2D Predicted Aligned Error (PAE) Heatmap
im = ax2.imshow(pae, cmap="bwr_r", vmin=0, vmax=30)
cbar = fig.colorbar(im, ax=ax2, fraction=0.046, pad=0.04)
cbar.set_label("Expected Position Error (Å)", fontsize=11)
ax2.set_xlabel("Scored Residue Position", fontsize=12)
ax2.set_ylabel("Aligned Residue Position", fontsize=12)
ax2.set_title("Predicted Aligned Error (PAE Matrix)", fontsize=13)
plt.tight_layout()
plt.savefig("Figure_AlphaFold_Metrics.pdf", dpi=300)
plt.show()

5.4 Visualizing in PyMOL by Confidence Colors

Because AlphaFold encodes pLDDT in the crystallographic temperature factor (B-factor) column of the generated PDB, you can color the model by standard AlphaFold confidence colors directly in PyMOL:

# In PyMOL command line:
load target_relaxed_rank_001.pdb, target_model
# Apply standard AlphaFold color scheme
color tv_blue, target_model and b > 90
color cyan, target_model and b > 70 and b <= 90
color yellow, target_model and b > 50 and b <= 70
color salmon, target_model and b <= 50
# Ray trace publication render
set ray_shadows, 1
set antialias, 2
bg_color white
ray 2400, 1800
png alphafold_publication_figure.png

6. Common Errors & Troubleshooting

Error Message / SymptomRoot CauseExact Resolution
CUDA out of memory (OOM) during inferenceSequence length exceeds GPU VRAM (e.g., >1,200 residues on an NVIDIA T4 16GB).1. Subsample MSA depth using --max-msa 256:512. 2. Truncate unstructured terminal tails. 3. Upgrade to an A100 GPU instance (40–80 GB VRAM).
MMseqs2 API connection error / 502 Bad GatewayColabFold server congestion during peak European/US hours.Retry after 5 minutes or install localcolabfold to run MMseqs2 locally against downloaded databases.
Amber relaxation crashes with OpenMMException: Particle coordinate is NaNSevere atomic steric overlap in raw neural network unrelaxed prediction.Run --amber with --use-gpu-relax disabled, or bypass Amber relaxation (--amber omitted) and perform GROMACS Steepest Descent Minimization.
High monomer pLDDT but multimer ipTM < 0.50The two proteins do not form a stable physical complex, or form transient interactions dependent on post-translational modifications (PTMs).Re-run with --num-recycle 6 or 12. If ipTM remains low, the interaction likely requires external co-factors or lipid membrane scaffolds.

7. Frequently Asked Questions (FAQ)

Can AlphaFold2 predict the impact of single-point missense mutations (SNPs)?

AlphaFold2 relies on evolutionary alignments rather than physical thermodynamic force fields, so single-point mutations usually produce negligible changes in the predicted backbone conformation.

Does AlphaFold2 predict structures with bound small molecule ligands or metal cofactors?

Standard AlphaFold2 predicts apo (unliganded) structures. For modeling holoproteins with metal ions (Mg2+, Zn2+) or small-molecule drugs, use AlphaFold3 or dock ligands into high-pLDDT pockets using Molecular Docking & GROMACS MD.

What is the difference between pTM and ipTM?

The predicted TM-score (pTM) measures global tertiary fold accuracy for the entire complex, whereas the interface predicted TM-score (ipTM) measures accuracy exclusively at the inter-chain contact interface.

Is Amber relaxation strictly required for publication structures?

Amber relaxation corrects minor bond angle distortions and steric clashes without altering overall backbone topology, and is strongly recommended prior to molecular dynamics or docking.


Next Steps in Structural Bioinformatics

Advance your computational biology pipeline:

Topics Covered

alphafold2 tutorialcolabfold google colabprotein structure predictionmmseqs2 msaplddt score interpretationpredicted aligned error paealphafold multimerstructural bioinformatics