ADMET Builder: Difference between revisions

From DISI
Jump to navigation Jump to search
(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.)
 
No edit summary
Line 1: Line 1:
# ADMET Builder
= ADMET Builder (OpenADMET) =


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.
== Introduction ==


---
As of 7/6/26, '''ADMET Builder''' is an internal Irwin Lab web tool for submitting one or more compounds in SMILES format and receiving OpenADMET prediction results.


## What It Does
The current backend runs on C7 using the `openadmet-models` conda environment.


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


The app returns:
* Molecular formula
* SMILES string
* RDKit-generated 2D structure image
* logD
* Caco-2 A to B permeability
* Caco-2 B to A permeability
* Mouse plasma protein binding
* Human plasma protein binding
* Downloadable CSV output


- A clean results table in the browser
Created by Benjamin "Ben" Romero (Undergrad Northwestern University '29), Summer 2026.<br>
- A downloadable CSV file
Developed in the Irwin Lab at UCSF.
- Molecular formulas calculated from SMILES
- RDKit-generated 2D structure images
- Click-to-enlarge structure viewing


The current OpenADMET model predicts:
== How to Login ==


- logD
Log into C7:
- Caco-2 A to B permeability
- Caco-2 B to A permeability
- Mouse plasma protein binding
- Human plasma protein binding


---
<pre>
ssh USER@epsilon.compbio.ucsf.edu
</pre>


## How It Works
Confirm location:


ADMET Builder has three main parts:
<pre>
hostname
pwd
</pre>


| Layer | Technology | Purpose |
== How to Open Website With SwitchyOmega ==
|---|---|---|
| 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:
If using SwitchyOmega, use:


```text
<pre>
POST /predict-smiles
Protocol: SOCKS5
```
Host: localhost
Port: 1074
</pre>


The Flask backend then:
Then open:


1. Receives the SMILES strings.
<pre>
2. Converts them into a temporary CSV file.
http://169.230.26.173:8501
3. Runs the OpenADMET command-line prediction tool.
</pre>
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.


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


## Why It Is Modular
<pre>
ssh -f -N -D 1074 USER@epsilon.compbio.ucsf.edu
</pre>


ADMET Builder is intentionally modular. The frontend, backend, and prediction engine are separated so each part can be changed or reused.
When finished, switch SwitchyOmega back to Direct.


This means:
== Where The Website Lives ==
 
Project directory on C7:


- The frontend can be redesigned without changing the model logic.
<pre>
- The Flask backend can support new endpoints.
~/openadmet/admet-builder
- Additional OpenADMET models can be added later.
</pre>
- 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.
Important files:


---
<pre>
app.py
static/index.html
static/styles.css
static/app.js
.gitignore
</pre>


## Getting The Code
== Repository ==


Clone the repository using HTTPS:
GitLab repository:


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


Or clone using SSH:
Clone using HTTPS:


```bash
<pre>
git clone git@gitlab.docking.org:bromero/admet-builder.git
git clone https://gitlab.docking.org/USERNAME/admet-builder.git
cd admet-builder
cd admet-builder
```
</pre>


---
Clone using SSH:


## Requirements
<pre>
git clone git@gitlab.docking.org:USERNAME/admet-builder.git
cd admet-builder
</pre>


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


The C7 setup uses:
The backend uses the OpenADMET conda environment:


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


Python dependencies include:
Python dependencies include:


- Flask
* Flask
- pandas
* pandas
- RDKit
* RDKit
- OpenADMET models package
* OpenADMET models package


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


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


## Running The App
== How to Start Backend ==


From the repository folder:
On C7:


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


The app runs on:
The backend runs on:


```text
<pre>
http://0.0.0.0:8501
</pre>
 
The browser URL is:
 
<pre>
http://169.230.26.173:8501
http://169.230.26.173:8501
```
</pre>


---
Test from C7:


## Running In Screen
<pre>
curl http://127.0.0.1:8501
</pre>


For persistent use on C7, run ADMET Builder inside `screen`.
== How to Keep Backend Running ==


Start a screen session:
Use screen:


```bash
<pre>
screen -S admet-builder
screen -S admet-builder
```
Inside screen, run:
```bash
module load anaconda3/2025.06.0
module load anaconda3/2025.06.0
source "$(conda info --base)/etc/profile.d/conda.sh"
source "$(conda info --base)/etc/profile.d/conda.sh"
Line 156: Line 165:
cd ~/openadmet/admet-builder
cd ~/openadmet/admet-builder
python app.py
python app.py
```
</pre>


Detach from screen while keeping the app running:
Detach:


```text
<pre>
Ctrl+A
Ctrl-A
D
D
```
</pre>


Reconnect later:
Reconnect:


```bash
<pre>
screen -r admet-builder
screen -r admet-builder
```
</pre>


List running screen sessions:
List screens:


```bash
<pre>
screen -ls
screen -ls
```
</pre>


Stop the app from inside screen:
Stop backend:


```text
<pre>
Ctrl+C
screen -r admet-builder
```
Ctrl-C
 
exit
---
</pre>
 
## Using The Website


1. Open ADMET Builder in the browser.
== Test Input ==
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:
Example SMILES input:


```text
<pre>
CCO
CCO
c1ccccc1
c1ccccc1
CC(=O)Oc1ccccc1C(=O)O
CC(=O)Oc1ccccc1C(=O)O
```
</pre>
 
Larger test molecule:
 
<pre>
CC(C)Cc1ccc(cc1)[C@@H](C)C(=O)O
</pre>
 
== Test API With curl ==
 
Test the API from C7:
 
<pre>
curl -X POST http://127.0.0.1:8501/predict-smiles \
  -H "Content-Type: application/json" \
  -d '{"smiles":["CCO","c1ccccc1","CC(=O)Oc1ccccc1C(=O)O"]}'
</pre>
 
== Current API Endpoint ==
 
Main endpoint:
 
<pre>
POST /predict-smiles
</pre>
 
Example JSON request:
 
<pre>
{
  "smiles": [
    "CCO",
    "c1ccccc1",
    "CC(=O)Oc1ccccc1C(=O)O"
  ]
}
</pre>
 
Example response contains:
 
<pre>
{
  "csv": "...",
  "rows": [],
  "columns": []
}
</pre>
 
The frontend uses this response to display the results table and automatically download the CSV.
 
== How It Works ==


---
ADMET Builder has three major parts:


## Output
{| class="wikitable"
! Layer
! Technology
! Purpose
|-
| Frontend
| HTML, CSS, JavaScript
| User interface, SMILES input, results table, and structure image display
|-
| Backend API
| Flask
| Receives SMILES, runs predictions, and returns results
|-
| Prediction Engine
| OpenADMET
| Generates ADMET predictions from molecular input
|}


The output table includes:
Backend flow:


| Column | Meaning |
# Receives SMILES strings from the website.
|---|---|
# Converts the SMILES into a temporary CSV file.
| Molecule | Molecular formula calculated from the SMILES string |
# Runs the OpenADMET command-line prediction tool.
| SMILES | Input molecule string |
# Reads the OpenADMET output CSV.
| Structure Image | RDKit-generated 2D molecular structure |
# Uses RDKit to calculate molecular formulas.
| logD | Predicted distribution coefficient |
# Uses RDKit to generate 2D molecular structure images.
| Caco-2 A to B | Predicted apical-to-basolateral permeability |
# Sends results back to the web interface as JSON.
| Caco-2 B to A | Predicted basolateral-to-apical permeability |
# Provides the same results as a downloadable CSV file.
| 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.
== Modularity ==


---
ADMET Builder is modular by design. The frontend, backend, and prediction engine are separated so each part can be reused or replaced.


## Access Through SwitchyOmega
This means:


If using SwitchyOmega, the proxy should be:
* 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.


```text
Because of this structure, ADMET Builder can be used both as a working lab tool and as a starting point for other modular research software.
SOCKS5
localhost
1074
```


The website itself is opened at:
== Output ==


```text
The output table includes:
http://169.230.26.173:8501
 
```
{| class="wikitable"
! 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.


The ports mean different things:
== Troubleshooting ==


| Port | Purpose |
=== Site Cannot Be Reached ===
|---|---|
| 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:
Check that:


```bash
* Backend is running on C7.
ssh -f -N -D 1074 bromero@epsilon.compbio.ucsf.edu
* The app is running on port 8501.
```
* SwitchyOmega is set to SOCKS5 localhost port 1074.
* The browser is using:


---
<pre>
http://169.230.26.173:8501
</pre>


## Repository Structure
=== SwitchyOmega Proxy Error ===


```text
If Chrome says the proxy failed, the SOCKS proxy may not be running.
admet-builder/
├── app.py
├── static/
│  ├── index.html
│  ├── styles.css
│  └── app.js
└── .gitignore
```


### `app.py`
Start it from a Mac terminal:


The Flask backend. It receives SMILES input, runs OpenADMET, generates formulas and structure images, and returns results.
<pre>
ssh -f -N -D 1074 USER@epsilon.compbio.ucsf.edu
</pre>


### `static/index.html`
SwitchyOmega should be:


The main web page structure.
<pre>
Protocol: SOCKS5
Host: localhost
Port: 1074
</pre>


### `static/styles.css`
=== Port Already In Use ===


The UCSF-style visual design and table layout.
Check port 8501:


### `static/app.js`
<pre>
ss -ltnp | grep 8501
</pre>


The browser-side logic. It sends SMILES to the backend, renders the results table, downloads CSV output, and handles structure image enlargement.
Only kill processes owned by you:


---
<pre>
kill PID_NUMBER
</pre>


## Current API Endpoint
=== Missing pandas or Flask ===


```text
This usually means the conda environment is not active.
POST /predict-smiles
```


Example JSON request:
Run:


```json
<pre>
{
module load anaconda3/2025.06.0
  "smiles": [
source "$(conda info --base)/etc/profile.d/conda.sh"
    "CCO",
conda activate openadmet-models
    "c1ccccc1",
</pre>
    "CC(=O)Oc1ccccc1C(=O)O"
  ]
}
```


Example response includes:
=== RDKit Image Error ===


```json
Make sure the app is running inside the `openadmet-models` environment, which includes RDKit.
{
  "csv": "...",
  "rows": [],
  "columns": []
}
```


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


---
<pre>
python -c "from rdkit import Chem; print('rdkit works')"
</pre>


## Notes
== Notes ==


ADMET Builder is a research tool. Its predictions are intended for screening, comparison, prioritization, and exploration.
ADMET Builder is a research tool. Its predictions are intended for screening, comparison, prioritization, and exploration.
Line 322: Line 411:
Results should not be treated as experimental measurements.
Results should not be treated as experimental measurements.


---
For office-wide use without SSH/SOCKS tunnels, ADMET Builder should eventually be placed behind an internal hostname or proxy.


## Attribution
== Attribution ==


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

Revision as of 00:18, 7 July 2026

ADMET Builder (OpenADMET)

Introduction

As of 7/6/26, ADMET Builder is an internal Irwin Lab web tool for submitting one or more compounds in SMILES format and receiving OpenADMET prediction results.

The current backend runs on C7 using the `openadmet-models` conda environment.

ADMET Builder returns:

  • Molecular formula
  • SMILES string
  • RDKit-generated 2D structure image
  • logD
  • Caco-2 A to B permeability
  • Caco-2 B to A permeability
  • Mouse plasma protein binding
  • Human plasma protein binding
  • Downloadable CSV output

Created by Benjamin "Ben" Romero (Undergrad Northwestern University '29), Summer 2026.
Developed in the Irwin Lab at UCSF.

How to Login

Log into C7:

ssh USER@epsilon.compbio.ucsf.edu

Confirm location:

hostname
pwd

How to Open Website With SwitchyOmega

If using SwitchyOmega, use:

Protocol: SOCKS5
Host: localhost
Port: 1074

Then open:

http://169.230.26.173:8501

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

ssh -f -N -D 1074 USER@epsilon.compbio.ucsf.edu

When finished, switch SwitchyOmega back to Direct.

Where The Website Lives

Project directory on C7:

~/openadmet/admet-builder

Important files:

app.py
static/index.html
static/styles.css
static/app.js
.gitignore

Repository

GitLab repository:

https://gitlab.docking.org/USERNAME/admet-builder

Clone using HTTPS:

git clone https://gitlab.docking.org/USERNAME/admet-builder.git
cd admet-builder

Clone using SSH:

git clone git@gitlab.docking.org:USERNAME/admet-builder.git
cd admet-builder

Environment

The backend uses the OpenADMET conda environment:

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 OpenADMET model directory is expected at:

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

How to Start Backend

On C7:

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

The backend runs on:

http://0.0.0.0:8501

The browser URL is:

http://169.230.26.173:8501

Test from C7:

curl http://127.0.0.1:8501

How to Keep Backend Running

Use screen:

screen -S admet-builder
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:

Ctrl-A
D

Reconnect:

screen -r admet-builder

List screens:

screen -ls

Stop backend:

screen -r admet-builder
Ctrl-C
exit

Test Input

Example SMILES input:

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

Larger test molecule:

CC(C)Cc1ccc(cc1)[C@@H](C)C(=O)O

Test API With curl

Test the API from C7:

curl -X POST http://127.0.0.1:8501/predict-smiles \
  -H "Content-Type: application/json" \
  -d '{"smiles":["CCO","c1ccccc1","CC(=O)Oc1ccccc1C(=O)O"]}'

Current API Endpoint

Main endpoint:

POST /predict-smiles

Example JSON request:

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

Example response contains:

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

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

How It Works

ADMET Builder has three major parts:

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

Backend flow:

  1. Receives SMILES strings from the website.
  2. Converts the SMILES into a temporary CSV file.
  3. Runs the OpenADMET command-line prediction tool.
  4. Reads the OpenADMET output CSV.
  5. Uses RDKit to calculate molecular formulas.
  6. Uses RDKit to generate 2D molecular structure images.
  7. Sends results back to the web interface as JSON.
  8. Provides the same results as a downloadable CSV file.

Modularity

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

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 both as a working lab tool and as a starting point for other modular research software.

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.

Troubleshooting

Site Cannot Be Reached

Check that:

  • Backend is running on C7.
  • The app is running on port 8501.
  • SwitchyOmega is set to SOCKS5 localhost port 1074.
  • The browser is using:
http://169.230.26.173:8501

SwitchyOmega Proxy Error

If Chrome says the proxy failed, the SOCKS proxy may not be running.

Start it from a Mac terminal:

ssh -f -N -D 1074 USER@epsilon.compbio.ucsf.edu

SwitchyOmega should be:

Protocol: SOCKS5
Host: localhost
Port: 1074

Port Already In Use

Check port 8501:

ss -ltnp | grep 8501

Only kill processes owned by you:

kill PID_NUMBER

Missing pandas or Flask

This usually means the conda environment is not active.

Run:

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

RDKit Image Error

Make sure the app is running inside the `openadmet-models` environment, which includes RDKit.

Test RDKit:

python -c "from rdkit import Chem; print('rdkit works')"

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.

For office-wide use without SSH/SOCKS tunnels, ADMET Builder should eventually be placed behind an internal hostname or proxy.

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.