Public API

View Module Index

sire.restraints.angle(mols, atoms, theta0=None, ktheta=None, name=None, map=None)[source]

Create a set of anglel restraints from all of the atoms in ‘atoms’ where all atoms are contained in the container ‘mols’, using the passed values of the force constant ‘ktheta’ and equilibrium angle value theta0.

If theta0 is None, then the current angle for provided atoms will be used as the equilibium value.

If ktheta is None, then a default value of 100 kcal mol-1 rad-2 will be used

Parameters:
  • mols (sire.system._system.System) – The system containing the atoms.

  • atoms (SireMol::Selector<SireMol::Atom>) – The atoms to restrain.

  • ktheta (str or SireUnits::Dimension::GeneralUnit or, optional) – The force constants for the angle restraints. If None, this will default to 100 kcal mol-1 rad-2. Default is None.

  • theta0 (str or SireUnits::Dimension::GeneralUnit, optional) – The equilibrium angles for the angle restraints. If None, these will be measured from the current coordinates of the atoms. Default is None.

Returns:

AnglelRestraints – A container of angle restraints, where the first restraint is the AngleRestraint created. The angle restraint created can be extracted with AngleRestraints[0].

Return type:

SireMM::AngleRestraints

sire.restraints.bond(*args, **kwargs)[source]

Synonym for distance(), as a bond restraint is treated the same as a distance restraint

sire.restraints.boresch(mols, receptor, ligand, kr=None, ktheta=None, kphi=None, r0=None, theta0=None, phi0=None, name=None, map=None, temperature=298 K)[source]

Create a set of Boresch restraints that will restrain the 6 external degrees of freedom of the ligand relative to the receptor. All of the atoms in both ‘ligand’ and ‘receptor’ must be contained in ‘mols’. Note that restraint energies are defined as k*x**2 (so forces are defined as 2*k*x) and hence the ‘kr’, ‘ktheta’ and ‘kphi’ values are half the force constants for the distance, angle and torsion restraints.

The BoreschRestraint will be a set of six restraints between three identified ligand atoms, and three identified receptor atoms:

  1. A single distance restraint, with specified force constant (kr) and equilibrium distance (r0) parameters.

  2. Two angle restraints, with specified force constants (ktheta) and equilibrium angles (theta0) parameters.

  3. Three torsion restraints, with specified force constants (kphi) and equilibrium angles (phi0) parameters.

This will create a single BoreschRestraint, which will be passed back in a BoreschRestraints object.

Parameters:
  • mols (sire.system._system.System) – The system containing the receptor and ligand.

  • receptor (SireMol::Selector<SireMol::Atom>) – The receptor atoms to restrain.

  • ligand (SireMol::Selector<SireMol::Atom>) – The ligand atoms to restrain.

  • kr (str or SireUnits::Dimension::GeneralUnit, optional) – Half the force constant for the distance restraint. If None, this will default to 5 kcal mol-1 A-2. Default is None.

  • ktheta (str or SireUnits::Dimension::GeneralUnit or list of str or SireUnits::Dimension::GeneralUnit, optional) – Half the force constants for the angle restraints, in the order kthetaA, kthetaB If None, this will default to 50 kcal mol-1 rad-2 for both angle restraints. If a list, then this should be a list of length 2 containing the force constants for the two angle restraints. If a single value, then this will be used for both angle restraints. Default is None.

  • kphi (str or SireUnits::Dimension::GeneralUnit or list of str or SireUnits::Dimension::GeneralUnit, optional) – Half the force constants for the torsion restraints, in the order kthetaA, kthetaB, kthetaC. If None, this will default to 50 kcal mol-1 rad-2 for all three torsion restraints. If a list, then this should be a list of length 3 containing the force constants for the three torsion restraints. If a single value, then this will be used for all three torsion restraints. Default is None.

  • r0 (str or SireUnits::Dimension::GeneralUnit, optional) – The equilibrium distance for the distance restraint. If None, this will be measured from the current coordinates of the atoms. Default is None.

  • theta0 (list of str or SireUnits::Dimension::GeneralUnit, optional) – The equilibrium angles for the angle restraints. If None, these will be measured from the current coordinates of the atoms. If a list, then this should be a list of length 2 containing the equilibrium angles for the two angle restraints. Default is None.

  • phi0 (list of str or SireUnits::Dimension::GeneralUnit, optional) – The equilibrium angles for the torsion restraints. If None, these will be measured from the current coordinates of the atoms. If a list, then this should be a list of length 3 containing the equilibrium angles for the three torsion restraints. Default is None.

  • name (str, optional) – The name of the restraint. If None, then a default name will be used. Default is None.

  • map (dict, optional) – A dictionary of additional options. Note that any options set in this dictionary that are also specified via one of the arguments above will be overridden by the argument value

  • temperature (str or SireUnits::Dimension::GeneralUnit, optional) – The temperature to use when checking for unstable restraints. If None, then this will default to 298 K. Default is None.

Returns:

BoreschRestraints – A container of Boresch restraints, where the first restraint is the BoreschRestraint created. The Boresch restraint created can be extracted with BoreschRestraints[0].

Return type:

SireMM::BoreschRestraints

Examples

Create a set of Boresch restraints for the ligand in the system ‘system’, specifying all of the force constants and equilibrium values:

