PCA on protein simulations: finding the signal in thousands of moving atoms
In my thesis post I mentioned using principal component analysis (PCA) to make sense of molecular dynamics data. This post goes into more detail.
The problem
A simulation of a protein with about a thousand residues produces coordinates for thousands of atoms at every frame. Most of that motion is small jitter. You want the few collective movements that actually differ between simulations.
What PCA does
PCA finds the directions along which your data varies the most, ordered from largest to smallest. Each direction is a principal component (PC). If the first two PCs capture a large share of the variance, plotting each frame by its PC1 and PC2 values gives a 2D map of the protein’s conformational space.
Choosing the input features
The choice of features matters more than the algorithm.
- Cartesian coordinates are simple, but need the trajectory aligned first, and the alignment choice affects the result.
- Pairwise distances between residues need no alignment and are not affected by overall rotation or translation. This is what I used for IRAP.
- Dihedral angles capture backbone and side-chain rotations and suit local changes.
Practical workflow
- Strip water and ions, and keep the atoms you care about (for example C-alpha atoms).
- Compute the features for every frame, for all simulations together.
- Fit PCA once on the combined data so every simulation is projected into the same space.
- Plot PC1 against PC2 and colour by simulation, replicate or time.
Fitting on the combined data is important. If you fit each simulation separately, the axes mean different things and the plots can’t be compared.
Reading the plot
- Overlapping clouds mean similar behaviour.
- Separated clouds mean different conformational states.
- Check replicates. If repeats of the same system land in different places, the difference between systems may be sampling noise.
- Look at what the PCs mean structurally by projecting the movement along PC1 back onto the protein.
Limitations
PCA is linear, so it can miss nonlinear motion. The result also depends on what you sampled: 100 ns simulations can only show the motions that happen in 100 ns. Treat the plot as a way to find differences worth investigating, not as proof of a mechanism.
PCA beyond simulations
The same idea works on any table of numbers. In our DNA-encoded library work, I used PCA on physicochemical properties of amino acid building blocks to map chemical space and find regions the library didn’t cover. The input is different (molecular properties instead of residue distances), but the logic is the same: compress many variables into a few axes, project new items into the same space, and look for gaps or separation.
Update: when the question is about activity, use PLS
PCA only looks at how the data varies, not at what you want to predict. In a later IRAP project on macrocyclic peptidomimetics, I wanted to link simulations to measured potency, so I used partial least squares (PLS) regression instead. PLS builds its axes to explain a target variable (here, binding affinity) rather than just variance.
The features were again distance-based. For each simulation snapshot I recorded which protein residues the ligand was in contact with (heavy atoms within 4 Å, filtered to potential hydrogen bonds and aromatic stacking), and fitted PLS to relate those contact patterns to activity. The model pointed to two arginines: sustained contact between the ligand’s C-terminal carboxylate and Arg929 went with lower potency, while contact with Arg439 went with higher potency. These are suggestions for design rather than proof, since the dataset is small and the energetic effect of each contact is hard to quantify. The details are in the paper: Håkansson, E. O.; Balestri, L. J. I.; Puthiyaparambath, S.; Moes, S.; et al. Novel macrocyclic peptidomimetics targeting the insulin-regulated aminopeptidase (IRAP): design, synthesis and evaluation. RSC Med. Chem. 2025, 16 (10), 5059–5069.
TODO: add the IRAP PCA figure and code snippet.