MHCXGraph.core.subgraphs.extract_surface_subgraph_asa

MHCXGraph.core.subgraphs.extract_surface_subgraph_asa(g: Graph, asa_threshold: float, inverse: bool = False, filter_dataframe: bool = True, recompute_distmat: bool = False, update_coords: bool = True, return_node_list: bool = False) Graph | list[str] | None[source]

Select nodes by absolute solvent accessibility (ASA).

Parameters:
  • g (nx.Graph) – Input graph. Nodes are expected to carry ‘asa’ (float, in Å^2).

  • asa_threshold (float) – Minimum ASA to include.

  • inverse (bool, default=False) – If True, include ASA < threshold.

  • filter_dataframe (bool, default=True) – Filter graph-level DataFrames to subgraph nodes.

  • recompute_distmat (bool, default=False) – Recompute graph[‘dist_mat’] from pdb_df if available.

  • update_coords (bool, default=True) – Rebuild graph[‘coords’] from node attributes.

  • return_node_list (bool, default=False) – If True, return the resolved node list instead of a subgraph.

Returns:

Subgraph or node list.

Return type:

nx.Graph or list of str