src.quatfit (28 February 2006)
index
/Users/baker/Desktop/pdb2pqr/trunk/pdb2pqr/src/quatfit.py

Quatfit routines for PDB2PQR
 
This module is used to find the coordinates of a new
atom based on a reference set of
coordinates and a definition set of coordinates.
 
Original Code by David J. Heisterberg
The Ohio Supercomputer Center
1224 Kinnear Rd.
Columbus, OH  43212-1163
(614)292-6036
djh@osc.edu    djh@ohstpy.bitnet    ohstpy::djh
 
Translated to C from fitest.f program and interfaced with
Xmol program by Jan Labanowski,  jkl@osc.edu   jkl@ohstpy.bitnet
ohstpy::jkl
 
----------------------------
 
PDB2PQR -- An automated pipeline for the setup, execution, and analysis of
Poisson-Boltzmann electrostatics calculations
 
    Copyright (c) 2002-2007, Jens Erik Nielsen, University College Dublin; 
    Nathan A. Baker, Washington University in St. Louis; Paul Czodrowski & 
    Gerhard Klebe, University of Marburg
 
    All rights reserved.
 
    Redistribution and use in source and binary forms, with or without modification, 
    are permitted provided that the following conditions are met:
 
            * Redistributions of source code must retain the above copyright notice, 
              this list of conditions and the following disclaimer.
            * Redistributions in binary form must reproduce the above copyright notice, 
              this list of conditions and the following disclaimer in the documentation 
              and/or other materials provided with the distribution.
            * Neither the names of University College Dublin, Washington University in 
              St. Louis, or University of Marburg nor the names of its contributors may 
              be used to endorse or promote products derived from this software without 
              specific prior written permission.
 
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
    ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
    IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
    BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 
    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 
    OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
    OF THE POSSIBILITY OF SUCH DAMAGE.
 
----------------------------

 
Modules
       
math
os
string
sys

 
Functions
       
center(numpoints, refcoords)
Center a molecule using equally weighted points
 
Parameters
    numpoints: Number of points
    refcoords: List of reference coordinates, with each set
               a list of form [x,y,z] (list)
Returns
    refcenter: Center of the set of points (list)
    relcoords: Moved refcoords relative to refcenter (list)
findCoordinates(numpoints, refcoords, defcoords, defatomcoords)
Driver for the quaternion file.  Provide the coordinates as inputs
and obtain the coordinates for the new atom as output.
 
Parameters
    numpoints:     The number of points in each list (int)
    refcoords:     The reference coordinates, a list of lists of form
                   [x,y,z] (list)
    defcoords:     The definition coordinates, a list of lists of form
                   [x,y,z] (list)
    defatomcoords: The definition coordinates for the atom to be
                   placed in the reference frame (list)
Returns
    newcoords:     The coordinates of the new atom in the
                   reference frame (list)
jacobi(a, nrot)
Jacobi diagonalizer with sorted output, only good for 4x4 matrices
 
Parameters
    a:    Matrix to diagonalize (4x4 list)
    nrot: Maximum number of sweeps
Returns
    d:    Eigenvalues
    v:    Eigenvectors
q2mat(q)
Generate a left rotation matrix from a normalized quaternion
 
Parameters
    q:  The normalized quaternion (list)
Returns
    u:  The rotation matrix (2-dimensional list)
qchichange(initcoords, refcoords, angle)
Change the chiangle of the reference coordinate using the
initcoords and the given angle
 
Parameters
    initcoords: Coordinates based on the point and basis atoms
                (one dimensional list)
    difchi    : The angle to use (float)
    refcoords : The atoms to analyze (list of many coordinates)
Returns
    newcoords : The new coordinates of the atoms (list of many coords)
qfit(numpoints, refcoords, defcoords)
Method for getting new atom coordinates from sets of reference
and definition coordinates.
 
Parameters
    numpoints: The number of points in each list (int)
    refcoords: List of reference coordinates, with each set
               a list of form [x,y,z] (list)
    defcoords: List of definition coordinates, with each set
               a list of form [x,y,z] (list)
qtransform(numpoints, defcoords, refcenter, fitcenter, rotation)
Transform the set of defcoords using the reference center, the fit
center, and a rotation matrix.
 
Parameters
    numpoints: The number of points in each list (int)
    defcoords: Definition coordinates (list)
    refcenter: The reference center (list)
    defcenter: The definition center (list)
    rotation:  The rotation matrix (list)
Returns
    newcoords: The coordinates of the new point (list)
qtrfit(numpoints, defcoords, refcoords, nrot)
Find the quaternion, q, [and left rotation matrix, u] that minimizes
    | qTXq - Y | ^ 2 [|uX - Y| ^ 2]
This is equivalent to maximizing Re (qTXTqY)
The left rotation matrix, u, is obtained from q by
    u = qT1q
 
Parameters
    numpoints: The number of points in each list (int)
    defcoords: List of definition coordinates, with each set
               a list of form [x,y,z] (list)
    refcoords: List of fitted coordinates, with each set
               a list of form [x,y,z] (list)
    nrot     : The maximum number of jacobi sweeps
Returns
    q        : The best-fit quaternion
    u        : The best-fit left rotation matrix
rotmol(numpoints, x, u)
Rotate a molecule
 
Parameters
    numpoints:  The number of points in the list (int)
    x:          The input coordinates (list)
    u:          The left rotation matrix (list)
Returns
    out:        The rotated coordinates out=u * x (list)
translate(numpoints, refcoords, center, mode)
Translate a molecule using equally weighted points
 
Parameters
    numpoints: Number of points
    refcoords: List of reference coordinates, with each set
               a list of form [x,y,z] (list)
    center:    Center of the system(list)
    mode:      If 1, center will be subtracted from refcoords
               If 2, center will be added to refcoords
Returns
    relcoords: Moved refcoords relative to refcenter (list)

 
Data
        DIHEDRAL = 57.2958
SMALL = 9.9999999999999995e-08
__author__ = 'David Heisterberg, Jan Labanowski, Jens Erik Nielsen, Todd Dolinsky'
__date__ = '28 February 2006'

 
Author
        David Heisterberg, Jan Labanowski, Jens Erik Nielsen, Todd Dolinsky