>>> my_boresch_restraints = boresch(
>>>     system,
>>>     receptor=system["protein"]["atomidx 1538 or atomidx 1518 or atomidx 1540"],
>>>     ligand=system["resname LIG"]["atomidx 4 or atomidx 3 or atomidx 5"],
>>>     kr="6.2012 kcal mol-1 A-2",
>>>     ktheta=["28.7685 kcal mol-1 rad-2", "24.8204 kcal mol-1 rad-2"],
>>>     kphi=["59.8626 kcal mol-1 rad-2", "0.7923 kcal mol-1 rad-2", "55.1775 kcal mol-1 rad-2"],
>>>     r0="7.687 A",
>>>     theta0=["1.3031 rad", "1.4777 rad"],
>>>     phi0=["2.5569 rad", "2.9359 rad", "1.4147 rad"],
>>> )
>>> my_boresch_restraint = my_boresch_restraints[0]
sire.restraints.dihedral(mols, atoms, phi0=None, kphi=None, name=None, map=None)[source]

Create a set of dihedral restraints from all of the atoms in ‘atoms’ where all atoms are contained in the container ‘mols’, using the passed values of the force constant ‘kphi’ and equilibrium torsion angle phi0.

If phi0 is None, then the current torsional angle for the provided atoms will be used as the equilibium value.

If kphi is None, then a default value of 100 kcal mol-1 rad-2 will be used

Parameters:
  • mols (sire.system._system.System) – The system containing the atoms.

  • atoms (SireMol::Selector<SireMol::Atom>) – The atoms to restrain.

  • kphi (str or SireUnits::Dimension::GeneralUnit or, optional) – The force constants for the torsion restraints. If None, this will default to 100 kcal mol-1 rad-2. Default is None.

  • phi0 (str or SireUnits::Dimension::GeneralUnit, optional) – The equilibrium torsional angle for restraints. If None, these will be measured from the current coordinates of the atoms. Default is None.

Returns:

DihedralRestraints – A container of Dihedral restraints, where the first restraint is the DihedralRestraint created. The Dihedral restraint created can be extracted with DihedralRestraints[0].

Return type:

SireMM::DihedralRestraints

sire.restraints.distance(mols, atoms0, atoms1, r0=None, k=None, name=None, map=None)[source]

Create a set of distance restraints from all of the atoms in ‘atoms0’ to all of the atoms in ‘atoms1’ where all atoms are contained in the container ‘mols’, using the passed values of ‘k’ and equilibrium bond length r0. Note that ‘k’ corresponds to half the force constant, because the restraint energy is defined as k*(r - r0)**2 (hence the force is defined as 2*k*(r-r0)).

These restraints will be per atom-atom distance. If a list of k and/or r0 values are passed, then different values could be used for different atom-atom distances (assuming the same number as the number of atom-atom distances). Otherwise, all atom-atom distances will use the same parameters.

If r0 is None, then the current atom-atom distance for each atom-atom pair will be used as the equilibium value.

If k is None, then a default value of 150 kcal mol-1 A-2 will be used

sire.restraints.get_standard_state_correction(restraint, temperature=300 K)[source]

Get the entropic correction for releasing a given restraint to the standard state volume at a given temperature.

Parameters:
  • restraint (sire.legacy.MM._MM.BoreschRestraint) – The restraint for which to calculate the standard state correction.

  • temperature (sire.legacy.Units._Units.GeneralUnit, optional) – The temperature at which to calculate the standard state correction.

Returns:

correction – The standard state correction for the given restraint.

Return type:

sire.legacy.Units._Units.GeneralUnit

Examples

To create a Boresch restraint and calculate the standard state correction:

>>> # Create the Boresch restraints object.
>>> my_boresch_restraints = boresch(
>>>     system,
>>>     receptor=system["protein"]["atomidx 1538 or atomidx 1518 or atomidx 1540"],
>>>     ligand=system["resname LIG"]["atomidx 4 or atomidx 3 or atomidx 5"],
>>>     kr="6.2012 kcal mol-1 A-2",
>>>     ktheta=["28.7685 kcal mol-1 rad-2", "24.8204 kcal mol-1 rad-2"],
>>>     kphi=["59.8626 kcal mol-1 rad-2", "0.7923 kcal mol-1 rad-2", "55.1775 kcal mol-1 rad-2"],
>>>     r0="7.687 A",
>>>     theta0=["1.3031 rad", "1.4777 rad"],
>>>     phi0=["2.5569 rad", "2.9359 rad", "1.4147 rad"],
>>> )
>>>
>>> # Extract the single Boresch restraint from the Boresch restraints.
>>> my_boresch_restraint = my_boresch_restraints[0]
>>>
>>> # Calculate the standard state correction for the Boresch restraint.
>>> standard_state_correction = get_standard_state_correction(my_boresch_restraint)
>>> print(standard_state_correction)
sire.restraints.positional(mols, atoms, k=None, r0=None, position=None, name=None, map=None)[source]

Create a set of position restraints for the atoms specified in ‘atoms’ that are contained in the container ‘mols’, using the passed values of ‘k’ and flat-bottom potential well-width ‘r0’ for the restraints. Note that ‘k’ values correspond to half the force constants for the harmonic restraints, because the harmonic restraint energy is defined as k*(r - r0)**2 (hence the force is defined as 2*(r - r0)).

These restraints will be per atom. If a list of k and/or r0 values are passed, then different values could be used for different atoms (assuming the same number as the number of atoms). Otherwise, all atoms will use the same parameters.

If ‘r0’ is not specified, then a simple harmonic restraint is used.

If ‘k’ is not specified, then a default of 150 kcal mol-1 A-2 will be used.