# Mapping Conservation on AlphaFold Structures in PyMOL

By the end of this tutorial you will be able to take any AlphaFold model, compute a conservation score for every residue from a [multiple sequence alignment](/blog/guides/multiple-sequence-alignment), and paint those scores onto the 3D structure in PyMOL so that the most conserved positions glow in one color and the most variable positions in another. You will also learn how to keep the AlphaFold confidence values alive alongside the conservation values, how to verify the mapping residue by residue, and how to render a publication-quality figure.

Everything here runs on free tools. Have the following on hand before you start:

- PyMOL 2.5 or newer. Either the Schrödinger build (free educational license for students) or the open source build from conda forge.
- Python 3.8 or newer for the scoring script. Any plain Python installation works, no extra packages required.
- A multiple [sequence alignment tool](/blog/guides/sequence-alignment-tool). Clustal Omega runs from the command line or through the EMBL-EBI web interface, and MAFFT is available as a web service as well.
- A UniProt accession for your protein of interest, for example P12345, because AlphaFold DB models are keyed to UniProt entries.
- A text editor and roughly 30 minutes.

The core trick that makes this workflow clean is that PyMOL already reads a numeric per-residue property from every structure file, the b-factor column. AlphaFold models store their per-residue confidence score, pLDDT, in that column. Conservation mapping in PyMOL is simply the act of replacing the values in that column with your conservation scores and then running the spectrum command. Once you understand that handoff, every variation of the workflow becomes obvious.

## Background: Conservation, pLDDT, and the b-Factor Handoff

![Four step flow: pLDDT copied to occupancy, b set to negative 1, scores written into b, then colored by spectrum.](/article-images/illustrations/alphafold-conservation-mapping-pymol-b-factor-handoff.webp)

Three ideas carry the whole workflow.

**Conservation.** A residue is conserved when the same amino acid appears at that position across most homologous sequences. Strongly conserved positions usually reflect constraints the protein cannot escape, such as a catalytic residue, a disulfide-forming cysteine, or a residue buried in a tightly packed hydrophobic core. Variable positions tolerate substitution and often sit on solvent-exposed loops.

**pLDDT.** The predicted local distance difference test score is AlphaFold's per-residue confidence estimate on a scale of 0 to 100. The AlphaFold DB documentation describes four confidence bands, above 90, between 90 and 70, between 70 and 50, and below 50, with the lowest band often marking genuinely disordered regions. In AlphaFold DB files and in AlphaFold 3 outputs, pLDDT values are stored in the b-factor column.

**The b-factor as a transfer channel.** PyMOL colors by b-factor with a single command. Because AlphaFold already uses that column for pLDDT, the cleanest conservation mapping treats b as a writable channel. You back up pLDDT into the occupancy column, overwrite b with conservation scores, and color by b. You can flip back to a pLDDT view at any time without reloading anything.

With that framing, the full pipeline is:

1. Download an AlphaFold model.
2. Collect homologous sequences and build a multiple sequence alignment, or MSA.
3. Compute one conservation number per residue of your reference protein.
4. Push those numbers into b-factors with a short PyMOL script.
5. Color, verify, render, export.

## Step 1. Get Your AlphaFold Model

### Option A. Pull a precomputed model from AlphaFold DB

AlphaFold DB, hosted by EMBL-EBI in collaboration with Google DeepMind, contains predicted structures for over 200 million proteins, covering essentially every proteome in UniProt. If your protein has a UniProt accession, a model probably exists.

From inside PyMOL 2.5 or newer, you can fetch it directly:

```text
fetch P12345, type=alphafold
```

PyMOL downloads the model, names the object after the accession, and loads the pLDDT values into b-factors automatically. If your PyMOL version does not support this fetch type, download the file manually from the AlphaFold DB entry page. The file naming follows a fixed pattern:

```text
https://alphafold.ebi.ac.uk/files/AF-P12345-F1-model_v4.pdb
```

Replace the accession and keep the version suffix that the site shows you, since DB versions advance over time. Then load it:

```text
load AF-P12345-F1-model_v4.pdb, afmodel
```

A quick sanity check that the model loaded with confidence values intact:

```text
iterate afmodel and resi 50, print(resi, b)
```

