MHCXGraph.classes.graph¶
- class MHCXGraph.classes.graph.AssociatedGraph(graphs: list[tuple], output_path: str, run_name: str, association_config: dict[str, Any])[source]¶
Bases:
objectAssociation engine for multiple protein graphs.
This class performs structural association between several residue graphs, computes alignment frames, and generates visualization outputs and structural frames.
- output_path¶
Directory where association outputs are written.
- Type:
- align_all_frames()[source]¶
Align protein structures across all associated graph frames.
The alignment is performed using C-alpha atoms of residues shared across proteins. Frames lacking sufficient common residues are skipped.
- Return type:
None
- class MHCXGraph.classes.graph.Graph(graph_path: str, config: GraphConfig)[source]¶
Bases:
objectGraph representation of a protein structure.
This class loads a structural file (PDB or mmCIF), constructs a residue interaction graph using the configured pipeline, and provides utilities for extracting and exporting filtered subgraphs.
- config¶
Configuration object defining graph construction parameters.
- Type:
- graph¶
Graph representation of the protein structure.
- Type:
networkx.Graph
- subgraphs¶
Dictionary storing named subgraphs or node selections.
- pdb_df¶
DataFrame containing PDB atom-level information.
- Type:
pandas.DataFrame or None
- raw_pdb_df¶
DataFrame containing raw PDB data before filtering.
- Type:
pandas.DataFrame or None
- dssp_df¶
DataFrame containing DSSP secondary structure annotations.
- Type:
pandas.DataFrame or None
- create_subgraph(name: str, node_list: list | None = None, return_node_list: bool = False, **args)[source]¶
Create and store a subgraph.
A subgraph may be generated either from an explicit list of nodes or by applying filtering arguments passed to the subgraph extraction pipeline.
- Parameters:
name (str) – Name used to store the subgraph.
node_list (list, optional) – Explicit list of node identifiers used to build the subgraph.
return_node_list (bool, default=False) – If True, return the node list of the generated subgraph.
**args (dict) – Additional keyword arguments forwarded to the subgraph extraction function.
- Returns:
nodes – Node identifiers of the generated subgraph if
return_node_listis True.- Return type:
list or networkx.classes.reportviews.NodeView, optional
- save_filtered_pdb(g: Graph, output_path: str | Path, name: str, use_cif: bool = False)[source]¶
Save a filtered structural file containing only selected residues.
- Parameters:
g (networkx.Graph) – Graph containing the subset of residues to export.
output_path (str or pathlib.Path) – Directory where the filtered structure file will be written.
name (str) – Base filename used when saving the structure.
use_cif (bool, default=False) – If True, save the output in mmCIF format. Otherwise, save the structure as a PDB file.
- Return type:
None
- class MHCXGraph.classes.graph.GraphData[source]¶
Bases:
TypedDict- contact_map: ndarray¶
- graph: Graph¶
- rsa: ndarray¶
Classes¶
|
Association engine for multiple protein graphs. |
|
Graph representation of a protein structure. |