tooluniverse.admetai_tool module¶
- class tooluniverse.admetai_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.admetai_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.admetai_tool.ADMETModel(models_dir: Path | str = PosixPath('/opt/hostedtoolcache/Python/3.10.18/x64/lib/python3.10/site-packages/admet_ai/resources/models'), include_physchem: bool = True, drugbank_path: Path | str | None = PosixPath('/opt/hostedtoolcache/Python/3.10.18/x64/lib/python3.10/site-packages/admet_ai/resources/data/drugbank_approved.csv'), atc_code: str | None = None, num_workers: int | None = None, cache_molecules: bool = True, fingerprint_multiprocessing_min: int = 100)[source][source]¶
Bases:
object
ADMET-AI model class.
- __init__(models_dir: Path | str = PosixPath('/opt/hostedtoolcache/Python/3.10.18/x64/lib/python3.10/site-packages/admet_ai/resources/models'), include_physchem: bool = True, drugbank_path: Path | str | None = PosixPath('/opt/hostedtoolcache/Python/3.10.18/x64/lib/python3.10/site-packages/admet_ai/resources/data/drugbank_approved.csv'), atc_code: str | None = None, num_workers: int | None = None, cache_molecules: bool = True, fingerprint_multiprocessing_min: int = 100) None [source][source]¶
Initialize the ADMET-AI model.
- Parameters:
models_dir – Path to a directory containing subdirectories, each of which contains an ensemble of Chemprop-RDKit models.
include_physchem – Whether to include physicochemical properties in the predictions.
drugbank_path – Path to a CSV file containing DrugBank approved molecules with ADMET predictions and ATC codes.
atc_code – The ATC code to filter the DrugBank reference set by. If None, the entire DrugBank reference set will be used.
num_workers – Number of workers for the data loader. Zero workers (i.e., sequential data loading) may be faster if not using a GPU, while multiple workers (e.g., 8) are faster with a GPU. If None, defaults to 0 if no GPU is available and 8 if a GPU is available.
cache_molecules – Whether to cache molecules. Caching improves prediction speed but requires more memory.
fingerprint_multiprocessing_min – Minimum number of molecules for multiprocessing to be used for fingerprint computation. Otherwise, single processing is used.
- predict(smiles: str | list[str]) dict[str, float] | DataFrame [source][source]¶
Make predictions on a list of SMILES strings.
- Parameters:
smiles – A SMILES string or a list of SMILES strings.
- Returns:
If smiles is a string, returns a dictionary mapping property name to prediction. If smiles is a list, returns a DataFrame containing the predictions with SMILES strings as the index and property names as the columns.