You should see a number between 0 and 100. If you see values like 1.00 or 0.00 across the board, you have loaded a different file type or a stripped file and should go back to the download.

### Option B. Predict with AlphaFold Server

For proteins or complexes that are not in AlphaFold DB, for example a newly sequenced protein, a designed construct, or a multi-chain complex, the AlphaFold Server from Google DeepMind runs AlphaFold 3 predictions free of charge for noncommercial use. You paste or upload sequences on the server website, submit the job, and download the resulting mmCIF file when the run completes. Note that the server has input size limits and a usage policy that restricts commercial use, so check both on the site before relying on it for a project.

Load the result in PyMOL:

```text
load af3_prediction.cif, complex
```

PyMOL reads mmCIF natively. AlphaFold 3 writes per-residue pLDDT into the b-factor field of the mmCIF, so the same b-factor handoff works. For a multi-chain complex, always work on one chain at a time when mapping conservation, because your MSA is built from one reference sequence:

```text
select chainA, complex and chain A
```

Later commands will act on `chainA` rather than the whole object.

## Step 2. Build a Multiple Sequence Alignment

Conservation is a property of a set of homologs, so the quality of your figure is capped by the quality of your alignment.

### Collect homologs

Run a BLASTp search at NCBI using your [protein sequence](/blog/guides/protein-sequence) against the nonredundant [protein database](/blog/guides/protein-database) or a curated database such as UniProtKB. Practical criteria that keep an MSA informative:

- Take between roughly 30 and 200 sequences. Below about 20, conservation scores are noisy and nearly everything looks conserved. Above a few hundred, redundant close relatives dominate and the signal flattens.
- Favor hits covering most of your protein, for example 70 percent or more of the query length, so the alignment does not collapse into fragments.
- Spread the taxonomic range. Fifty sequences from one bacterial genus carry less information than fifty sequences spread across phyla.
- Reject low quality hits with many uncharacterized residues (X) or obvious frameshift artifacts.

Download the hits in FASTA format and add your own protein as the first record so it becomes the reference.

### Align

On the command line, Clustal Omega with default settings handles most protein alignments well and its single-dash arguments keep the command short:

```text
clustalo -i homologs_raw.fasta -o aligned.fasta
```

For divergent families where homologs share under about 30 percent identity, a pair of hidden Markov model based aligners generally outperforms progressive alignment. MAFFT in its accuracy oriented modes and Clustal Omega with hidden Markov model guidance are the standard choices here. If you prefer not to install anything, the EMBL-EBI web services for Clustal Omega and MAFFT accept a pasted FASTA file and return the aligned file by email or in the browser.

Whatever route you take, verify the alignment by eye before scoring. Check that:

- Every fully conserved motif you already know about lines up in one column.
- No sequence is mostly gaps.
- The reference sequence has no gaps of its own, or if it does, you understand that those positions will not receive scores.

## Step 3. Compute Per-Residue Conservation Scores

The simplest robust score, and the one this tutorial uses by default, is fractional identity: for each position, the fraction of aligned homologs that contain the same amino acid as the reference. A score of 1.0 means every non-gap homolog agrees with the reference residue. A score near 0 means the position tolerates almost anything.

A second common score is normalized [Shannon entropy](/blog/data-analysis/shannon-entropy-definition-formula-examples). For a column with amino acid frequencies p1 through p20, the Shannon entropy is H = negative sum of pi times log(pi). Dividing by log(20) and subtracting from 1 gives a score from 0 to 1 where 1 means only one amino acid is present. Entropy captures the diversity of the whole column, while fractional identity ties the score specifically to the reference residue. For mapping onto a specific protein's structure, fractional identity is usually the more interpretable choice, which is why the script below defaults to it.

The following script reads your aligned FASTA file and writes a PyMOL script. Save it as `map_conservation.py`.

