tooluniverse.boltz_tool module¶
- class tooluniverse.boltz_tool.BaseTool(tool_config)[source][source]¶
Bases:
object
- classmethod get_default_config_file()[source][source]¶
Get the path to the default configuration file for this tool type.
This method uses a robust path resolution strategy that works across different installation scenarios:
Installed packages: Uses importlib.resources for proper package resource access
Development mode: Falls back to file-based path resolution
Legacy Python: Handles importlib.resources and importlib_resources
Override this method in subclasses to specify a custom defaults file.
- Returns:
Path or resource object pointing to the defaults file
- tooluniverse.boltz_tool.register_tool(tool_type_name=None, config=None)[source][source]¶
Decorator to automatically register tool classes and their configs.
- Usage:
@register_tool(‘CustomToolName’, config={…}) class MyTool:
pass
- class tooluniverse.boltz_tool.Boltz2DockingTool(tool_config: dict)[source][source]¶
Bases:
BaseTool
Tool to perform protein-ligand docking and affinity prediction using the local Boltz-2 model. This tool constructs a YAML input file, runs the
boltz predict
command, and parses the output to return the predicted structure and affinity.- __init__(tool_config: dict)[source][source]¶
Initializes the BoltzDockingTool. Checks if the ‘boltz’ command is available in the system’s PATH.
- run(arguments: dict | None = None, timeout: int = 1200) dict [source][source]¶
Executes the Boltz prediction.
- Parameters:
arguments (dict) – A dictionary containing the necessary inputs. - protein_sequence (str): The amino acid sequence of the protein. - ligands (list[dict]): A list of ligands, each with a ‘smiles’ or ‘ccd’ key. - constraints (list[dict], optional): Covalent bonds or other constraints. - templates (list[dict], optional): Structural templates. - other optional boltz CLI flags (e.g., ‘recycling_steps’).
timeout (int) – The maximum time in seconds to wait for the Boltz command to complete.
- Returns:
A dictionary containing the path to the predicted structure and affinity data, or an error.
- Return type: