Structure.rigid_transform#

Structure.rigid_transform(rotation_matrix, translation, use_geometric_center=False)[source]#

Performs a rigid transform of internal structure coordinates.

Parameters:
rotation_matrixNDArray

The rotation matrix to apply to the coordinates.

translationNDArray

The vector to translate the coordinates by.

use_geometric_centerbool, optional

Whether to use geometric or coordinate center.

Returns:
Structure

The transformed instance of Structure.

Examples

>>> from importlib_resources import files
>>> from tme import Structure
>>> from tme.matching_utils import get_rotation_matrices
>>> fname = str(files("tests.data").joinpath("Structures/5khe.cif"))
>>> structure = Structure.from_file(filename=fname)
>>> structure.rigid_transform(
>>>     rotation_matrix = get_rotation_matrices(60)[2],
>>>     translation = (0, 1, -5)
>>> )