```python
#!/usr/bin/env python3
"""
map_conservation.py

Reads a FASTA multiple sequence alignment, scores conservation at every
position of the first sequence (the reference), and writes a PyMOL script
that assigns the scores to b-factors.

Usage:
    python map_conservation.py aligned.fasta map_scores.pml
"""

import math
import sys

def read_fasta(path):
    records = []
    header, chunks = None, []
    with open(path) as handle:
        for raw in handle:
            line = raw.strip()
            if line.startswith(">"):
                if header is not None:
                    records.append((header, "".join(chunks)))
                header = line[1:].split()[0]
                chunks = []
            elif line:
                chunks.append(line)
    if header is not None:
        records.append((header, "".join(chunks)))
    return records

def identity_scores(alignment):
    """Fraction of non-gap, non-ambiguous homologs matching the reference."""
    ref_name, ref_seq = alignment[0]
    scores = {}
    for pos in range(len(ref_seq)):
        ref_res = ref_seq[pos]
        if ref_res == "-":
            continue
        matches = 0
        counted = 0
        for name, seq in alignment[1:]:
            res = seq[pos]
            if res == "-" or res in "XBZJU":
                continue
            counted += 1
            if res == ref_res:
                matches += 1
        if counted > 0:
            scores[pos + 1] = matches / counted
    return ref_name, scores

def entropy_scores(alignment):
    """Normalized Shannon entropy per column, 1.0 means fully conserved."""
    ref_name, ref_seq = alignment[0]
    alphabet = "ACDEFGHIKLMNPQRSTVWY"
    scores = {}
    for pos in range(len(ref_seq)):
        if ref_seq[pos] == "-":
            continue
        counts = dict((letter, 0) for letter in alphabet)
        total = 0
        for name, seq in alignment[1:]:
            res = seq[pos]
            if res in counts:
                counts[res] += 1
                total += 1
        if total == 0:
            continue
        entropy = 0.0
        for letter in alphabet:
            if counts[letter] > 0:
                freq = counts[letter] / total
                entropy -= freq * math.log(freq)
        scores[pos + 1] = 1.0 - entropy / math.log(len(alphabet))
    return ref_name, scores

def write_pymol_script(scores, out_path):
    lines = []
    lines.append("from pymol import cmd")
    lines.append("")
    lines.append('# back up pLDDT into occupancy, then clear b to a sentinel')
    lines.append('cmd.alter("all", "q=b")')
    lines.append('cmd.alter("all", "b=-1.0")')
    lines.append("")
    lines.append("scores = {")
    for resi in sorted(scores):
        lines.append('    %d: %.3f,' % (resi, scores[resi]))
    lines.append("}")
    lines.append("")
    lines.append("for resi, score in scores.items():")
    lines.append('    cmd.alter("resi %s" % resi, "b=%.3f" % score)')
    lines.append("")
    with open(out_path, "w") as out:
        out.write("\n".join(lines))
    print("Wrote %s with scores for %d residues." % (out_path, len(scores)))

if __name__ == "__main__":
    if len(sys.argv) != 3:
        print("Usage: python map_conservation.py aligned.fasta map_scores.pml")
        sys.exit(1)
    alignment = read_fasta(sys.argv[1])
    if len(alignment) < 2:
        print("Error: the alignment must contain the reference plus at least one homolog.")
        sys.exit(1)
    ref_name, scores = identity_scores(alignment)
    print("Reference sequence: %s" % ref_name)
    print("Scored %d positions out of %d alignment columns." %
          (len(scores), len(alignment[0][1])))
    write_pymol_script(scores, sys.argv[2])
```

Run it:

```text
python map_conservation.py aligned.fasta map_scores.pml
```

Expected console output:

```text
Reference sequence: P12345_CARBAMATE_KINASE
Scored 341 positions out of 341 alignment columns.
Wrote map_scores.pml with scores for 341 residues.
```

If the scored count is far smaller than the column count, your reference sequence contains gaps in the alignment, which means the aligner inserted gaps into your query. That is legitimate but worth knowing before you interpret missing colors.

Peek inside the generated file. It looks like this:

```text
from pymol import cmd

cmd.alter("all", "q=b")
cmd.alter("all", "b=-1.0")

scores = {
    1: 0.875,
    2: 1.000,
    3: 0.625,
    4: 1.000,
    ...
}

for resi, score in scores.items():
    cmd.alter("resi %s" % resi, "b=%.3f" % score)
```

Two details in this generated script do heavy lifting. First, `cmd.alter("all", "q=b")` copies the current b-factor, which is pLDDT, into the occupancy column q before anything overwrites b. Second, `cmd.alter("all", "b=-1.0")` initializes every residue to a sentinel of negative 1. Any residue the script never touches stays at negative 1, which gives you an honest way to detect and display positions with no alignment coverage rather than letting them masquerade as fully conserved pLDDT leftovers.

