Alignment Methods
- alignment_method(func)[source]
Decorator to add function to the alignment methods dictionary.
- Parameters:
func (callable) – Function that performs a alignment_method.
- Return type:
Unmodified original function.
- rosetta_alignment(N, CA, C)[source]
Calculates a rotation matrix and translation to transform an amino acid from the local coordinate frame to the global coordinate frame for a given residue with backbone coordinates (N, C, CA). Principal axis is the C->Ca Bond.
- Parameters:
N (numpy.ndarray (1x3)) – Backbone nitrogen coordinates.
CA (numpy.ndarray (1x3)) – Backbone alpha carbon coordinates.
C (numpy.ndarray (1x3)) – Backbone carbonyl carbon coordinates.
- Returns:
rotation_matrix (numpy ndarray (3x3)) – Rotation matrix to rotate spin label to achieve the correct orientation.
origin (numpy.ndarray (1x3)) – New origin position in 3-dimensional space.
- bisect_alignment(N, CA, C)[source]
Calculates the rotation matrix and translation to transform an amino acid from the local coordinate frame to the global coordinate frame for a given residue with backbone coordinates (N, C, CA). The principal z axis bisects the N-CA-C angle, and y is in the N-CA-C plane perpendicular to z, approximately pointing from C to N.
- Parameters:
N (numpy.ndarray (1x3)) – Backbone nitrogen coordinates.
CA (numpy.ndarray (1x3)) – Backbone alpha carbon coordinates.
C (numpy.ndarray (1x3)) – Backbone carbonyl carbon coordinates.
- Returns:
rotation_matrix (numpy .darray (3x3)) – Rotation matrix to rotate spin label to achieve the correct orientation.
origin (numpy.ndarray (1x3)) – New origin position in 3-dimensional space.
- mmm_alignment(N, CA, C)[source]
Calculates a rotation matrix and translation to transform an amino acid from the local coordinate frame to the global coordinate frame for a given residue with backbone coordinates (N, C, CA). Principal axis is defined along the CA->N bond.
- Parameters:
N (numpy.ndarray (1x3)) – Backbone nitrogen coordinates.
CA (numpy.ndarray (1x3)) – Backbone alpha carbon coordinates.
C (numpy.ndarray (1x3)) – Backbone carbonyl carbon coordinates.
- Returns:
rotation_matrix (numpy ndarray (3x3)) – Rotation matrix to rotate spin label to achieve the correct orientation.
origin (numpy.ndarray (1x3)) – New origin position in 3-dimensional space.
- fit_alignment(N, CA, C)[source]
Superimpose the residues such that the root mean squared deviation of the backbone atoms is minimized.
- Parameters:
N (numpy.ndarray (2x3)) – Backbone nitrogen coordinates.
CA (numpy.ndarray (2x3)) – Backbone alpha carbon coordinates.
C (numpy.ndarray (2x3)) – Backbone carbonyl carbon coordinates.
- Returns:
rotation_matrix (numpy ndarray (3x3)) – Rotation matrix to rotate spin label to achieve the correct orientation.
origin (numpy.ndarray (1x3)) – New origin position in 3-dimensional space.
- parse_backbone(rotamer_ensemble, kind)[source]
Extract appropriate backbone information to make a rotation matrix using the method provided
- Parameters:
rotamer_ensemble (RotamerEnsemble) – The RotamerEnsemble object that the rotation matrix will operate on. If using the
fitmethod, the rotamer ensemble must have aproteinfeature.kind (str) – Specifies if the backbone is for the rotamer ensemble (local) or the protein (global)
- Returns:
N, CA, C – Numpy arrays of N, CA and C coordinates of the rotamer ensemble backbone. If using method
fitarrays are 2x3 with the first coordinate as the rotamer ensemble backbone and the second as the protein site backbone.- Return type:
tuple
- local_mx(*p, method: str | callable = 'bisect') Tuple['ArrayLike', 'ArrayLike'][source]
Calculates a translation vector and rotation matrix to transform a set of coordinates from the global coordinate frame to a local coordinate frame defined by
p, using the specified method.- Parameters:
p (ArrayLike) – 3D coordinates of the three points defining the coordinate system (Usually N, CA, C).
method (str, callable) – Method to use for generation of rotation matrix
- Returns:
origin (np.ndarray) – Cartesian coordinate of the origin to be subtracted from the coordinates before applying the rotation matrix.
rotation_matrix (np.ndarray) – Rotation matrix to transform a set of coordinates to the local frame defined by p and the selected method.
- global_mx(*p: ArrayLike, method: str | callable = 'bisect') Tuple['ArrayLike', 'ArrayLike'][source]
Calculates a translation vector and rotation matrix to transform a set of coordinates from the local coordinate frame to the global coordinate frame using the specified method.
- Parameters:
p (ArrayLike) – 3D coordinates of the three points used to define the new coordinate system (Usually N, CA, C)
method (str) – Method to use for generation of rotation matrix
- Returns:
rotation_matrix (np.ndarray) – Rotation matrix to be applied to the set of coordinates before translating
origin (np.ndarray) – Vector to be added to the coordinates after rotation to translate the coordinates to the global frame.
- ligand_alignment_method(func)[source]
Decorator to add function to the ligand alignment method dictionary
- Parameters:
func (callable) – Function that performs a alignment_method.
- Return type:
Unmodified original function.
- svd_alignment(target_points: ArrayLike) Tuple['ArrayLike', 'ArrayLike'][source]
Obtain the rotation and translation operations to align the principal components of arbitrary point cloud. This function is vectorized to obtain the rotation and translation operations for a set of point clouds.
- Parameters:
target_points (ArrayLike) – Target point cloud to be aligned.
- Returns:
rotations (np.ndarray) – Array of rotation matrices (N x 3 x 3) where N is the number of point clouds in target points.
origins (np.ndarray) – Array of translation vectors that constitute the origin of the point clouds. The dimension are (N x 3) where N is the number of point clouds in target points.
- linear_alignment(mobile_points, target_points)[source]
Vectorized implementation of the Kabsch algorithm to determine rotation and translation operations to align one point cloud to another. This algorithm assumes that the
mobile_pointsandtarget_pointsare sorted. i.e. The Nth point ofmobile_pointscorresponds to the Nth point oftarget_points.- Parameters:
mobile_points (ArrayLike) – Set of points to be moved to align to
target_points. Vectorized to allow for the alignment of multiple sets of points.target_points (ArrayLike) – Target point cloud to be aligned.Not vectorized, only one set of points is allowed.
- Returns:
rotations (np.ndarray) – Array of rotation matrices (N x 3 x 3) where N is the number of point clouds in target points.
origins (np.ndarray) – Array of translation vectors that constitute the origin of the point clouds. The dimension are (N x 3) where N is the number of point clouds in target points.
- align_points(mobile_points, target_points)[source]
Non-vectorized Implementation of the Kabsch algorithm to align to sets of points. This algorithm assumes that the
mobile_pointsandtarget_pointsare sorted. i.e. The Nth point ofmobile_pointscorresponds to the Nth point oftarget_points.- Parameters:
mobile_points (ArrayLike) – Set of points to be moved to align to
target_points.target_points (ArrayLike) – Target point cloud to be aligned to.
- Returns:
new_points –
mobile_pointstranslated and rotated to be aligned totarget_points.- Return type:
ArrayLike