Package generic_fns :: Package structure :: Module superimpose
[hide private]
[frames] | no frames]

Module superimpose

source code

Module for handling all types of structural superimpositions.

Classes [hide private]
  Pivot_finder
Class for finding the optimal pivot point for motions between the given models.
Functions [hide private]
 
atomic_rmsd(coord)
Determine the RMSD for the given atomic coordinates.
source code
 
calc_mean_structure(coord=None, mean=None)
Average the coordinates.
source code
numpy rank-1, 3D array
find_centroid(coords)
Calculate the centroid of the structural coordinates.
source code
list of numpy rank-1 3D arrays, list of numpy rank-2 3D arrays, list of numpy rank-1 3D arrays
fit_to_first(models=None, coord=None, centroid=None)
Superimpose a set of structural models using the fit to first algorithm.
source code
list of numpy rank-1 3D arrays, list of numpy rank-2 3D arrays, list of numpy rank-1 3D arrays
fit_to_mean(models=None, coord=None, centroid=None, verbosity=1)
Superimpose a set of structural models using the fit to first algorithm.
source code
numpy rank-1 3D array, float, numpy rank-2 3D array, numpy rank-1 3D array, float, numpy rank-1 3D array
kabsch(name_from=None, name_to=None, coord_from=None, coord_to=None, centroid=None, verbosity=1)
Calculate the rotational and translational displacements between the two given coordinate sets.
source code
numpy rank-2, 3D array
kabsch_rotation(coord_from=None, coord_to=None, centroid_from=None, centroid_to=None)
Calculate the rotation via SVD.
source code
Variables [hide private]
  __package__ = 'generic_fns.structure'

Imports: deepcopy, pi, diag, dot, eye, float64, outer, sign, sqrt, transpose, zeros, det, norm, svd, R_to_axis_angle


Function Details [hide private]

atomic_rmsd(coord)

source code 

Determine the RMSD for the given atomic coordinates.

This is the per atom RMSD to the mean structure.

Parameters:
  • coord (rank-3 numpy array) - The array of molecular coordinates. The first dimension corresponds to the model, the second the atom, the third the coordinate.

calc_mean_structure(coord=None, mean=None)

source code 

Average the coordinates.

Parameters:
  • coord (list of numpy rank-2, Nx3 arrays) - The list of coordinates of all models to superimpose. The first index is the models, the second is the atomic positions, and the third is the xyz coordinates.
  • mean (numpy rank-2, Nx3 array) - The data storage for the mean structure.

find_centroid(coords)

source code 

Calculate the centroid of the structural coordinates.

Parameters:
  • coord (numpy rank-2, Nx3 array) - The atomic coordinates.
Returns: numpy rank-1, 3D array
The centroid.

fit_to_first(models=None, coord=None, centroid=None)

source code 

Superimpose a set of structural models using the fit to first algorithm.

Parameters:
  • models (list of int) - The list of models to superimpose.
  • coord (list of numpy rank-2, Nx3 arrays) - The list of coordinates of all models to superimpose. The first index is the models, the second is the atomic positions, and the third is the xyz coordinates.
  • centroid (list of float or numpy rank-1, 3D array) - An alternative position of the centroid to allow for different superpositions, for example of pivot point motions.
Returns: list of numpy rank-1 3D arrays, list of numpy rank-2 3D arrays, list of numpy rank-1 3D arrays
The lists of translation vectors, rotation matrices, and rotation pivots.

fit_to_mean(models=None, coord=None, centroid=None, verbosity=1)

source code 

Superimpose a set of structural models using the fit to first algorithm.

Parameters:
  • models (list of int) - The list of models to superimpose.
  • coord (list of numpy rank-2, Nx3 arrays) - The list of coordinates of all models to superimpose. The first index is the models, the second is the atomic positions, and the third is the xyz coordinates.
  • centroid (list of float or numpy rank-1, 3D array) - An alternative position of the centroid to allow for different superpositions, for example of pivot point motions.
  • verbosity (int) - The amount of information to print out. If 0, nothing will be printed.
Returns: list of numpy rank-1 3D arrays, list of numpy rank-2 3D arrays, list of numpy rank-1 3D arrays
The lists of translation vectors, rotation matrices, and rotation pivots.

kabsch(name_from=None, name_to=None, coord_from=None, coord_to=None, centroid=None, verbosity=1)

source code 

Calculate the rotational and translational displacements between the two given coordinate sets.

This uses the Kabsch algorithm (http://en.wikipedia.org/wiki/Kabsch_algorithm).

Parameters:
  • name_from (str) - The name of the starting structure, used for the print outs.
  • name_to (str) - The name of the ending structure, used for the print outs.
  • coord_from (numpy rank-2, Nx3 array) - The list of atomic coordinates for the starting structure.
  • coord_to (numpy rank-2, Nx3 array) - The list of atomic coordinates for the ending structure.
  • centroid (list of float or numpy rank-1, 3D array) - An alternative position of the centroid, used for studying pivoted systems.
Returns: numpy rank-1 3D array, float, numpy rank-2 3D array, numpy rank-1 3D array, float, numpy rank-1 3D array
The translation vector T, translation distance d, rotation matrix R, rotation axis r, rotation angle theta, and the rotational pivot defined as the centroid of the ending structure.

kabsch_rotation(coord_from=None, coord_to=None, centroid_from=None, centroid_to=None)

source code 

Calculate the rotation via SVD.

Parameters:
  • coord_from (numpy rank-2, Nx3 array) - The list of atomic coordinates for the starting structure.
  • coord_to (numpy rank-2, Nx3 array) - The list of atomic coordinates for the ending structure.
  • centroid_from (numpy rank-1, 3D array) - The starting centroid.
  • centroid_to (numpy rank-1, 3D array) - The ending centroid.
Returns: numpy rank-2, 3D array
The rotation matrix.