openmmtools.forces.FlatBottomRestraintForce¶
- class openmmtools.forces.FlatBottomRestraintForce(spring_constant, well_radius, *args, **kwargs)[source]¶
A restraint between the centroids of two groups of atoms using a flat potential well with harmonic walls.
An alternative choice to receptor-ligand restraints that uses a flat potential inside most of the protein volume with harmonic restraining walls outside of this. It can be used to prevent the ligand from drifting too far from protein in implicit solvent calculations while still exploring the surface of the protein for putative binding sites.
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.
More precisely, the energy expression of the restraint is given by
E = controlling_parameter * step(r-r0) * (K/2)*(r-r0)^2
where
K
is the spring constant,r
is the distance between the restrained atoms,r0
is another parameter defining the distance at which the restraint is imposed, andcontrolling_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.
- well_radiusopenmm.unit.Quantity
The distance r0 (see energy expression above) at which the harmonic restraint is imposed in units of distance.
- 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/length^2).
well_radius
unit.openmm.Quantity: The distance at which the harmonic restraint is imposed (units of length).
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/length^2).
thisown
The membership flag
well_radius
unit.openmm.Quantity: The distance at which the harmonic restraint is imposed (units of length).