MHCXGraph.core.pdb_graph_builder.PDBGraphBuilder

class MHCXGraph.core.pdb_graph_builder.PDBGraphBuilder(pdb_path: str, config: GraphConfig | None = None)[source]

Build a structural graph from a PDB/mmCIF file.

Parameters:
  • pdb_path (str) – Path to the structure file.

  • config (GraphBuildConfig, optional) – Graph construction options.

Notes

The distance matrix and the node labels are exported to .pmhc_tmp/ with filenames <stem>_distmat.npy and <stem>_residue_labels.txt.

__init__(pdb_path: str, config: GraphConfig | None = None) None[source]

Methods

__init__(pdb_path[, config])

build_graph()

Run the full pipeline: load → select chains → ASA/RSA → distances → graph.

load()

Load the structure into memory.

to_graphml(G, path)

Export the graph to GraphML.

to_json(G, path)

Export the graph to JSON (nodes/edges with attributes).