config
#
Configure free energy calculations.
Classes:
-
System
–Define the two solvents that solutes will be transferred between (a -> b),
-
MinimizationProtocol
–Configure how a system should be energy minimized.
-
SimulationProtocol
–Configure how a system should be evolved by molecular simulation.
-
HREMDProtocol
–Configure how a system should be evolved by Hamiltonian replica exchange.
-
EquilibriumProtocol
–Configure how an equilibrium (e.g. TI, MBAR) alchemical free energy
-
SwitchingProtocol
–Configure non-reversibly driving a system between to alchemical states.
-
NonEquilibriumProtocol
–Configure a non-equilibrium alchemical free energy calculation [1, 2].
-
Config
–Configure a transfer free energy calculation.
-
Result
–The result of a free energy calculation.
System
pydantic-model
#
Bases: BaseModel
Define the two solvents that solutes will be transferred between (a -> b), as well as the solutes themselves.
Fields:
-
solutes
(dict[str, PositiveInt]
) -
solvent_a
(dict[str, PositiveInt] | None
) -
solvent_b
(dict[str, PositiveInt] | None
) -
n_solute_molecules
(int
) -
n_solvent_molecules_a
(int
) -
n_solvent_molecules_b
(int
) -
components_a
(list[tuple[str, int]]
) -
components_b
(list[tuple[str, int]]
)
Validators:
solutes
pydantic-field
#
A dictionary containing the SMILES patterns of each solute in the system as well as how many instances of each there should be.
solvent_a
pydantic-field
#
A dictionary containing the SMILES patterns of each component in the first solvent as well as how many instances of each there should be.A value of None
should be used to indicate vacuum.
solvent_b
pydantic-field
#
A dictionary containing the SMILES patterns of each component in the second solvent as well as how many instances of each there should be. A value of None
should be used to indicate vacuum.
n_solute_molecules
pydantic-field
#
Returns the total number of solute molecules that will be present.
n_solvent_molecules_a
pydantic-field
#
Returns the total number of solvent molecules that will be present in the first solution.
n_solvent_molecules_b
pydantic-field
#
Returns the total number of solvent molecules that will be present in the second solution.
components_a
pydantic-field
#
Returns the identities and counts of the molecules present in the first system.
Returns:
-
list[tuple[str, int]]
–The SMILES representation and count of each component.
components_b
pydantic-field
#
Returns the identities and counts of the molecules present in the second system.
Returns:
-
list[tuple[str, int]]
–The SMILES representation and count of each component.
MinimizationProtocol
pydantic-model
#
Bases: BaseModel
Configure how a system should be energy minimized.
Fields:
-
tolerance
(OpenMMQuantity[kilojoule_per_mole / nanometers]
) -
max_iterations
(NonNegativeInt
)
tolerance
pydantic-field
#
tolerance: OpenMMQuantity[
kilojoule_per_mole / nanometers
] = (10.0 * kilojoule_per_mole / nanometers)
How precisely the energy minimum must be located [kj / mol / nm]
max_iterations
pydantic-field
#
The maximum number of iterations to perform. If this is 0, minimization is continued until the results converge.
SimulationProtocol
pydantic-model
#
Bases: BaseModel
Configure how a system should be evolved by molecular simulation.
Fields:
-
integrator
(LangevinIntegrator
) -
n_steps
(PositiveInt
)
HREMDProtocol
pydantic-model
#
Bases: BaseModel
Configure how a system should be evolved by Hamiltonian replica exchange.
Fields:
-
integrator
(LangevinIntegrator
) -
n_warmup_steps
(int
) -
n_steps_per_cycle
(int
) -
n_cycles
(int
) -
trajectory_interval
(int | None
) -
trajectory_enforce_pbc
(bool
)
integrator
pydantic-field
#
integrator: LangevinIntegrator = LangevinIntegrator(
timestep=2.0 * femtosecond, friction=1.0 / picosecond
)
The integrator to use for the simulation.
n_warmup_steps
pydantic-field
#
The number of steps to run each replica for before starting hremd trials. All energies gathered during this period will be discarded.
n_steps_per_cycle
pydantic-field
#
The number of steps to propagate the system by before attempting an exchange.
n_cycles
pydantic-field
#
The number of cycles of 'propagate the system' -> 'exchange replicas' to run.
trajectory_interval
pydantic-field
#
The number of cycles to run before saving the current replica states to DCD trajectory files. If None
, no trajectories will be saved.
trajectory_enforce_pbc
pydantic-field
#
Whether to apply periodic boundary conditions when retrieving coordinates for writing to trajectory files.
EquilibriumProtocol
pydantic-model
#
Bases: BaseModel
Configure how an equilibrium (e.g. TI, MBAR) alchemical free energy calculation.
Fields:
-
type
(Literal['equilibrium']
) -
minimization_protocol
(MinimizationProtocol
) -
equilibration_protocol
(SimulationProtocol
) -
production_protocol
(HREMDProtocol
) -
lambda_sterics
(list[confloat(ge=0.0, le=1.0)]
) -
lambda_electrostatics
(list[confloat(ge=0.0, le=1.0)]
) -
n_states
(int
)
Validators:
-
_validate_lambda_lengths
minimization_protocol
pydantic-field
#
minimization_protocol: MinimizationProtocol = (
MinimizationProtocol()
)
Whether to minimize the energy of the system prior to any simulations.
equilibration_protocol
pydantic-field
#
equilibration_protocol: SimulationProtocol = (
SimulationProtocol(n_steps=100000)
)
The (optional) protocol that describes the equilibration simulation to run prior to the production one.
production_protocol
pydantic-field
#
production_protocol: HREMDProtocol = HREMDProtocol(
n_steps_per_cycle=6250, n_cycles=160
)
The protocol that describes the production to run.
lambda_sterics
pydantic-field
#
The alchemical pathway to transform the vdW interactions along. A value of 1.0 represents a fully interacting system while a value of 0.0 represents a system with the solute-solute and solute-solvent vdW interactions disabled.
lambda_electrostatics
pydantic-field
#
The alchemical pathway to transform the electrostatic interactions along. A value of 1.0 represents a fully interacting system while a value of 0.0 represents a system with the solute-solute and solute-solvent electrostatic interactions disabled.
n_states
pydantic-field
#
Returns the number of lambda states that will be sampled at.
SwitchingProtocol
pydantic-model
#
Bases: BaseModel
Configure non-reversibly driving a system between to alchemical states.
Fields:
-
n_electrostatic_steps
(NonNegativeInt
) -
n_steps_per_electrostatic_step
(NonNegativeInt
) -
n_steric_steps
(NonNegativeInt
) -
n_steps_per_steric_step
(NonNegativeInt
)
n_electrostatic_steps
pydantic-field
#
The number of steps to annihilate the electrostatics interactions over. The total time needed to annihilate the electrostatics interactions will be n_electrostatic_steps * n_steps_per_electrostatic_step * timestep
n_steps_per_electrostatic_step
pydantic-field
#
The number of timesteps to evolve the system by each time the electrostatics interactions are modified. A value of 1 will give a 'smooth' transition between the each discrete lambda value whereas a value greater than 1 will yield a stepwise transition as shown in Figure 3 of doi:10.1063/1.4712028.
n_steric_steps
pydantic-field
#
The number of steps to decouple the sterics interactions over once the electrostatics interactions have been annihilated. The total time needed to annihilate the sterics interactions will be n_steric_steps * n_steps_per_steric_step * timestep
n_steps_per_steric_step
pydantic-field
#
The number of timesteps to evolve the system by each time the sterics interactions are modified. A value of 1 will give a 'smooth' transition between the each discrete lambda value whereas a value greater than 1 will yield a stepwise transition as shown in Figure 3 of doi:10.1063/1.4712028.
NonEquilibriumProtocol
pydantic-model
#
Bases: BaseModel
Configure a non-equilibrium alchemical free energy calculation [1, 2].
It is expected that first the electrostatics interactions will be annihilated followed by a decoupling of the sterics interactions.
References
[1] Ballard, Andrew J., and Christopher Jarzynski. "Replica exchange with nonequilibrium switches: Enhancing equilibrium sampling by increasing replica overlap." The Journal of chemical physics 136.19 (2012): 194101.
[2] Gapsys, Vytautas, et al. "Large scale relative protein ligand binding affinities using non-equilibrium alchemy." Chemical Science 11.4 (2020): 1140-1152.
Fields:
-
type
(Literal['non-equilibrium']
) -
minimization_protocol
(MinimizationProtocol | None
) -
equilibration_protocol
(SimulationProtocol | None
) -
production_protocol
(SimulationProtocol
) -
production_report_interval
(PositiveInt
) -
switching_protocol
(SwitchingProtocol
)
minimization_protocol
pydantic-field
#
minimization_protocol: MinimizationProtocol | None = (
MinimizationProtocol()
)
The (optional) protocol to follow when minimizing the system in both the end states prior to running the equilibrium simulations.
equilibration_protocol
pydantic-field
#
equilibration_protocol: SimulationProtocol | None = (
SimulationProtocol(n_steps=100000)
)
The (optional) protocol to follow when equilibrating the system in both the end states prior to running the production equilibrium simulations.
production_protocol
pydantic-field
#
production_protocol: SimulationProtocol = (
SimulationProtocol(n_steps=6250 * 160)
)
The protocol to follow when running the production equilibrium simulation in both the end states. The snapshots generated at the end of each iteration will be used for each non-equilibrium switch.
production_report_interval
pydantic-field
#
The interval at which to write out the simulation state during the production simulation.
switching_protocol
pydantic-field
#
switching_protocol: SwitchingProtocol
The protocol that describes how each snapshot generated during the production simulation should be driven from state 0 -> 1 and likewise 1 -> 0 in order to compute the non-equilibrium work distributions.
Config
pydantic-model
#
Bases: BaseModel
Configure a transfer free energy calculation.
Fields:
-
temperature
(OpenMMQuantity[kelvin]
) -
pressure
(OpenMMQuantity[atmosphere] | None
) -
alchemical_protocol_a
(AlchemicalProtocol
) -
alchemical_protocol_b
(AlchemicalProtocol
)
temperature
pydantic-field
#
The temperature to calculate at [K].
pressure
pydantic-field
#
The pressure to calculate at [atm].
alchemical_protocol_a
pydantic-field
#
The protocol that describes the alchemical pathway to transform the solute along in the first solvent.
alchemical_protocol_b
pydantic-field
#
The protocol that describes the alchemical pathway to transform the solute along in the second solvent.
Result
pydantic-model
#
Bases: BaseModel
The result of a free energy calculation.
Fields:
-
dg_solvent_a
(OpenMMQuantity[KCAL_MOL]
) -
dg_std_solvent_a
(OpenMMQuantity[KCAL_MOL]
) -
dg_solvent_b
(OpenMMQuantity[KCAL_MOL]
) -
dg_std_solvent_b
(OpenMMQuantity[KCAL_MOL]
)
dg_solvent_a
pydantic-field
#
The change in free energy of alchemically transforming the solute from an interacting to a non-interacting state in the first solvent.
dg_std_solvent_a
pydantic-field
#
The standard error in dg_solvent_a
.
dg_solvent_b
pydantic-field
#
The change in free energy of alchemically transforming the solute from an interacting to a non-interacting state in the second solvent.
dg_std_solvent_b
pydantic-field
#
The standard error in dg_solvent_b
.