Blog
How to Align and Superimpose Two Protein Structures in PyMOL (align, super and cealign): A Step-by-Step Guide
- July 27, 2026
- Posted by: Stem Skills Lab
- Category: Molecular Modeling

To superimpose two proteins in PyMOL, load both structures, then run one command: align for near-identical sequences, super for moderately different sequences, or cealign for different folds and very low sequence identity. Each moves the first (mobile) object onto the second (target) and prints the RMSD and the number of atoms it fitted.
You predicted a structure with AlphaFold or built a homology model, and now you need to know how close it is to the experimental structure. PyMOL gives you three superposition commands, and picking the wrong one is the difference between a clean overlay and a confusing error or an inflated RMSD. This guide from the StemSkills Lab team shows you exactly which command to run, how to read the numbers PyMOL reports, and how to fix the two errors that trip up almost every beginner.
What is the difference between align, super and cealign in PyMOL?
All three commands rotate and translate one structure onto another so you can compare them, but they differ in how they decide which atoms correspond. align starts from a sequence alignment, super and cealign work from the 3D structure and ignore sequence. That single distinction decides which one you should use.
PyMOL’s own documentation describes align as performing “a sequence alignment followed by a structural superposition,” then running refinement cycles that reject the atom pairs fitting worst. Because it begins with sequence, align is most accurate when the two proteins are the same or nearly the same protein. super uses a sequence-independent, structure-based algorithm, so it still works when the sequences have drifted apart. cealign implements the Combinatorial Extension (CE) algorithm of Shindyalov and Bourne, which was designed to align proteins that share a fold but almost no sequence identity.
| Command | Works from | Best when | Rejects outliers? | Argument order |
|---|---|---|---|---|
align | Sequence, then structure | Same protein or >~30% sequence identity | Yes (5 cycles, 2.0 Å cutoff by default) | mobile, target |
super | Structure (sequence-independent) | Moderate identity, sequences have diverged | Yes | mobile, target |
cealign | Structure (CE algorithm) | Low identity, different or distant folds | No refinement cycles by default | target, mobile |
Notice the last column. align and super take the moving object first, but cealign takes the target first. Swapping this order is one of the most common beginner mistakes, and we return to it in the troubleshooting section.
How do you superimpose two proteins in PyMOL step by step?
Here is a complete, reproducible worked example using two crystal structures of hen egg-white lysozyme, which share an essentially identical sequence, so align is the right choice. Type each line into the PyMOL command bar (the black box at the top of the viewer).
- Fetch both structures straight from the RCSB Protein Data Bank:
fetch 6lyz, async=0fetch 1lyz, async=0
- Superimpose the first onto the second:
align 6lyz, 1lyz - Read the RMSD that PyMOL prints to the log (covered in the next section).
- Tidy the view so the overlap is obvious:
hide everythingthenshow cartoon.
The async=0 flag tells PyMOL to finish downloading before running the next line, which matters when you paste several commands at once. After align, the mobile object 6lyz has been physically moved on top of 1lyz; the coordinates of 1lyz never change.
When you want to compare an AlphaFold model against a crystal structure, download the model from the AlphaFold Protein Structure Database and load the file, for example load AF-P00698-F1-model_v4.pdb, af_lysozyme. Because a predicted model can differ from the crystal in flexible loops, reach for super or cealign rather than align:
super af_lysozyme, 6lyz(mobile first), orcealign 6lyz, af_lysozyme(target first).
Want the guided, hands-on version?
Our live Molecular Modeling & MD Simulations cohort bootcamp takes you from zero to running real docking and MD workflows, with a portfolio project for your grad-school applications.
How do you read the RMSD and atom count PyMOL reports?
After any of the three commands, PyMOL writes an Executive line to the log, in the form Executive: RMSD = <value> (<n> to <n> atoms). The value is the root-mean-square deviation in ångströms between the paired atoms, and the atom count tells you how many pairs were actually used in the final fit. Both numbers matter: a small RMSD over a handful of atoms is not the same as a small RMSD over the whole chain.
The align command also returns a seven-value list you can capture in a script: the RMSD after refinement, the number of aligned atoms after refinement, the number of refinement cycles, the RMSD before refinement, the number of aligned atoms before refinement, the raw alignment score, and the number of aligned residues. Comparing the “before” and “after” RMSD shows you how much work the outlier rejection did. cealign instead returns a dictionary containing RMSD and alignment_length, so in a script you would read result['RMSD'].
As a rough guide, two structures of the same protein usually superpose below 1 Å, and proteins sharing a fold typically fall within a few ångströms. If your RMSD is far higher than expected, do not assume the model is wrong. First check that the atom count is sensible and that you compared the chains you intended. That check is exactly what the troubleshooting section covers.
Which command should you use when the sequences differ?
Match the command to how similar the two sequences are. Above roughly 30% sequence identity, a sequence alignment is reliable, so align gives the cleanest result. Below that level you enter what structural biologists call the “twilight zone,” where sequence alignment becomes unreliable, and a structure-based method wins. Use super for the middle ground and cealign when identity is very low or when you are comparing different folds entirely.
A practical workflow: try align first. If it reports “0 atoms aligned” or a suspiciously high RMSD, switch to super. If super still struggles, use cealign, which copes best with distant relationships because the CE algorithm builds the alignment from local structural fragments rather than from sequence at all.
How do you colour and save the superposed structures?
Once the two objects overlap, colour them distinctly so the differences read at a glance, then export. A typical finishing sequence:
color cyan, 6lyzandcolor salmon, 1lyzto give each structure its own colour.show cartoonandhide linesfor a clean ribbon view.orientto centre and zoom on both objects.ray 1200, 900thenpng superposition.png, dpi=300to save a publication-quality image.save superposed.pseto keep the full session, orsave moved_6lyz.pdb, 6lyzto export the moved coordinates for downstream docking or MD.
Saving the moved object as a fresh PDB is important when the superposition is a preparation step, for example placing a predicted model into the same frame of reference as a known complex before you set up a computational biology skills roadmap project such as docking or a simulation.
How do you fix common PyMOL alignment errors?
“ExecutiveAlign: 0 atoms aligned” or “RMSD = 0.000 over 0 atoms.” This almost always means PyMOL found no atom pairs to fit. The usual causes and fixes:
- Wrong object names. Run
get_namesto list the exact loaded object names and use those. A typo produces zero atoms. - Sequences too different for
align. If a sequence alignment finds nothing to match, switch tosuperorcealign, which do not rely on sequence. - Selections that do not overlap. If you aligned specific selections such as
chain Aagainstchain B, confirm both selections contain atoms withcount_atoms. - Wrong argument order for
cealign. Remembercealigniscealign target, mobile, the reverse ofalignandsuper. Passing them inalignorder can give confusing results.
RMSD looks far too high. A large RMSD usually means the fit included pairs it should not have, or you compared the wrong parts of the two proteins:
- Compare like with like. Restrict the fit to matching chains, for example
align 6lyz and chain A, 1lyz and chain A. - Multi-state objects. An NMR ensemble or a trajectory has many states. Fit a single state with the
mobile_stateandtarget_statearguments so PyMOL does not average across models. - Let the refinement work. With
align, the default 5 cycles and 2.0 Å cutoff reject outliers; if you setcycles=0you keep every pair, which inflates the RMSD. Restore the default cycles, or move tocealign, whose CE approach is less sensitive to flexible regions. - Backbone versus all atoms. Long flexible side chains and disordered loops raise the number. Superpose on the C-alpha backbone when you only care about the fold.
Related questions students ask
Does align move both structures or just one? Only the first (mobile) object moves. The target keeps its original coordinates, which is why you should pass the structure you want to keep fixed as the second argument.
Can I superimpose more than two structures at once? Not with a single align call. Superpose each structure onto one common reference in turn, or script a loop that aligns every object to the reference.
FAQ
Is align or super better for an AlphaFold model versus a crystal structure? Use super or cealign. AlphaFold models often differ from the crystal in flexible loops and termini, and the sequence-independent methods handle those differences more gracefully than the sequence-first align.
What RMSD counts as a good superposition? There is no universal cutoff, but two structures of the same protein commonly fall below 1 Å, and proteins with the same fold usually land within a few ångströms. Always read the RMSD together with the atom count, because a low RMSD over very few atoms is not meaningful.
Why does cealign use a different argument order? It is simply how the command was written: cealign target, mobile. Keep a note of it, because mixing it up with the align and super order (mobile first) is the most frequent cause of a puzzling result.
Do I need the same number of residues in both proteins? No. All three commands align only the residues that correspond, so proteins of different lengths superpose fine. The reported atom count tells you how many were actually matched.
How do I superpose only the binding site instead of the whole protein? Pass selections to the command, for example super modelA and resi 40-95, ref and resi 40-95. Restricting the fit to the region you care about often gives a more meaningful RMSD than fitting the entire chain.
Superposition is the first move in almost every structural comparison, from validating a predicted model to setting up a docking run. For the full learning path from structure basics through docking and molecular dynamics, see the StemSkills Lab computational biology skills roadmap.
Want the guided, hands-on version?
Our live Molecular Modeling & MD Simulations cohort bootcamp takes you from zero to running real docking and MD workflows, with a portfolio project for your grad-school applications.
Written by the StemSkills Lab team, with more than 10 years of combined experience in sequence and structural bioinformatics, drug discovery and design, and multiscale molecular modeling. Command references follow the official PyMOL documentation; the CE method behind cealign is described in Shindyalov & Bourne, “Protein structure alignment by incremental combinatorial extension (CE) of the optimal path,” Protein Engineering (1998) 11(9):739-747.