class openfe.setup.LigandNetwork(edges: Iterable[LigandAtomMapping], nodes: Iterable[SmallMoleculeComponent] | None = None)#

A directed graph connecting many ligands according to their atom mapping

property graph: MultiDiGraph#

NetworkX graph for this network

property edges: FrozenSet[LigandAtomMapping]#

A read-only view of the edges of the Network

property nodes: FrozenSet[SmallMoleculeComponent]#

A read-only view of the nodes of the Network

to_graphml() str#

Return the GraphML string representing this Network.

This is the primary serialization mechanism for this class.


string representing this network in GraphML format

Return type:


classmethod from_graphml(graphml_str: str)#

Create Network from GraphML string. This is the primary deserialization mechanism for this class.


graphml_str (str) – GraphML string representation of a Network


new network from the GraphML

Return type:


enlarge_graph(*, edges=None, nodes=None) LigandNetwork#

Create a new network with the given edges and nodes added


a new network adding the given edges and nodes to this network

Return type:


to_rbfe_alchemical_network(solvent: SolventComponent, protein: ProteinComponent, protocol: Protocol, *, autoname: bool = True, autoname_prefix: str = 'easy_rbfe', **other_components)#
  • protocol (:class:Protocol) –

  • autoname (bool) – whether to automatically name objects by the ligand name and state label

  • autoname_prefix (str) – prefix for the autonaming; only used if autonaming is True

  • other_components – additional non-alchemical components, keyword will be the string label for the component

is_connected() bool#

Are all ligands in the network (indirectly) connected to each other

A “False” value indicates that either some ligands have no edges or that there are separate networks that do not link to each other.