MHCXGraph.core.config

class MHCXGraph.core.config.DSSPConfig(executable: str = 'mkdssp')[source]

Bases: object

Compatibility shim for call paths expecting a DSSP configuration object. Only the executable path/name is retained.

executable: str = 'mkdssp'
MHCXGraph.core.config.Granularity

Centroid policy used to derive node coordinates.

  • "all_atoms" — centroid of all heavy atoms per residue (fallback to any atom if needed).

  • "backbone" — centroid over backbone atoms (N, CA, C, O, OXT when present).

  • "side_chain" — centroid over side-chain heavy atoms; GLY falls back to backbone.

  • "ca_only" — CA coordinate; if CA is missing, CB is used; if both are missing, fallback to first heavy atom.

alias of Literal[‘all_atoms’, ‘backbone’, ‘side_chain’, ‘ca_only’]

class MHCXGraph.core.config.GraphConfig(chains: Iterable[str] | None = None, include_waters: bool = True, include_noncanonical_residues: bool = True, include_ligands: bool = True, residue_distance_cutoff: float = 10.0, store_distance_matrix: bool = True, compute_rsa: bool = True, model_index: int = 0, allow_empty_chains: bool = False, granularity: Literal['all_atoms', 'backbone', 'side_chain', 'ca_only'] = 'all_atoms', verbose: bool = False, make_virtual_cb_for_gly: bool = True, max_gap_helix: int = 0)[source]

Bases: object

Unified configuration for building residue-level graphs from PDB/mmCIF files.

Parameters:
  • chains (collections.abc.Iterable[str] | None) – Iterable of chain IDs to include. None includes all chains in the selected model.

  • include_waters (bool) – If True, includes water molecules (HOH) as nodes and residue–water edges.

  • residue_distance_cutoff (float) – Residue–residue and Water-residue centroid distance cutoff (Å) for adding edges.

  • store_distance_matrix (bool) – If True, keeps the residue–residue distance matrix in the returned object.

  • compute_rsa (bool) – If True, computes ASA and RSA per residue.

  • model_index (int) – Model index to load from the structure file.

  • allow_empty_chains (bool) – If False, raises when requested chains are not found.

  • granularity (Literal['all_atoms', 'backbone', 'side_chain', 'ca_only']) – Centroid policy for node coordinates. See Granularity for options.

  • verbose (bool) – Enables additional logging when supported by the caller.

allow_empty_chains: bool = False
chains: Iterable[str] | None = None
compute_rsa: bool = True
granularity: Literal['all_atoms', 'backbone', 'side_chain', 'ca_only'] = 'all_atoms'
include_ligands: bool = True
include_noncanonical_residues: bool = True
include_waters: bool = True
make_virtual_cb_for_gly: bool = True
max_gap_helix: int = 0
model_index: int = 0
residue_distance_cutoff: float = 10.0
store_distance_matrix: bool = True
verbose: bool = False
MHCXGraph.core.config.make_default_config(*, edge_threshold: float = 10.0, granularity: Literal['all_atoms', 'backbone', 'side_chain', 'ca_only'] = 'all_atoms', chains: Iterable[str] | None = None, compute_rsa: bool = True, make_virtual_cb_for_gly: bool = True, include_noncanonical_residues: bool = True, include_ligands: bool = True, include_waters: bool = True, verbose: bool = False, max_gap_helix: int = 0) GraphConfig[source]

Helper for creating a GraphConfig with common defaults.

Parameters:
  • edge_threshold – Residue–residue distance cutoff (Å).

  • granularity – Centroid policy for node coordinates.

  • include_waters – If True, includes water molecules as nodes.

  • chains – Iterable of chain IDs to include; None includes all chains.

  • compute_rsa – If True, computes ASA/RSA per residue.

Returns:

Ready-to-use configuration instance.

Return type:

GraphConfig

Classes

DSSPConfig([executable])

Compatibility shim for call paths expecting a DSSP configuration object.

GraphConfig([chains, include_waters, ...])

Unified configuration for building residue-level graphs from PDB/mmCIF files.

Functions

make_default_config(*[, edge_threshold, ...])

Helper for creating a GraphConfig with common defaults.