class openfe.protocols.openmm_rfe.RelativeHybridTopologyProtocolUnit(*, protocol: RelativeHybridTopologyProtocol, stateA: ChemicalSystem, stateB: ChemicalSystem, ligandmapping: LigandAtomMapping, generation: int, repeat_id: int, name: str | None = None)#

Calculates the relative free energy of an alchemical ligand transformation.

Parameters:
  • protocol (RelativeHybridTopologyProtocol) – protocol used to create this Unit. Contains key information such as the settings.

  • stateA (ChemicalSystem) – the two ligand SmallMoleculeComponents to transform between. The transformation will go from ligandA to ligandB.

  • stateB (ChemicalSystem) – the two ligand SmallMoleculeComponents to transform between. The transformation will go from ligandA to ligandB.

  • ligandmapping (LigandAtomMapping) – the mapping of atoms between the two ligand components

  • repeat_id (int) – identifier for which repeat (aka replica/clone) this Unit is

  • generation (int) – counter for how many times this repeat has been extended

  • name (str, optional) – human-readable identifier for this Unit

Notes

The mapping used must not involve any elemental changes. A check for this is done on class creation.

run(*, dry=False, verbose=True, scratch_basepath=None, shared_basepath=None) dict[str, Any]#

Run the relative free energy calculation.

Parameters:
  • dry (bool) – Do a dry run of the calculation, creating all necessary hybrid system components (topology, system, sampler, etc…) but without running the simulation.

  • verbose (bool) – Verbose output of the simulation progress. Output is provided via INFO level logging.

  • scratch_basepath (Pathlike, optional) – Where to store temporary files, defaults to current working directory

  • shared_basepath (Pathlike, optional) – Where to run the calculation, defaults to current working directory

Returns:

Outputs created in the basepath directory or the debug objects (i.e. sampler) if dry==True.

Return type:

dict

Raises:

error – Exception if anything failed

static analyse(where) dict#
property dependencies: list[gufe.protocols.protocolunit.ProtocolUnit]#

All units that this unit is dependent on (parents)

execute(*, context: Context, raise_error: bool = False, **inputs) ProtocolUnitResult | ProtocolUnitFailure#

Given ProtocolUnitResult s from dependencies, execute this ProtocolUnit.

Parameters:
  • context (Context) – Execution context for this ProtocolUnit; includes e.g. shared and scratch Path s.

  • raise_error (bool) – If True, raise any errors instead of catching and returning a ProtocolUnitFailure default False

  • **inputs – Keyword arguments giving the named inputs to _execute. These can include ProtocolUnitResult objects from ProtocolUnit objects this unit is dependent on.

property inputs: Dict[str, Any]#

Inputs to the ProtocolUnit.

Includes any ProtocolUnit instances this ProtocolUnit depends on.

property name: str | None#

Optional name for the ProtocolUnit.