GUFE Transformation API#
Alchemical network edges#
- class gufe.transformations.Transformation(stateA: ChemicalSystem, stateB: ChemicalSystem, protocol: Protocol, mapping: dict[str, ComponentMapping] | None = None, name: str | None = None)#
An edge of an alchemical network.
Connects two
ChemicalSystem
objects, with directionality.- property stateA: ChemicalSystem#
The starting
ChemicalSystem
for the transformation.
- property stateB: ChemicalSystem#
The ending
ChemicalSystem
for the transformation.
- property protocol: Protocol#
The protocol used to perform the transformation.
This protocol derives free energy differences between
stateA
andstateB
ChemicalSystem
objects. It includes all details needed to perform required simulations/calculations and encodes the alchemical pathway used. May also correspond to an experimental result.
- property mapping: dict[str, ComponentMapping] | None#
Mapping of e.g. atoms between
stateA
andstateB
.
- property name: str | None#
Optional identifier for the transformation; used as part of its hash.
Set this to a unique value if adding multiple, otherwise identical transformations to the same
AlchemicalNetwork
to avoid deduplication.
- create(*, extends: ProtocolDAGResult | None = None, name: str | None = None) ProtocolDAG #
Returns a
ProtocolDAG
executing thisTransformation.protocol
.
- gather(protocol_dag_results: Iterable[ProtocolDAGResult]) ProtocolResult #
Gather multiple
ProtocolDAGResult
into a singleProtocolResult
.- Parameters:
protocol_dag_results (Iterable[ProtocolDAGResult]) – The
ProtocolDAGResult
objects to assemble aggregate quantities from.- Returns:
Aggregated results from many
ProtocolDAGResult
objects, all from a givenProtocol
.- Return type:
- dump(file)#
Dump this Transformation to a JSON file.
Note that this is not space-efficient: for example, any
Component
which is used in bothChemicalSystem
objects will be represented twice in the JSON output.- Parameters:
file (Union[PathLike, FileLike]) – a pathlike of filelike to save this transformation to.
- classmethod load(file)#
Create a Transformation from a JSON file.
- Parameters:
file (Union[PathLike, FileLike]) – a pathlike or filelike to read this transformation from
- class gufe.transformations.NonTransformation(system: ChemicalSystem, protocol: Protocol, name: str | None = None)#
Bases:
Transformation
A non-alchemical edge of an alchemical network.
A “transformation” that performs no transformation at all. Technically a self-loop, or an edge with the same
ChemicalSystem
at either end.Functionally used for applying a dynamics protocol to a
ChemicalSystem
that performs no alchemical transformation at all. This allows e.g. equilibrium MD to be performed on aChemicalSystem
as desired alongside alchemical protocols between it and and otherChemicalSystem
objects.- property stateA#
The starting
ChemicalSystem
for the transformation.
- property stateB#
The ending
ChemicalSystem
for the transformation.
- property system: ChemicalSystem#
- property protocol#
The protocol for sampling dynamics of the ChemicalSystem.
Includes all details needed to perform required simulations/calculations.
- create(*, extends: ProtocolDAGResult | None = None, name: str | None = None) ProtocolDAG #
Returns a
ProtocolDAG
executing thisTransformation.protocol
.
- dump(file)#
Dump this Transformation to a JSON file.
Note that this is not space-efficient: for example, any
Component
which is used in bothChemicalSystem
objects will be represented twice in the JSON output.- Parameters:
file (Union[PathLike, FileLike]) – a pathlike of filelike to save this transformation to.
- gather(protocol_dag_results: Iterable[ProtocolDAGResult]) ProtocolResult #
Gather multiple
ProtocolDAGResult
into a singleProtocolResult
.- Parameters:
protocol_dag_results (Iterable[ProtocolDAGResult]) – The
ProtocolDAGResult
objects to assemble aggregate quantities from.- Returns:
Aggregated results from many
ProtocolDAGResult
objects, all from a givenProtocol
.- Return type:
- classmethod load(file)#
Create a Transformation from a JSON file.
- Parameters:
file (Union[PathLike, FileLike]) – a pathlike or filelike to read this transformation from
- property mapping: dict[str, ComponentMapping] | None#
Mapping of e.g. atoms between
stateA
andstateB
.
- property name: str | None#
Optional identifier for the transformation; used as part of its hash.
Set this to a unique value if adding multiple, otherwise identical transformations to the same
AlchemicalNetwork
to avoid deduplication.
Alchemical Networks#
- class gufe.network.AlchemicalNetwork(edges: Iterable[Transformation] | None = None, nodes: Iterable[ChemicalSystem] | None = None, name: str | None = None)#
A network with all the information needed for a simulation campaign.
Nodes are
ChemicalSystem
instances and edges areTransformation
instances.- property graph#
- property edges: frozenset[Transformation]#
Network edges as a
frozenset
ofTransformation
instances.
- property nodes: frozenset[ChemicalSystem]#
Network nodes as a
frozenset
ofChemicalSystem
instances.
- property name: str | None#
Optional identifier for the network.
- to_graphml() str #
- classmethod from_graphml(str)#