# RMSD worked examples

Data for the worked examples, Tables 1 to 3 and Figure 1 in the RMSD guide (`content/guides/rmsd.mdx`).

- `structures/`: mmCIF files downloaded unchanged from RCSB on October 11, 2026 (`https://files.rcsb.org/download/<ID>.cif.gz`). 1UBQ is the 1.8 Å crystal structure of human ubiquitin (Vijay-Kumar et al. 1987). 1D3Z is the 10-model NMR ensemble of ubiquitin (Cornilescu et al. 1998). 1IEP is mouse c-Abl kinase domain with imatinib, two copies, 2.1 Å (Nagar et al. 2002). 2HYY is human Abl kinase domain with imatinib, four copies, 2.4 Å (Cowan-Jacob et al. 2007).
- `vina_poses/`: the five imatinib poses from the public ProteinIQ AutoDock Vina example (https://proteiniq.io/app/autodock-vina?jobId=cge7gsamwpeuxmhkandolpdw), downloaded on October 11, 2026. Receptor 1IEP prepared without its ligand, ligand built from SMILES, Vina 1.2.7, Vina scoring, exhaustiveness 8, seed 42.
- `analyze.py`: computes every value in the guide and writes `summary.json`, `ubiquitin_models.csv`, `imatinib_pairs.csv` and `vina_redocking.csv`.

Run from this directory with numpy, gemmi and RDKit installed:

```bash
python -I analyze.py structures vina_poses
```

Method notes:

- Hydrogens and alternate conformations after the first are removed before any comparison. Protein atoms are paired by residue number and atom name.
- Superposition uses the Kabsch algorithm with a proper rotation (no reflection). Each RMSD is fitted on the atoms it measures unless stated otherwise.
- The symmetry-corrected heavy-atom value for ubiquitin swaps the names of equivalent side-chain atoms (Phe and Tyr ring carbons, Asp and Glu carboxylate oxygens, Arg NH1 and NH2) when that lowers the deviation.
- Ligand RMSDs use the 37 heavy atoms of imatinib. Crystal copies are compared after superposing the Cα atoms of binding-site residues (any heavy atom within 6 Å of the reference ligand); the ligand itself is not fitted. Symmetry-corrected values are the minimum over the four graph automorphisms of imatinib (RDKit `CalcRMS` for crystal pairs and an explicit enumeration for the Vina poses, which agree).
- Vina poses are compared in the receptor frame against the 1IEP copy whose pocket they occupy (chain A for all five), with no fitting. `rmsd_after_ligand_fit` fits the pose onto the crystal ligand first and is shown only to illustrate why that is the wrong measure for docking.

PDB data are available under CC0 1.0 from the RCSB Protein Data Bank.
