Add allowed Z region#

Constraining atoms within a specific Z-coordinate slab using custom OpenMM forces.

The function molsysmt.third_party.openmm.forces.add_allowed_z_region() adds harmonic restraints that confine target atoms to a slab bounded by z0 and width.

Added in version 1.0.0.

Basic usage#

Let’s confine atoms to a Z-interval:

import molsysmt as msm

molsys = msm.convert(msm.systems['Trp-Cage']['1l2y.h5msm'], to_form='molsysmt.MolSys')
force = msm.third_party.openmm.forces.add_allowed_z_region(molsys, z0='0.0 nm', width='1.0 nm', selection=[0], force_constant='5000 kJ/(mol*nm**2)', return_force=True)
print('Allowed Z region restraint created:', type(force))
Allowed Z region restraint created: <class 'openmm.openmm.CustomExternalForce'>