Flip#
Flipping a molecular system over a specified plane or normal vector.
The function molsysmt.structure.flip() reflects the coordinates of a molecular system over a plane defined by an anchor point and a normal vector.
Added in version 1.0.0.
API documentation
Follow this link for a detailed description of the input arguments, raised errors, and returned objects of this function: molsysmt.structure.flip().
Basic usage#
Let’s show how to flip a POPC lipid molecule across a plane passing through the origin. We first orient its longest principal axis along the vertical \(y\)-axis using molsysmt.structure.align_principal_axes() and center it on its phosphorus atom:
import molsysmt as msm
import numpy as np
crd = msm.systems['POPC']['popc.crd']
psf = msm.systems['POPC']['popc.psf']
molsys = msm.convert([crd, psf], to_form='molsysmt.MolSys')
molsys = msm.structure.align_principal_axes(molsys, axes=[[0, 1, 0], [0, 0, 1], [1, 0, 0]])
molsys = msm.structure.center(molsys, selection='all', center_of_selection='atom_name=="P"')
Note
Demo Systems Catalog
This tutorial uses demonstration datasets provided by MolSysMT. To explore the full catalog of bundled systems, forms, and file paths, visit the Demo Systems guide.
We inspect the initial 3D orientation of the lipid molecule (with the headgroup pointing upwards along \(+y\)):
msm.view(molsys)
We now reflect the coordinates across the horizontal \(xz\)-plane (normal vector [0, 1, 0], inverting the vertical \(y\)-axis) passing through the origin:
molsys_flipped = msm.structure.flip(molsys, vector=[0, 1, 0], point='[0, 0, 0] nm')
Visualizing the flipped system confirms that the lipid is inverted vertically (\(y \to -y\)):
msm.view(molsys_flipped)
See also
Related Tools & References
Convert: Convert molecular systems between different forms with
molsysmt.basic.convert().Align principal axes: Orient principal inertia axes along target Cartesian directions with
molsysmt.structure.align_principal_axes().Center: Center a molecular system around coordinate origin or reference points with
molsysmt.structure.center().View: Render molecular systems interactively with
molsysmt.basic.view().Rotate: Rotate a molecular system around a chosen axis with
molsysmt.structure.rotate().Translate: Translate molecular coordinates by a displacement vector with
molsysmt.structure.translate().