mllf.cb.graph_utils

Helpers to convert existing Graph objects to PyTorch Geometric Data.

This module is intentionally defensive: it will try to import the project’s Graph class and fall back to handling networkx-like graph objects.

Functions

build_directed_pairs(nsubs_per_site)

Build list of directed pairs for all substituents within each site.

build_pyg_graph_from_mllf_graph(g[, ...])

Convert a Graph-like object g into a PyG Data object and metadata.

compute_deepset_embedding_for_node(node_idx, ...)

Compute DeepSet embedding for a single node/substituent.

compute_deepset_embeddings_for_graph(g, ...)

Compute DeepSet embeddings for all nodes in a graph.