## Step 4. Map the Scores onto the Structure in PyMOL

This is the step by step core of alphafold conservation mapping in PyMOL. Work through it with the command log visible so you can retrace any step.

### Load everything and stage the properties

```text
load AF-P12345-F1-model_v4.pdb, afmodel
hide everything
show cartoon, afmodel
run map_scores.pml
```

The `run` command executes the generated script inside PyMOL. After it completes, every residue carries conservation in b and pLDDT in q. Confirm both:

```text
iterate afmodel and resi 57, print(resi, b, q)
```

Expected output for a mapped residue:

```text
 57: 0.9375 92.0
```

The first number is the conservation fraction, the second is the original pLDDT.

### Color by conservation

```text
spectrum b, blue_white_red, afmodel, minimum=0.0, maximum=1.0
```

Each argument matters:

- `b` tells the spectrum command to color by the b-factor property.
- `blue_white_red` is the palette name. Low values render blue, midrange values white, high values red. The palettes `rainbow`, `green_white_red`, and `red_white_blue` are also built in.
- `afmodel` restricts coloring to your object, which matters if other objects share the session.
- `minimum` and `maximum` pin the scale. Always set them explicitly. If you omit them, PyMOL autoscales to the observed range, and two figures computed from different alignments become incomparable because their color bars mean different things.

After the spectrum command, mask the sentinel residues so uncovered positions do not get stretched to the end of the color scale:

```text
color gray70, afmodel and b < 0
```

Expected visual result: a cartoon in which the hydrophobic core and any known catalytic residues read as warm red, surface loops read as cool blue or white, and any stretch the alignment did not cover appears flat gray. If the whole structure reads red, see the common mistakes section below, because that almost always means the score scale or the MSA is at fault rather than the biology.

### Display the least confident regions honestly

Because pLDDT now lives in q, you can render confidence and conservation side by side without a second file. One useful view is a cartoon colored by conservation with low confidence regions ghosted:

```text
set transparency, 0.6
set transparency, 0, afmodel and q > 70
```

The first line makes the cartoon transparent everywhere, the second restores opacity wherever pLDDT is above 70. The result is a figure where structurally trustworthy regions carry the conservation signal in full color and unreliable loops fade back. To restore a plain AlphaFold confidence view at any time:

```text
spectrum q, blue_cyan_yellow_orange, afmodel, minimum=0, maximum=100
```

Hmm, note that the four-band palette in the AlphaFold DB documentation is specific, and PyMOL does not ship it under that name. A faithful approximation uses discrete selections:

```text
select plddt_very_high, afmodel and q > 90
select plddt_high, afmodel and q > 70 and q <= 90
select plddt_low, afmodel and q > 50 and q <= 70
select plddt_very_low, afmodel and q <= 50
color skyblue, plddt_very_high
color cyan, plddt_high
color yellow, plddt_low
color orange, plddt_very_low
```

### Highlight the most conserved positions

```text
select conserved_core, afmodel and b >= 0.95
show sticks, conserved_core
set stick_radius, 0.15
```

Then click any highlighted residue in the graphics window, or run:

```text
iterate conserved_core, print(chain, resi, resn, b)
```

Expected output, one line per residue:

```text
 A 57 ASP 1.000
 A 130 GLY 0.9688
```

Cross-check a handful of these against the UniProt entry for your protein. Active site annotations, metal binding sites, and disulfide bonds in UniProt feature tables should land in the high scoring set. If a UniProt annotated catalytic residue scores low, suspect an alignment problem before you suspect the biology.

### Work on the surface

Many questions in conservation mapping are about exposed, functionally constrained surface patches such as binding grooves and interfaces:

```text
hide cartoon, afmodel
show surface, afmodel
set surface_quality, 1
set transparency, 0.35
spectrum b, blue_white_red, afmodel, minimum=0.0, maximum=1.0
color gray70, afmodel and b < 0
```

Because surface coloring follows the same per-atom properties, the score gradient carries over automatically.

## Step 5. Render and Export

For a figure, white background and ray tracing are the standard recipe:

