Bio.PDB.qcprot module
Structural alignment using Quaternion Characteristic Polynomial (QCP).
QCPSuperimposer finds the best rotation and translation to put two point sets on top of each other (minimizing the RMSD). This is eg. useful to superimpose crystal structures. QCP stands for Quaternion Characteristic Polynomial, which is used in the algorithm.
Algorithm and original code described in:
Theobald DL. Rapid calculation of RMSDs using a quaternion-based characteristic polynomial. Acta Crystallogr A. 2005 Jul;61(Pt 4):478-80. doi: 10.1107/S0108767305015266. Epub 2005 Jun 23. PMID: 15973002.
- Bio.PDB.qcprot.qcp(coords1, coords2, natoms)
Implement the QCP code in Python.
Input coordinate arrays must be centered at the origin and have shape Nx3.
Variable names match (as much as possible) the C implementation.
- class Bio.PDB.qcprot.QCPSuperimposer
Bases:
object
Quaternion Characteristic Polynomial (QCP) Superimposer.
QCPSuperimposer finds the best rotation and translation to put two point sets on top of each other (minimizing the RMSD). This is eg. useful to superimposing 3D structures of proteins.
QCP stands for Quaternion Characteristic Polynomial, which is used in the algorithm.
Reference:
Douglas L Theobald (2005), “Rapid calculation of RMSDs using a quaternion-based characteristic polynomial.”, Acta Crystallogr A 61(4):478-480
- __init__()
Initialize the class.
- set_atoms(fixed, moving)
Prepare alignment between two atom lists.
Put (translate/rotate) the atoms in fixed on the atoms in moving, in such a way that the RMSD is minimized.
- Parameters
fixed – list of (fixed) atoms
moving – list of (moving) atoms
- apply(atom_list)
Apply the QCP rotation matrix/translation vector to a set of atoms.
- set(reference_coords, coords)
Set the coordinates to be superimposed.
coords will be put on top of reference_coords.
reference_coords: an NxDIM array
coords: an NxDIM array
DIM is the dimension of the points, N is the number of points to be superimposed.
- run()
Superimpose the coordinate sets.
- get_transformed()
Get the transformed coordinate set.
- get_rotran()
Return right multiplying rotation matrix and translation vector.
- get_init_rms()
Return the root mean square deviation of untransformed coordinates.
- get_rms()
Root mean square deviation of superimposed coordinates.