ADMET-AI

repository·main·Indexed 43 days ago

https://github.com/swansonk14/admet_ai

An ADMET (Absorption, Distribution, Metabolism, Excretion, and Toxicity) prediction platform using Chemprop v2 models trained on Therapeutics Data Commons (TDC) datasets. It provides a CLI, Python API via the ADMETModel class, and a web server to predict molecular properties, compute physicochemical properties, and compare results against DrugBank reference sets using ATC codes.

Tokens
6.4K
Snippets
30
Records
32
Agent score
56%

What's inside ADMET-AI

  1. Train Chemprop ADMET predictors

    main

    Train Chemprop ADMET predictors using the multitask datasets via scripts/train_tdc_admet_all.py. The script will use a GPU by default if one is available.

    python scripts/train_tdc_admet_all.py \
        --data_dir data/tdc_admet_all_multitask \
        --save_dir models/tdc_admet_all_multitask \
        --model_type chemprop
  2. Evaluate Chemprop ADMET predictors

    main

    Evaluate Chemprop ADMET predictors trained on the TDC ADMET Benchmark Group data using scripts/evaluate_tdc_admet_all_multitask.py.

    Environment Requirement: The PyTDC environment should be used for this command.

    python scripts/evaluate_tdc_admet_all_multitask.py \
        --data_dir data/tdc_admet_all_multitask \
        --preds_dir models/tdc_admet_all_multitask/chemprop \
        --save_dir results/tdc_admet_all_multitask
  3. Create multitask datasets for regression and classification

    main

    Generate multitask datasets for regression and classification from the TDC ADMET datasets using scripts/merge_tdc_admet_multitask.py.

    python scripts/merge_tdc_admet_multitask.py \
        --data_dir data/tdc_admet_all \
        --save_dir data/tdc_admet_all_multitask
  4. Get approved drugs from DrugBank

    main

    Extract approved drugs from a drugbank.xml file (v5.1.14) to create a comparison set using scripts/get_drugbank_approved.py.

    python scripts/get_drugbank_approved.py \
        --data_path data/drugbank/drugbank.xml \
        --save_path data/drugbank/drugbank_approved.csv
  5. Filter for valid molecules

    main

    Ensure all CSV files in your dataset contain SMILES that result in valid RDKit molecules by running scripts/filter_valid_molecules.py.

    Environment Requirement: Use the general ADMET-AI Python environment with an up-to-date RDKit.

    python scripts/filter_valid_molecules.py \
        --data_dir data/tdc_admet_all \
        --smiles_column smiles
  6. Install ADMET-AI

    main

    You can install ADMET-AI using pip. It is recommended to use a conda environment. By default, the installation includes only dependencies for predictions (CLI and Python API). To include dependencies for the web server, use the [web] extra.

    Standard Installation

    # Optional: Create and activate a conda environment
    conda create -y -n admet_ai python=3.14
    conda activate admet_ai
    
    # Install via pip
    pip install admet-ai

    Local Installation from Source

    git clone https://github.com/swansonk14/admet_ai.git
    cd admet_ai
    pip install -e .

    Install Web Server Dependencies

    pip install admet-ai[web]

    Troubleshooting

    If you encounter ImportError: libXrender.so.1: cannot open shared object file: No such file or directory, run:

    conda install -c conda-forge xorg-libxrender
    pip install admet-ai
  7. Download TDC ADMET data

    main

    To download all TDC ADME and Tox datasets for training, use the scripts/prepare_tdc_admet_all.py script.

    Environment Requirement: This specific command requires a Python 3.10 environment containing PyTDC==1.1.15 and typed-argument-parser==1.11.0. Note that PyTDC is incompatible with the standard ADMET-AI environment requirements.

    python scripts/prepare_tdc_admet_all.py \
        --save_dir data/tdc_admet_all \
        --skip_datasets herg_central hERG_Karim ToxCast
  8. Generate ADMET analysis plots

    main

    You can generate DrugBank reference plots and radial summary plots locally using provided scripts. Both scripts require a CSV file containing ADMET-AI predictions as input.

    • DrugBank reference plots: Use scripts/plot_drugbank_reference.py
    • Radial summary plots: Use scripts/plot_radial_summaries.py
  9. Use the ADMET-AI Python module

    main

    You can integrate ADMET predictions into your Python workflows using the ADMETModel class from the admet_ai module.

    Behavior:

    • If you pass a single SMILES string, predict() returns a dictionary mapping property names to values.
    • If you pass a list of SMILES strings, predict() returns a Pandas DataFrame where the index is the SMILES and the columns are the properties.
    from admet_ai import ADMETModel
    
    model = ADMETModel()
    # Returns a dictionary
    preds = model.predict(smiles="O(c1ccc(cc1)CCOC)CC(O)CNC(C)C")
    
    # If passing a list, returns a Pandas DataFrame
    # preds = model.predict(smiles=["SMILES1", "SMILES2"])
  10. Create a 2D scatter plot comparing new molecules to DrugBank reference set

    main

    Use plot_drugbank_reference to generate a 2D scatter plot that overlays new molecule predictions (preds_df) on top of a DrugBank reference dataset (drugbank_df). The plot includes marginal histograms for the selected properties.

    Parameters:

    • preds_df (pd.DataFrame): Predictions for the new molecules.
    • drugbank_df (pd.DataFrame): The DrugBank reference set.
    • x_property_name (str, optional): Name of the property for the x-axis. Defaults to `
  11. Make predictions on DrugBank approved drugs

    main

    Use the admet_predict CLI tool to make ADMET predictions and compute physicochemical properties on DrugBank approved drugs using a Chemprop multitask predictor.

    admet_predict \
        --data_path data/drugbank/drugbank_approved.csv \
        --save_path admet_ai/resources/data/drugbank_approved.csv \
        --models_dir models/tdc_admet_all_multitask/chemprop \
        --smiles_column smiles \
        --drugbank_path None
  12. Use the ADMET-AI command line tool

    main

    Use the admet_predict command to generate ADMET predictions from a file containing SMILES strings.

    Arguments:

    • --data_path: Path to the input file (e.g., a CSV).
    • --save_path: Path where the prediction results will be saved.
    • --smiles_column: The name of the column in the input file containing the SMILES strings.
    admet_predict \
        --data_path data.csv \
        --save_path preds.csv \
        --smiles_column smiles