```text
bg_color white
set ray_opaque_background, 0
orient
ray 2400, 1800
png conservation_map.png, dpi=300
```

`ray 2400, 1800` traces at that pixel resolution, so the `png` command simply writes what is already rendered. For a figure with a color scale, either draw the scale in your graphics program afterwards using the known palette endpoints, or report the minimum, maximum, and palette name in the figure legend, for example "conservation shown from 0 (blue) to 1 (red), blue white red palette."

To export the mapped structure with both properties embedded:

```text
save mapped_conservation.pdb, afmodel
```

The PDB format stores b-factors and occupancies in separate columns, so the saved file carries conservation in b and pLDDT in q. Any colleague can reload it and immediately reproduce both colorings. If your residue numbers exceed 9999, use CIF instead:

```text
save mapped_conservation.cif, afmodel
```

## Key Commands and Options at a Glance

| Command | What it does | Key arguments to watch |
|, - |, - |, - |
| `fetch P12345, type=alphafold` | Downloads an AlphaFold DB model (PyMOL 2.5+) | Requires PyMOL 2.5 or newer, needs network access |
| `load file.cif, obj` | Loads PDB or mmCIF, including AlphaFold 3 server output | Object name becomes your selection handle |
| `alter sel, q=b` | Copies b-factors into occupancy, backing up pLDDT | Run before overwriting b |
| `alter sel, b=0.5` | Writes a value into b-factors | Applies to all matching atoms in all states |
| `spectrum b, blue_white_red, sel, minimum=0, maximum=1` | Colors by a property along a palette | Always pin minimum and maximum |
| `select high, sel and b >= 0.95` | Builds a selection of top scoring residues | Use numeric thresholds, not autoscaled impressions |
| `iterate sel, print(resi, b, q)` | Prints per-residue properties for verification | Use small selections, output goes to the console |
| `png file.png, 2400, 1800, 300` | Exports the current view at publication resolution | Ray first for lighting quality |

## Practical Tips

### Pin your numbering to UniProt

AlphaFold DB models use UniProt canonical residue numbering. If your reference sequence in the MSA is the exact UniProt canonical sequence, alignment column i corresponds to residue i and the generated script is correct as is. If your reference is an isoform, a mature processed chain, or a construct with a tag, add or subtract the offset when writing the scores. The single most common numbering failure in alphafold conservation mapping projects is a silent offset from a [signal peptide](/knowledge/molecular-biology/signal-peptide) or affinity tag, and the symptom is a structure that colors correctly only in one lobe or one half of the protein.

### Keep an eye on MSA size and diversity

With fewer than about 20 informative homologs, fractional identity scores cluster near 1.0 and the figure loses contrast. With several thousand near-identical homologs, scores cluster by sampling noise rather than constraint. If you only have a handful of homologs, entropy based scoring weighted by sequence similarity, as implemented by established servers, extracts more signal than raw identity. The ConSurf server, a long running academic web service for evolutionary conservation analysis, performs the whole pipeline from sequence to a ready made PyMOL session and handles these weighting issues for you. If you need a defensible figure for a manuscript with minimal scripting, running ConSurf and then opening its PyMOL output is a legitimate path, and the understanding you gain from this tutorial makes its output files easy to customize.

### Guard the sentinel value

The negative 1 sentinel in the generated script exists because uninitialized b-factors are the classic source of false red patches. Any time you write a custom mapping script, initialize every residue to an out-of-range value first, then overwrite the positions you can score, then explicitly color the leftovers gray. This habit turns a silent error into a visible one.

### Use the sequence viewer to debug alignments

Turn on PyMOL's sequence viewer and the alignment mode:

```text
set seq_view, on
set seq_view_alignment, on
```

Hmm, the alignment display mode pairs PyMOL with a reference alignment file in some builds. The reliably available option is the plain sequence viewer, `set seq_view, on`, which shows residue names and numbers along the top of the graphics window. Clicking a red patch in the structure and reading the residue numbers directly from the viewer is the fastest way to confirm that numbering survived the round trip.

### Script the whole thing for reproducibility

