MHCXGraph.utils.preprocessing¶
- exception MHCXGraph.utils.preprocessing.LogicError[source]¶
Bases:
ExceptionRaised when a logical selection expression cannot be evaluated.
- MHCXGraph.utils.preprocessing.collect_selected_files_from_manifest(manifest)[source]¶
Collect structure files defined in the manifest input rules.
- MHCXGraph.utils.preprocessing.create_graphs(manifest: dict) list[tuple][source]¶
Construct filtered graphs from the manifest input structures.
The function loads structure files, builds graph representations, applies residue selection filters, and stores intermediate outputs.
- MHCXGraph.utils.preprocessing.get_exposed_residues(graph: Graph, rsa_filter: float, asa_filter: float, selection_params=None) Graph[source]¶
Generate a filtered subgraph containing exposed residues.
The function creates a residue subgraph based on solvent exposure criteria and optional structural or logical filters defined in the manifest.
- Parameters:
graph (Graph) – Graph representation of the protein structure.
rsa_filter (float) – Relative solvent accessibility threshold.
asa_filter (float) – Absolute solvent accessibility threshold.
selection_params (dict[str, Any], optional) – Additional selection constraints such as chains, residues, secondary structure elements, or logical expressions.
- Returns:
subgraph – Filtered graph containing the selected residues.
- Return type:
networkx.Graph
- Raises:
Exception – If no residues satisfy the filtering conditions.
- MHCXGraph.utils.preprocessing.list_struct_files(folder: Path, extensions: list[str]) list[Path][source]¶
Recursively list structure files inside a directory.
- Parameters:
folder (pathlib.Path) – Root directory to search.
- Returns:
files – Sorted list of structure file paths.
- Return type:
- MHCXGraph.utils.preprocessing.resolve_selection_params_for_file(file_path: Path, manifest: dict[str, Any]) dict[str, Any][source]¶
Resolve selection parameters for a specific input file.
- Parameters:
file_path (pathlib.Path) – Path to the structure file.
- Returns:
params – Combined selector parameters applied to the file.
- Return type:
Functions¶
|
Collect structure files defined in the manifest input rules. |
|
Construct filtered graphs from the manifest input structures. |
|
Generate a filtered subgraph containing exposed residues. |
|
Recursively list structure files inside a directory. |
|
Resolve selection parameters for a specific input file. |
Exceptions¶
Raised when a logical selection expression cannot be evaluated. |