Functions | Variables
calculate_rmsd_kabsch Namespace Reference

Functions

def centroid (X)
 
def get_coordinates (filename, fmt)
 
def get_coordinates_pdb (filename)
 
def get_coordinates_xyz (filename)
 
def kabsch (P, Q)
 
def kabsch_rmsd (P, Q)
 
def kabsch_rotate (P, Q)
 
def main ()
 
def makeQ (r1, r2, r3, r4=0)
 
def makeW (r1, r2, r3, r4=0)
 
def quaternion_rmsd (P, Q)
 
def quaternion_rotate (X, Y)
 
def quaternion_transform (r)
 
def rmsd (V, W)
 
def write_coordinates (atoms, V, title="")
 

Variables

 __doc__ = \
 
string __version__ = '1.2.5'
 
 range = xrange
 

Function Documentation

def calculate_rmsd_kabsch.centroid (   X)
Calculate the centroid from a vectorset X.

https://en.wikipedia.org/wiki/Centroid
Centroid is the mean position of all the points in all of the coordinate
directions.

C = sum(X)/len(X)

Parameters
----------
X : array
    (N,D) matrix, where N is points and D is dimension.

Returns
-------
C : float
    centeroid

Definition at line 221 of file calculate_rmsd_kabsch.py.

def calculate_rmsd_kabsch.get_coordinates (   filename,
  fmt 
)
Get coordinates from filename in format fmt. Supports XYZ and PDB.

Parameters
----------
filename : string
    Filename to read
fmt : string
    Format of filename. Either xyz or pdb.

Returns
-------
atoms : list
    List of atomic types
V : array
    (N,3) where N is number of atoms

Definition at line 297 of file calculate_rmsd_kabsch.py.

def calculate_rmsd_kabsch.get_coordinates_pdb (   filename)
Get coordinates from the first chain in a pdb file
and return a vectorset with all the coordinates.

Parameters
----------
filename : string
    Filename to read

Returns
-------
atoms : list
    List of atomic types
V : array
    (N,3) where N is number of atoms

Definition at line 323 of file calculate_rmsd_kabsch.py.

def calculate_rmsd_kabsch.get_coordinates_xyz (   filename)
Get coordinates from filename and return a vectorset with all the
coordinates, in XYZ format.

Parameters
----------
filename : string
    Filename to read

Returns
-------
atoms : list
    List of atomic types
V : array
    (N,3) where N is number of atoms

Definition at line 405 of file calculate_rmsd_kabsch.py.

def calculate_rmsd_kabsch.kabsch (   P,
  Q 
)
The optimal rotation matrix U is calculated and then used to rotate matrix
P unto matrix Q so the minimum root-mean-square deviation (RMSD) can be
calculated.

Using the Kabsch algorithm with two sets of paired point P and Q, centered
around the centroid. Each vector set is represented as an NxD
matrix, where D is the the dimension of the space.

The algorithm works in three steps:
- a translation of P and Q
- the computation of a covariance matrix C
- computation of the optimal rotation matrix U

http://en.wikipedia.org/wiki/Kabsch_algorithm

Parameters
----------
P : array
    (N,D) matrix, where N is points and D is dimension.
Q : array
    (N,D) matrix, where N is points and D is dimension.

Returns
-------
U : matrix
    Rotation matrix (D,D)

Example
-----
TODO

Definition at line 77 of file calculate_rmsd_kabsch.py.

def calculate_rmsd_kabsch.kabsch_rmsd (   P,
  Q 
)
Rotate matrix P unto Q using Kabsch algorithm and calculate the RMSD.

Parameters
----------
P : array
    (N,D) matrix, where N is points and D is dimension.
Q : array
    (N,D) matrix, where N is points and D is dimension.

Returns
-------
rmsd : float
    root-mean squared deviation

Definition at line 32 of file calculate_rmsd_kabsch.py.

def calculate_rmsd_kabsch.kabsch_rotate (   P,
  Q 
)
Rotate matrix P unto matrix Q using Kabsch algorithm.

Parameters
----------
P : array
    (N,D) matrix, where N is points and D is dimension.
Q : array
    (N,D) matrix, where N is points and D is dimension.

Returns
-------
P : array
    (N,D) matrix, where N is points and D is dimension,
    rotated

Definition at line 52 of file calculate_rmsd_kabsch.py.

def calculate_rmsd_kabsch.main ( void  )

Definition at line 463 of file calculate_rmsd_kabsch.py.

def calculate_rmsd_kabsch.makeQ (   r1,
  r2,
  r3,
  r4 = 0 
)
matrix involved in quaternion rotation

Definition at line 181 of file calculate_rmsd_kabsch.py.

def calculate_rmsd_kabsch.makeW (   r1,
  r2,
  r3,
  r4 = 0 
)
matrix involved in quaternion rotation

Definition at line 169 of file calculate_rmsd_kabsch.py.

def calculate_rmsd_kabsch.quaternion_rmsd (   P,
  Q 
)
Rotate matrix P unto Q and calculate the RMSD

based on doi:10.1016/1049-9660(91)90036-O

Parameters
----------
P : array
    (N,D) matrix, where N is points and D is dimension.
P : array
    (N,D) matrix, where N is points and D is dimension.

Returns
-------
rmsd : float

Definition at line 135 of file calculate_rmsd_kabsch.py.

def calculate_rmsd_kabsch.quaternion_rotate (   X,
  Y 
)
Calculate the rotation

Parameters
----------
X : array
    (N,D) matrix, where N is points and D is dimension.
Y: array
    (N,D) matrix, where N is points and D is dimension.

Returns
-------
rot : matrix
    Rotation matrix (D,D)

Definition at line 193 of file calculate_rmsd_kabsch.py.

def calculate_rmsd_kabsch.quaternion_transform (   r)
Get optimal rotation
note: translation will be zero when the centroids of each molecule are the
same

Definition at line 157 of file calculate_rmsd_kabsch.py.

def calculate_rmsd_kabsch.rmsd (   V,
  W 
)
Calculate Root-mean-square deviation from two sets of vectors V and W.

Parameters
----------
V : array
    (N,D) matrix, where N is points and D is dimension.
W : array
    (N,D) matrix, where N is points and D is dimension.

Returns
-------
rmsd : float
    Root-mean-square deviation

Definition at line 246 of file calculate_rmsd_kabsch.py.

def calculate_rmsd_kabsch.write_coordinates (   atoms,
  V,
  title = "" 
)
Print coordinates V with corresponding atoms to stdout in XYZ format.

Parameters
----------
atoms : list
    List of atomic types
V : array
    (N,3) matrix of atomic coordinates
title : string (optional)
    Title of molecule

Definition at line 271 of file calculate_rmsd_kabsch.py.

Variable Documentation

calculate_rmsd_kabsch.__doc__ = \
private

Definition at line 2 of file calculate_rmsd_kabsch.py.

string calculate_rmsd_kabsch.__version__ = '1.2.5'
private

Definition at line 17 of file calculate_rmsd_kabsch.py.

calculate_rmsd_kabsch.range = xrange

Definition at line 27 of file calculate_rmsd_kabsch.py.



librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:50:35