Once the pipeline works interactively, save your PyMOL commands into a `.pml` file and your scoring step into the Python script you already have. A figure that can be regenerated with two commands, `python map_conservation.py aligned.fasta map_scores.pml` and `pymol render.pml`, is a figure a reviewer or collaborator can audit. Keep the raw homolog FASTA file alongside the alignment, because the alignment alone cannot tell you how sequences were selected.

### Chain level mapping for complexes

For AlphaFold Server predictions of complexes, compute one MSA per chain against that chain's reference sequence, then generate one score dictionary per chain. Adjust the generated script to scope each alter command to a chain:

```text
cmd.alter("complex and chain A and resi %s" % resi, "b=%.3f" % score)
```

This prevents a score computed against chain A's reference from landing on the wrong residues in chain B when both chains share residue numbers.

## Common Mistakes and Limitations

![Flowchart from a wrong colored patch through checks on reference gaps and numbering offset to a fix.](/article-images/illustrations/alphafold-conservation-mapping-pymol-numbering-triage.webp)

These are the failures seen most often in alphafold conservation mapping projects, with their causes and fixes.

**Coloring before backing up pLDDT.** If you overwrite b with conservation scores without first copying pLDDT to q, the confidence information is gone. The fix is cheap and only works preemptively: `alter all, q=b` before any script runs. If you already lost it, refetch the original model into a throwaway object and transfer the values.

**Forgetting that unmapped residues still have old b-factors.** Without the negative 1 sentinel, any residue your script does not touch keeps its pLDDT value, for example 92, which on a 0 to 1 conservation scale renders at the extreme warm end. Whole false "conserved cores" appear this way. Always initialize b to the sentinel and color `b < 0` gray.

**A gapless reference assumption that is false.** The script maps alignment column positions to residue numbers by position. If the aligner inserted gaps into your reference sequence, columns shift and every score after the first gap lands on the wrong residue. Confirm the reference has no gaps, or extend the script to track cumulative offsets.

**Autoscaled color ranges.** `spectrum b, rainbow, afmodel` without minimum and maximum stretches the palette across whatever range happens to exist in that file. Two alignments of the same protein can then produce figures that look similar but encode different scores. Always pass `minimum` and `maximum`.

**Interpreting low pLDDT regions.** Conservation scores on residues with pLDDT below 50 describe a low confidence model of those residues, not a reliable 3D context. The sequence position may be conserved while the displayed geometry, especially side chain conformations and loop positions, is speculative. Ghost or mask these regions in figures rather than deleting them.

**Small or redundant MSAs.** An MSA of five close homologs produces scores that mostly reflect sampling. An MSA dominated by one species family produces scores that reflect that family's quirks. Aim for tens to a few hundred diverse homologs and inspect the alignment before scoring.

**Confusing conservation with function.** A conserved position is under evolutionary constraint, which can be catalytic, binding related, or purely structural. Mapping conservation identifies candidate functional residues, it does not prove them. Follow up with mutagenesis literature, UniProt annotations, or domain knowledge before labeling a patch as an active site.

**Expecting an AlphaFold prediction to be an experimental structure.** Models from AlphaFold DB and from the AlphaFold Server are computational predictions. They are superb hypotheses about geometry but carry no direct experimental evidence, and the AlphaFold Server outputs in particular come with usage terms that restrict commercial application. Treat the structure as scaffolding for interpreting your conservation data.

**Version drift in file names.** AlphaFold DB file names include a model version, and fetching a stale URL can fail or return an older model. Download from the current entry page, or use the PyMOL fetch command which resolves the current version for you.

**Silent script failures from wrong object names.** If your object is named `complex` but the generated script alters `all`, other open objects get painted too. Scope alter and spectrum commands to the object you care about.

## Frequently Asked Questions

### Can PyMOL fetch AlphaFold models directly?

Yes, PyMOL 2.5 and newer can download AlphaFold DB models with `fetch ACCESSION, type=alphafold`, where ACCESSION is the UniProt identifier. Older versions should download the file from the AlphaFold DB website and load it with the `load` command instead.

### How do I keep pLDDT values after coloring by conservation?

Copy them into the occupancy column before overwriting the b-factors, with `alter all, q=b`. After that, conservation lives in b, pLDDT lives in q, and both survive `save` to PDB or CIF format.

### How many sequences should my multiple sequence alignment contain?

