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

A directed graph connecting many ligands according to their atom mapping

Parameters:
property graph: MultiDiGraph#

NetworkX graph for this network

This graph will have ChemicalSystem objects as nodes and Transformation objects as directed edges

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.

Returns:

string representing this network in GraphML format

Return type:

str

classmethod from_graphml(graphml_str: str) LigandNetwork#

Create from a GraphML string.

Parameters:

graphml_str (str) – GraphML string representation of a Network

Returns:

new network from the GraphML

Return type:

LigandNetwork

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

Create a new network with the given edges and nodes added

Parameters:
Returns:

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

Return type:

LigandNetwork

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

Convert the ligand network to an AlchemicalNetwork

Parameters:
  • protocol (Protocol) – the method to apply to edges

  • 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.