Alignment Methods

alignment_method(func)

Decorator to add function to the superimpositions dictionary

Parameters:

func (callable) – Function that performs a alignment_method.

Return type:

Unmodified original function.

rosetta_alignment(N, CA, C)

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)

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 bisects the N->Ca->C angle.

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.

mmm_alignment(N, CA, C)

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)

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)

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 fit method, the rotamer ensemble must have a protein feature.

  • 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 fit arrays 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[_SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]]

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: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], method: str | callable = 'bisect') Tuple[_SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]]

Calculates a translation vector and rotation matrix to transform the 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.