Roughly 30 to 200 diverse homologs covering most of the protein length works well in practice. Fewer than about 20 makes scores noisy and inflated, while thousands of near-identical sequences flatten the signal with redundancy rather than adding information.

### What does it mean when some residues stay gray in my figure?

Gray marks residues with a b-factor below zero, which happens when the alignment gave those positions no score, usually because the reference residue was aligned to a gap or every homolog was gapped there. Check the alignment at those columns before assuming anything about those residues.

### Can I use a web server instead of writing my own scoring script?

Yes. The ConSurf server computes conservation scores from a sequence or alignment and outputs a ready-to-open PyMOL session with colors already applied. Running it and then editing the colors and selections in PyMOL is a common and defensible workflow.

### Does this workflow work with AlphaFold Server predictions?

Yes. AlphaFold 3 outputs from the AlphaFold Server come as mmCIF files with per-residue pLDDT in the b-factor field, so the same backup, overwrite, and spectrum commands apply. For complexes, compute and map conservation one chain at a time against that chain's own reference sequence.

### Why do my residue numbers not match between the alignment and the structure?

AlphaFold DB models use UniProt canonical numbering, so any difference between your MSA reference and the canonical sequence, such as an isoform, a signal peptide, or an expression tag, creates an offset. Either use the canonical UniProt sequence as your MSA reference or apply the offset when writing scores.

### How do I make a publication-quality conservation figure?

Pin the color scale with explicit minimum and maximum values, ray trace at high resolution with `ray 2400, 1800`, export with `png file.png, dpi=300`, and state the palette and score range in the figure legend. Masking low pLDDT regions with transparency keeps readers from over-reading uncertain geometry.

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "Can PyMOL fetch AlphaFold models directly?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Yes, PyMOL 2.5 and newer can download AlphaFold DB models with fetch ACCESSION, type=alphafold, where ACCESSION is the UniProt identifier. Older versions should download the file from the AlphaFold DB website and load it with the load command instead."
      }
    },
    {
      "@type": "Question",
      "name": "How do I keep pLDDT values after coloring by conservation?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Copy them into the occupancy column before overwriting the b-factors, with alter all, q=b. After that, conservation lives in b, pLDDT lives in q, and both survive saving to PDB or CIF format."
      }
    },
    {
      "@type": "Question",
      "name": "How many sequences should my multiple sequence alignment contain?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Roughly 30 to 200 diverse homologs covering most of the protein length works well in practice. Fewer than about 20 makes scores noisy and inflated, while thousands of near-identical sequences flatten the signal through redundancy."
      }
    },
    {
      "@type": "Question",
      "name": "What does it mean when some residues stay gray in my figure?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Gray marks residues whose b-factor is below zero, which happens when the alignment gave those positions no score, usually because the reference residue was aligned to a gap or every homolog was gapped there. Check the alignment at those columns before drawing conclusions."
      }
    },
    {
      "@type": "Question",
      "name": "Can I use a web server instead of writing my own scoring script?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Yes. The ConSurf server computes conservation scores from a sequence or alignment and outputs a ready-to-open PyMOL session with colors already applied. You can open its output in PyMOL and adjust colors and selections as needed."
      }
    },
    {
      "@type": "Question",
      "name": "Does this workflow work with AlphaFold Server predictions?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Yes. AlphaFold 3 outputs from the AlphaFold Server are mmCIF files with per-residue pLDDT in the b-factor field, so the same backup, overwrite, and spectrum commands apply. For complexes, map conservation one chain at a time against that chain's own reference sequence."
      }
    },
    {
      "@type": "Question",
      "name": "Why do my residue numbers not match between the alignment and the structure?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "AlphaFold DB models use UniProt canonical numbering, so any difference between your MSA reference and the canonical sequence, such as an isoform, a signal peptide, or an expression tag, creates an offset. Use the canonical UniProt sequence as your MSA reference or apply the offset when writing scores."
      }
    },
    {
      "@type": "Question",
      "name": "How do I make a publication-quality conservation figure?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Pin the color scale with explicit minimum and maximum values, ray trace at high resolution with ray 2400, 1800, export with png file.png, dpi=300, and state the palette and score range in the figure legend. Masking low pLDDT regions with transparency keeps readers from over-reading uncertain geometry."
      }
    }
  ]
}
</script>