How to Color AlphaFold Structures by pLDDT in PyMOL: Confidence Visualization Guide
Every AlphaFold structure comes with per-residue confidence scores encoded directly in the PDB file — but only if you know where to look and how to visualize them. This tutorial covers the complete workflow from loading an AlphaFold PDB to producing a publication-quality confidence-colored figure.
Where pLDDT is stored — the B-factor column
AlphaFold PDB files store per-residue pLDDT confidence scores in the B-factor column — the same column that experimental crystal structures use for thermal displacement parameters. This is the key technical fact that makes PyMOL coloring trivial: any PyMOL command that colors by B-factor automatically colors by pLDDT when the input is an AlphaFold structure.
ATOM 2 CA MET A 1 -2.511 13.201 8.041 1.00 36.25 C
ATOM 20 N ASP A 3 1.234 10.456 5.321 1.00 72.41 N
ATOM 45 CA GLU A 8 8.901 4.321 -1.234 1.00 94.87 C
ATOM 67 N LYS A 14 15.123 -2.456 -8.901 1.00 98.23 N
The B-factor values in AlphaFold files range from 0 to 100 — the pLDDT score scale. In a crystal structure B-factors are in ų and can be any positive number. The shared column format means the same PyMOL commands work for both, but the color scales and interpretations differ completely: high B-factor in a crystal structure means flexible, while high B-factor in AlphaFold means confident.
The standard AlphaFold color scheme
The AlphaFold Database uses a specific four-color confidence scheme. While you can use any color gradient in PyMOL, using the official AFDB colors makes figures immediately recognizable to reviewers and readers familiar with AlphaFold:
The one-command coloring workflow
# Load AlphaFold structure (from database download or ColabFold)
load AF-P04637-F1-model_v4.pdb
# Set up display
as cartoon
set cartoon_fancy_helices, 1
# Color by pLDDT — this is the core command
spectrum b, blue_cyan_yellow_orange_red, minimum=50, maximum=100
The three arguments to spectrum are what make this work correctly:
b— tells PyMOL to use the B-factor column as the data sourceblue_cyan_yellow_orange_red— a five-stop gradient from high-confidence blue through low-confidence red, matching the AFDB visual conventionminimum=50, maximum=100— clamps the scale so that everything below 50 gets the same lowest color and the full gradient covers the meaningful 50–100 range. Without this, PyMOL scales to the actual min/max in the file, compressing the useful range.
minimum=50 means everything below 50 gets the same “very low confidence” color rather than showing a misleading gradient within the disordered region. This produces a cleaner, more informative figure.
Color scale variants for different contexts
color slate, b > 70
color salmon, b <= 70
Interpreting what you see
After coloring, the immediate goal is to check two things before using the structure for any downstream analysis. First, look at your region of interest — the binding site, active site, or domain you’re studying. If it’s blue or teal, proceed. If it’s yellow, orange, or red, the geometry there is unreliable and conclusions drawn from it are not trustworthy.
# Print pLDDT of all residues in your binding site
select site, resi 175+248+249+273+282 and chain A
iterate site and name CA, print(resi, resn, b)
# Calculate mean pLDDT of the site (report this in methods)
stored.plddt = []
iterate site and name CA, stored.plddt.append(b)
print("Mean pLDDT:", sum(stored.plddt)/len(stored.plddt))
# Select all confident residues for downstream analysis
select confident_regions, b > 70
select uncertain_regions, b >= 50 and b < 70
select disordered_regions, b < 50
Selective confidence coloring
For figures that combine pLDDT confidence coloring with other information — chain identity, a highlighted binding site, or a comparison with another structure — apply the spectrum to a specific selection rather than the whole protein:
# Color whole protein gray, then pLDDT only on the domain of interest
color gray70, polymer
spectrum b, blue_cyan_yellow_orange_red, resi 100-250, minimum=50, maximum=100
# Highlight the binding site by pLDDT, gray the rest
select site, byres (LIG around 5)
color gray70, polymer
spectrum b, blue_red, site, minimum=50, maximum=100
show sticks, site
util.cbag LIG
# Color by pLDDT but highlight one key residue differently
spectrum b, blue_cyan_yellow_orange_red, minimum=50, maximum=100
color red, resi 273 and chain A # override one key residue
Publication figure workflow
# ── Load ────────────────────────────────────────────
load AF-P04637-F1-model_v4.pdb
as cartoon
hide everything, resn HOH
# ── Color by pLDDT ──────────────────────────────────
spectrum b, blue_cyan_yellow_orange_red, minimum=50, maximum=100
# ── Cartoon quality ─────────────────────────────────
set cartoon_fancy_helices, 1
set cartoon_smooth_loops, 1
set cartoon_tube_radius, 0.4
# ── Figure settings ─────────────────────────────────
bg_color white
set ray_opaque_background, 1
set ambient, 0.40
set specular, 0.25
set light_count, 4
set antialias, 2
# ── Orient (paste get_view output here) ─────────────
orient
# ── Export ──────────────────────────────────────────
png plddt_figure.png, width=1200, height=900, dpi=300, ray=1
pLDDT coloring in one paragraph
AlphaFold stores pLDDT confidence scores in the PDB B-factor column — making PyMOL coloring a single command: spectrum b, blue_cyan_yellow_orange_red, minimum=50, maximum=100. The minimum=50 clamp is essential — without it the gradient compresses into the disordered range and loses meaning. Blue is high confidence, red is low. Always check your binding site or region of interest before drawing structural conclusions: if key residues are yellow or red, the predicted geometry is unreliable. Report the mean pLDDT of your site in the methods section. Save the coloring command in a .pml script alongside get_view output so the exact figure can be regenerated when reviewers ask for revisions.