LigandNetwork
#
- class gufe.ligandnetwork.LigandNetwork(edges: Iterable[LigandAtomMapping], nodes: Iterable[SmallMoleculeComponent] | None = None)#
A directed graph connecting many ligands according to their atom mapping
- Parameters:
edges (Iterable[LigandAtomMapping]) – edges for this network
nodes (Iterable[SmallMoleculeComponent]) – nodes for this network
Methods
Create a new network with the given edges and nodes added
Create from a GraphML string.
Are all ligands in the network (indirectly) connected to each other
Return the GraphML string representing this Network
Convert the ligand network to an AlchemicalNetwork
Attributes
A read-only view of the edges of the Network
NetworkX graph for this network
A read-only view of the nodes of the Network
- property edges: FrozenSet[LigandAtomMapping]#
A read-only view of the edges of the Network
- enlarge_graph(*, edges=None, nodes=None) LigandNetwork #
Create a new network with the given edges and nodes added
- Parameters:
edges (Iterable[
LigandAtomMapping
]) – edges to append to this networknodes (Iterable[
SmallMoleculeComponent
]) – nodes to append to this network
- Returns:
a new network adding the given edges and nodes to this network
- Return type:
- 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:
- property graph: networkx.MultiDiGraph#
NetworkX graph for this network
This graph will have
ChemicalSystem
objects as nodes andTransformation
objects as directed edges
- 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.
- 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
- 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