MHCXGraph.core.subgraphs.extract_subgraph_from_secondary_structure¶
- MHCXGraph.core.subgraphs.extract_subgraph_from_secondary_structure(g: Graph, ss_elements: list[str], 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 secondary structure label.
- Parameters:
g (nx.Graph) – Input graph. Nodes must carry ‘ss’.
ss_elements (list of str) – Allowed secondary structure labels.
inverse (bool, default=False) – If True, exclude ss_elements.
filter_dataframe – See
extract_subgraph_from_node_list().recompute_distmat – See
extract_subgraph_from_node_list().update_coords – See
extract_subgraph_from_node_list().return_node_list – See
extract_subgraph_from_node_list().
- Returns:
Subgraph or node list.
- Return type:
- Raises:
ProteinGraphConfigurationError – If any node lacks the ‘ss’ attribute.