openmmtools.forces.HarmonicRestraintForce

class openmmtools.forces.HarmonicRestraintForce(spring_constant, *args, **kwargs)[source]

Impose a single harmonic restraint between the centroids of two groups of atoms.

This can be used to prevent the ligand from drifting too far from the protein in implicit solvent calculations or to keep the ligand close to the binding pocket in the decoupled states to increase mixing.

The restraint is applied between the centroids of two groups of atoms that belong to the receptor and the ligand respectively. The centroids are determined by a mass-weighted average of the group particles positions.

The energy expression of the restraint is given by

E = controlling_parameter * (K/2)*r^2

where K is the spring constant, r is the distance between the two group centroids, and controlling_parameter is a scale factor that can be used to control the strength of the restraint.

With OpenCL, only on 64bit platforms are supported.

Parameters:
spring_constantopenmm.unit.Quantity

The spring constant K (see energy expression above) in units compatible with joule/nanometer**2/mole.

restrained_atom_indices1iterable of int

The indices of the first group of atoms to restrain.

restrained_atom_indices2iterable of int

The indices of the second group of atoms to restrain.

controlling_parameter_namestr, optional

The name of the global parameter controlling the energy function. The default value is ‘lambda_restraints’.

Attributes:
spring_constant

unit.openmm.Quantity: The spring constant K (units of energy/mole/distance^2).

restrained_atom_indices1

The indices of the first group of restrained atoms.

restrained_atom_indices2

The indices of the first group of restrained atoms.

restraint_parameters

OrderedDict: The restraint parameters in dictionary form.

controlling_parameter_name

str: The name of the global parameter controlling the energy function (read-only).

Methods

addBond(self, groups[, parameters])

Add a bond to the force

addEnergyParameterDerivative(self, name)

Request that this Force compute the derivative of its energy with respect to a global parameter.

addGlobalParameter(self, name, defaultValue)

Add a new global parameter that the interaction may depend on.

addGroup(self, particles[, weights])

Add a particle group.

addPerBondParameter(self, name)

Add a new per-bond parameter that the interaction may depend on.

addTabulatedFunction(self, name, function)

Add a tabulated function that may appear in the energy expression.

compute_standard_state_correction(...[, ...])

Return the standard state correction of the restraint.

deserialize_xml(xml_serialization)

Shortcut to deserialize the XML representation and the restore interface.

distance_at_energy(potential_energy)

Compute the distance at which the potential energy is potential_energy.

getBondParameters(self, index)

Get the properties of a bond.

getEnergyFunction(self)

Get the algebraic expression that gives the interaction energy of each bond

getEnergyParameterDerivativeName(self, index)

Get the name of a global parameter with respect to which this Force should compute the derivative of the energy.

getForceGroup(self)

Get the force group this Force belongs to.

getGlobalParameterDefaultValue(self, index)

Get the default value of a global parameter.

getGlobalParameterName(self, index)

Get the name of a global parameter.

getGroupParameters(self, index)

Get the properties of a group.

getName(self)

Get the name of this Force.

getNumBonds(self)

Get the number of bonds for which force field parameters have been defined.

getNumEnergyParameterDerivatives(self)

Get the number of global parameters with respect to which the derivative of the energy should be computed.

getNumFunctions(self)

Get the number of tabulated functions that have been defined.

getNumGlobalParameters(self)

Get the number of global parameters that the interaction depends on.

getNumGroups(self)

Get the number of particle groups that have been defined.

getNumGroupsPerBond(self)

Get the number of groups used to define each bond.

getNumPerBondParameters(self)

Get the number of per-bond parameters that the interaction depends on.

getNumTabulatedFunctions(self)

Get the number of tabulated functions that have been defined.

getPerBondParameterName(self, index)

Get the name of a per-bond parameter.

getTabulatedFunction(-> TabulatedFunction)

Get a reference to a tabulated function that may appear in the energy expression.

getTabulatedFunctionName(self, index)

Get the name of a tabulated function that may appear in the energy expression.

is_restorable(openmm_object)

Check if the custom integrator or force has a restorable interface.

restore_interface(openmm_object)

Restore the original interface of an OpenMM custom force or integrator.

setBondParameters(self, index, groups[, ...])

Set the properties of a bond.

setEnergyFunction(self, energy)

Set the algebraic expression that gives the interaction energy of each bond

setForceGroup(self, group)

Set the force group this Force belongs to.

setGlobalParameterDefaultValue(self, index, ...)

Set the default value of a global parameter.

setGlobalParameterName(self, index, name)

Set the name of a global parameter.

setGroupParameters(self, index, particles[, ...])

Set the properties of a group.

setName(self, name)

Set the name of this Force.

setPerBondParameterName(self, index, name)

