ADMET Builder

From DISI
Revision as of 00:13, 7 July 2026 by Bromero (talk | contribs) (ADMET Builder is a lightweight very modular web interface for running OpenADMET predictions from typed SMILES strings. It was created to make ADMET prediction easier to use for chemists, students, and researchers who may not want to run command-line tools directly.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
  1. ADMET Builder

ADMET Builder is a lightweight web interface for running OpenADMET predictions from typed SMILES strings. It was created to make ADMET prediction easier to use for chemists, students, and researchers who may not want to run command-line tools directly.

---

    1. What It Does

ADMET Builder lets a user paste one or more SMILES strings into a web interface and run ADMET predictions.

The app returns:

- A clean results table in the browser - A downloadable CSV file - Molecular formulas calculated from SMILES - RDKit-generated 2D structure images - Click-to-enlarge structure viewing

The current OpenADMET model predicts:

- logD - Caco-2 A to B permeability - Caco-2 B to A permeability - Mouse plasma protein binding - Human plasma protein binding

---

    1. How It Works

ADMET Builder has three main parts:

| Layer | Technology | Purpose | |---|---|---| | Frontend | HTML, CSS, JavaScript | User interface, SMILES input, results table, structure display | | Backend API | Flask | Receives SMILES, runs predictions, returns results | | Prediction Engine | OpenADMET | Generates ADMET predictions from molecular input |

The browser sends SMILES strings to the backend using:

```text POST /predict-smiles ```

The Flask backend then:

1. Receives the SMILES strings. 2. Converts them into a temporary CSV file. 3. Runs the OpenADMET command-line prediction tool. 4. Reads the prediction output. 5. Generates molecular formulas and structure images using RDKit. 6. Sends results back to the web interface as JSON. 7. Provides the same results as a downloadable CSV file.

---

    1. Why It Is Modular

ADMET Builder is intentionally modular. The frontend, backend, and prediction engine are separated so each part can be changed or reused.

This means:

- The frontend can be redesigned without changing the model logic. - The Flask backend can support new endpoints. - Additional OpenADMET models can be added later. - Other chemistry tools can be wrapped using the same backend pattern. - The results table can be adapted for different prediction outputs. - The SMILES-to-structure display can be reused in other cheminformatics apps. - The app can serve as a template for future scientific web interfaces.

Because of this structure, ADMET Builder can be used not only as a lab tool, but also as a starting point for other modular research software.

---

    1. Getting The Code

Clone the repository using HTTPS:

```bash git clone https://gitlab.docking.org/bromero/admet-builder.git cd admet-builder ```

Or clone using SSH:

```bash git clone git@gitlab.docking.org:bromero/admet-builder.git cd admet-builder ```

---

    1. Requirements

ADMET Builder expects OpenADMET to already be installed in a working conda environment.

The C7 setup uses:

```bash module load anaconda3/2025.06.0 source "$(conda info --base)/etc/profile.d/conda.sh" conda activate openadmet-models ```

Python dependencies include:

- Flask - pandas - RDKit - OpenADMET models package

The app also expects the OpenADMET model directory to be available at:

```text ~/openadmet/permeability-logd-ppb-chemeleon-baseline/anvil_training ```

---

    1. Running The App

From the repository folder:

```bash cd ~/openadmet/admet-builder module load anaconda3/2025.06.0 source "$(conda info --base)/etc/profile.d/conda.sh" conda activate openadmet-models python app.py ```

The app runs on:

```text http://169.230.26.173:8501 ```

---

    1. Running In Screen

For persistent use on C7, run ADMET Builder inside `screen`.

Start a screen session:

```bash screen -S admet-builder ```

Inside screen, run:

```bash module load anaconda3/2025.06.0 source "$(conda info --base)/etc/profile.d/conda.sh" conda activate openadmet-models cd ~/openadmet/admet-builder python app.py ```

Detach from screen while keeping the app running:

```text Ctrl+A D ```

Reconnect later:

```bash screen -r admet-builder ```

List running screen sessions:

```bash screen -ls ```

Stop the app from inside screen:

```text Ctrl+C ```

---

    1. Using The Website

1. Open ADMET Builder in the browser. 2. Paste one SMILES string per line. 3. Click `RUN ADMET`. 4. View the results in the table. 5. A CSV file downloads automatically. 6. Click a molecular structure image to enlarge it.

Example input:

```text CCO c1ccccc1 CC(=O)Oc1ccccc1C(=O)O ```

---

    1. Output

The output table includes:

| Column | Meaning | |---|---| | Molecule | Molecular formula calculated from the SMILES string | | SMILES | Input molecule string | | Structure Image | RDKit-generated 2D molecular structure | | logD | Predicted distribution coefficient | | Caco-2 A to B | Predicted apical-to-basolateral permeability | | Caco-2 B to A | Predicted basolateral-to-apical permeability | | Mouse PPB | Predicted mouse plasma protein binding | | Human PPB | Predicted human plasma protein binding |

The CSV download contains the same prediction values in a machine-readable format.

---

    1. Access Through SwitchyOmega

If using SwitchyOmega, the proxy should be:

```text SOCKS5 localhost 1074 ```

The website itself is opened at:

```text http://169.230.26.173:8501 ```

The ports mean different things:

| Port | Purpose | |---|---| | 1074 | Local SOCKS5 proxy used by SwitchyOmega | | 8501 | ADMET Builder web app running on C7 |

If the SOCKS proxy is not running, start it from a Mac terminal:

```bash ssh -f -N -D 1074 bromero@epsilon.compbio.ucsf.edu ```

---

    1. Repository Structure

```text admet-builder/ ├── app.py ├── static/ │ ├── index.html │ ├── styles.css │ └── app.js └── .gitignore ```

      1. `app.py`

The Flask backend. It receives SMILES input, runs OpenADMET, generates formulas and structure images, and returns results.

      1. `static/index.html`

The main web page structure.

      1. `static/styles.css`

The UCSF-style visual design and table layout.

      1. `static/app.js`

The browser-side logic. It sends SMILES to the backend, renders the results table, downloads CSV output, and handles structure image enlargement.

---

    1. Current API Endpoint

```text POST /predict-smiles ```

Example JSON request:

```json {

 "smiles": [
   "CCO",
   "c1ccccc1",
   "CC(=O)Oc1ccccc1C(=O)O"
 ]

} ```

Example response includes:

```json {

 "csv": "...",
 "rows": [],
 "columns": []

} ```

The frontend uses this response to display results and download the CSV.

---

    1. Notes

ADMET Builder is a research tool. Its predictions are intended for screening, comparison, prioritization, and exploration.

Results should not be treated as experimental measurements.

---

    1. Attribution

Created by Benjamin "Ben" Romero (Undergrad Northwestern University '29), Summer 2026. Developed in the Irwin Lab at UCSF. Released as part of an open-source UCSF research tool; please credit the creator and lab when using or adapting this work.