Get angles from box#
Extracting periodic box angles from 3x3 box matrices.
The function molsysmt.pbc.get_angles_from_box() computes crystallographic box angles \((\alpha, \beta, \gamma)\) from a \(3\times 3\) periodic cell matrix or an array of boxes.
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.pbc.get_angles_from_box().
Basic usage#
Let’s extract the box angles from a solvated molecular system:
import molsysmt as msm
import pyunitwizard as puw
molsys = msm.convert(msm.systems['Met-enkephalin']['met_enkephalin.h5msm'])
molsys_solvated = msm.build.solvate(molsys, box_shape='truncated octahedral', clearance='14.0 angstroms', engine='PDBFixer')
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 query the box vectors matrix from the solvated system and compute the angles:
box = msm.get(molsys_solvated, element='system', box=True)
box_angles = msm.pbc.get_angles_from_box(box)
print('Box angles (degrees):', puw.convert(box_angles, to_unit='degrees'))
Box angles (degrees): [[70.5287554536443 109.47120709841901 70.5287554536443]] degree
Extracting angles from different box geometries#
The function extracts angles from any valid box matrix (e.g. cubic, truncated octahedral, rhombic dodecahedral):
box_cub = msm.pbc.get_box_with_shape(shape='cubic', length='3.0 nm')
box_dod = msm.pbc.get_box_with_shape(shape='rhombic dodecahedral', length='3.0 nm')
angles_cub = msm.pbc.get_angles_from_box(box_cub)
angles_dod = msm.pbc.get_angles_from_box(box_dod)
print('Cubic angles:', puw.convert(angles_cub, to_unit='degrees'))
print('Rhombic dodecahedral angles:', puw.convert(angles_dod, to_unit='degrees'))
Cubic angles: [[89.99998127603166 89.99998127603166 89.99998127603166]] degree
Rhombic dodecahedral angles: [[60.00002571454079 60.00002571454079 89.99998127603166]] degree
See also
Related Tools & References
Convert: Convert molecular systems with
molsysmt.basic.convert().Solvate: Solvate molecular systems with
molsysmt.build.solvate().Get: Query box attributes with
molsysmt.basic.get().Get box with shape: Construct standard box matrices with
molsysmt.pbc.get_box_with_shape().Get lengths from box: Extract box edge lengths with
molsysmt.pbc.get_lengths_from_box().Get shape from angles: Determine box shape from angles with
molsysmt.pbc.get_shape_from_angles().