Set the name of a per-bond parameter.

setUsesPeriodicBoundaryConditions(self, periodic)

Set whether this force should apply periodic boundary conditions when calculating displacements.

updateParametersInContext(self, context)

Update the per-bond parameters and tabulated functions in a Context to match those stored in this Force object.

usesPeriodicBoundaryConditions(self)

Returns whether or not this force makes use of periodic boundary conditions.

__init__(self, numGroups, energy) CustomCentroidBondForce
__init__(self, other) CustomCentroidBondForce

Create a CustomCentroidBondForce.

Parameters:
numGroupsint

the number of groups used to define each bond

energystring

an algebraic expression giving the interaction energy of each bond as a function of particle positions, inter-particle distances, angles, and dihedrals, and any global and per-bond parameters

Methods

__init__(-> CustomCentroidBondForce)

Create a CustomCentroidBondForce.

addBond(self, groups[, parameters])

Add a bond to the force

addEnergyParameterDerivative(self, name)

Request that this Force compute the derivative of its energy with respect to a global parameter.

addGlobalParameter(self, name, defaultValue)

Add a new global parameter that the interaction may depend on.

addGroup(self, particles[, weights])

Add a particle group.

addPerBondParameter(self, name)

Add a new per-bond parameter that the interaction may depend on.

addTabulatedFunction(self, name, function)

Add a tabulated function that may appear in the energy expression.

compute_standard_state_correction(...[, ...])

Return the standard state correction of the restraint.

deserialize_xml(xml_serialization)

Shortcut to deserialize the XML representation and the restore interface.

distance_at_energy(potential_energy)

Compute the distance at which the potential energy is potential_energy.

getBondParameters(self, index)

Get the properties of a bond.

getEnergyFunction(self)

Get the algebraic expression that gives the interaction energy of each bond

getEnergyParameterDerivativeName(self, index)

Get the name of a global parameter with respect to which this Force should compute the derivative of the energy.

getForceGroup(self)

Get the force group this Force belongs to.

getGlobalParameterDefaultValue(self, index)

Get the default value of a global parameter.

getGlobalParameterName(self, index)

Get the name of a global parameter.

getGroupParameters(self, index)

Get the properties of a group.

getName(self)

Get the name of this Force.

getNumBonds(self)

Get the number of bonds for which force field parameters have been defined.

getNumEnergyParameterDerivatives(self)

Get the number of global parameters with respect to which the derivative of the energy should be computed.

getNumFunctions(self)

Get the number of tabulated functions that have been defined.

getNumGlobalParameters(self)

Get the number of global parameters that the interaction depends on.

getNumGroups(self)

Get the number of particle groups that have been defined.

getNumGroupsPerBond(self)

Get the number of groups used to define each bond.

getNumPerBondParameters(self)

Get the number of per-bond parameters that the interaction depends on.

getNumTabulatedFunctions(self)

Get the number of tabulated functions that have been defined.

getPerBondParameterName(self, index)

Get the name of a per-bond parameter.

getTabulatedFunction(-> TabulatedFunction)

Get a reference to a tabulated function that may appear in the energy expression.

getTabulatedFunctionName(self, index)

Get the name of a tabulated function that may appear in the energy expression.

is_restorable(openmm_object)

Check if the custom integrator or force has a restorable interface.

restore_interface(openmm_object)

Restore the original interface of an OpenMM custom force or integrator.

setBondParameters(self, index, groups[, ...])

Set the properties of a bond.

setEnergyFunction(self, energy)

Set the algebraic expression that gives the interaction energy of each bond

setForceGroup(self, group)

Set the force group this Force belongs to.

setGlobalParameterDefaultValue(self, index, ...)

Set the default value of a global parameter.

setGlobalParameterName(self, index, name)

Set the name of a global parameter.

setGroupParameters(self, index, particles[, ...])

Set the properties of a group.

setName(self, name)

Set the name of this Force.

setPerBondParameterName(self, index, name)

Set the name of a per-bond parameter.

setUsesPeriodicBoundaryConditions(self, periodic)

Set whether this force should apply periodic boundary conditions when calculating displacements.

updateParametersInContext(self, context)

Update the per-bond parameters and tabulated functions in a Context to match those stored in this Force object.

usesPeriodicBoundaryConditions(self)

Returns whether or not this force makes use of periodic boundary conditions.

Attributes

controlling_parameter_name

str: The name of the global parameter controlling the energy function (read-only).

restrained_atom_indices1

The indices of the first group of restrained atoms.

restrained_atom_indices2

The indices of the first group of restrained atoms.

restraint_parameters

OrderedDict: The restraint parameters in dictionary form.

spring_constant

unit.openmm.Quantity: The spring constant K (units of energy/mole/distance^2).

thisown

The membership flag