Graph Construction

Graph construction decides which nodes and edges a model sees. For molecular and protein modeling, it is often as important as the GNN architecture itself.

A radius graph connects nodes within a cutoff:

A k-nearest neighbor graph connects each node to its nearest neighbors:

Common Choices

Graph TypeNodesEdgesTypical Use
Chemical bond graphatomscovalent bondsmolecular property prediction, graph pretraining
contact mapresiduesdistance/contact thresholdprotein structure and function modeling
radius graphatoms, residues, pointslocal 3D message passing
k-nearest neighbor graphatoms, residues, embeddingsnearest neighbors by distance or similarityfixed-degree geometric models
bipartite interaction graphprotein nodes and ligand nodescross edges between setsprotein-ligand interaction, docking, scoring
fully connected graphall nodesall pairssmall molecules, attention-heavy graph transformers

Construction Function

Write graph construction as a function:

where is the raw entity, is the representation, is context such as pocket or conformer protocol, and contains node, edge, or pair attributes. This makes clear whether graph construction is deterministic, learned, cached, or context-dependent.

Edge Attributes

AttributeMeaningRisk
bond typechemical relationaromaticity, charge, stereo, and hydrogens depend on standardization
distancecoordinate relationcoordinate source and unit must be fixed
direction vectorequivariant relationframe and rotation behavior must be explicit
sequence separationresidue relationchain breaks and missing residues matter
interaction typeprotein-ligand relationmay be derived from known pose or post-hoc annotation
learned relationmodel-discovered edgecan hide data leakage if fit using test data

Leakage Boundary

Graph construction can leak when edges use information unavailable at inference:

Examples include ligand-defined pockets in blind docking, contact maps from target structures unavailable in deployment, similarity graphs built using the full benchmark, or conformer/pose edges generated after seeing labels.

Checks

  • What is a node: atom, residue, conformer, pocket point, or abstract entity?
  • Are edges chemical, spatial, sequential, learned, or task-specific?
  • Does graph construction use target information or future data?
  • Are cutoff and values stable across molecule and protein sizes?
  • Is graph construction performed before or after the split?
  • Are coordinates, conformers, pockets, and templates available at inference?
  • Are node ordering, atom mapping, and residue indexing stable across preprocessing?