Path B - Module 46: Geometric Transformations (Space)#

Molecular systems in a simulation box are often oriented randomly. For a technical report or for specific analysis (like measuring diffusion across a channel or orientation in a reactor), you need to control the position and rotation of your molecules manually.

In this module, you will learn to use the geometric engine of MolSysMT to arrange your engineered PETase in 3D space.

import molsysmt as msm
from molsysmt import systems
import numpy as np

# Load our complex
petase = msm.convert('pdb:6EQE', to_form='molsysmt.MolSys', selection='molecule_type=="protein"')
bhet = msm.convert('C1=CC(=CC=C1C(=O)OCCO)C(=O)OCCO', from_form='string:smiles', to_form='molsysmt.MolSys')
molsys = msm.merge([petase, bhet])

1. Centering at the Origin#

To simplify your coordinates, it is always a good idea to center the main enzyme at the origin (0,0,0).

# Center the protein at [0,0,0]
msm.structure.center(molsys, selection='molecule_type=="protein"', in_place=True)

new_center = msm.structure.get_center(molsys, selection='molecule_type=="protein"')
print(f"Enzyme center after transformation: {new_center}")

2. Manual Translation#

Let’s move the BHET substrate 3.0 nm away from the protein to simulate a “pre-binding” state.

# Move the substrate by a vector [3.0, 0.0, 0.0] nm
shift_vector = np.array([3.0, 0.0, 0.0]) * msm.pyunitwizard.unit('nm')
msm.structure.translate(molsys, selection='molecule_type=="small molecule"', translation=shift_vector, in_place=True)

print("BHET substrate translated 3nm along the X-axis.")

3. Rotating for Posing#

You can rotate a molecule around its own center or around an arbitrary axis. This is critical to explore how the plastic monomer enters the active site.

# Rotate the BHET 180 degrees around the Y axis and its own center
rotation = np.diag([-1.0, 1.0, -1.0])
rotation_center = msm.structure.get_center(molsys, selection='molecule_type=="small molecule"')
msm.structure.rotate(
    molsys, selection='molecule_type=="small molecule"', rotation=rotation,
    rotation_center=rotation_center, in_place=True
)

print("BHET substrate flipped 180 degrees.")
msm.view(molsys)

🏁 END OF PHASE 5: THE PHYSICS LAB#

Congratulations! You have mastered the environment and the dynamics of your biocatalyst. You have:

  1. Managed Boxes and PBC.

  2. Wrapped and Unwrapped coordinates.

  3. Calculated Energies and Forces.

  4. Minimized and Simulated at industrial temperatures in OpenMM.

  5. Translated, Rotated, and Centered your components in space.

Now, we enter the final stretch. In Phase 6: Pipeline Developer, we will learn how to handle Big Data trajectories and automate your engineering pipeline.