moleculekit.tools.mutate module#
Side-chain reconstruction for residue mutation.
- Rotamer library data from:
Shapovalov & Dunbrack (2011) “A Smoothed Backbone-Dependent Rotamer Library for Proteins Derived from Adaptive Kernel Density Estimates and Regressions.” Structure 19(6):844-858. Licensed under Creative Commons CC BY 4.0.
- moleculekit.tools.mutate.mutate_residue(mol, sel, newres, rotamer_mode='best', minimize=False)#
Mutate a residue, fully reconstructing the side-chain.
The mutation proceeds in up to three phases:
Kabsch superposition – the ideal template for newres is aligned onto the existing backbone (N, CA, C) atoms.
Rotamer selection – the Dunbrack backbone-dependent rotamer library is queried using the residue’s phi/psi angles, and the best rotamer (lowest VdW clash energy with surroundings) is selected.
Optional OpenMM minimization – if minimize is True and OpenMM is installed, a soft-potential energy minimization gently resolves remaining clashes.
- Parameters:
mol (Molecule) – The molecule to mutate (modified in place).
sel (str) – Atom selection string identifying a single residue.
newres (str) – 3-letter code of the target residue (e.g.
"ARG"). Protonation variants such as"HID","HIE","HIP","CYX","ASH","GLH","LYN"etc. are also accepted – the heavy-atom geometry is taken from the parent residue and the requested name is preserved. The non-standard natural amino acids"SEC"(selenocysteine) and"PYL"(pyrrolysine) and the modified amino acids"MSE","MLZ","MLY","M3L","SEP","TPO"and"PTR"are also supported – they use their own CIF templates but reuse their parent residue’s rotamer library entries.rotamer_mode (str, optional) –
"best"(lowest clash energy, default),"first"(highest probability), or"random"(sampled by probability).minimize (bool, optional) – If True, run soft-potential OpenMM minimization after rotamer placement. Requires OpenMM. Default False.