# drugparadigm/se3-protacs architecture

> Architecture diagram of the GitHub repository drugparadigm/se3-protacs, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/drugparadigm/se3-protacs
- Repository: https://github.com/drugparadigm/se3-protacs

## Overview

SE3-PROTACs predicts binary PROTAC degradation activity and also provides a model-training workflow. The inference path accepts ligand SMILES and protein FASTA inputs, builds molecular graphs and protein embeddings, runs the fused model, and reports a score and class. Training loads prepared datasets, evaluates the model, and saves checkpoints. Dataset and model internals are not excerpted; their roles and some capabilities below rely on the README and SOURCE INDEX, so their internal wiring is not expanded.

Main entry points: [`casestudy.py`](https://github.com/drugparadigm/se3-protacs/blob/main/casestudy.py) (Single-sample prediction), [`main.py`](https://github.com/drugparadigm/se3-protacs/blob/main/main.py) (Training orchestration), [`train.py`](https://github.com/drugparadigm/se3-protacs/blob/main/train.py) (Optimization and validation), [`model.py`](https://github.com/drugparadigm/se3-protacs/blob/main/model.py) (Feature fusion classifier)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prep["Input preparation"]
  node_prep_script["SMILES conversion<br/>[prepare_data.py]"]
  node_embed_script["ESM precompute<br/>[pre_compute_emb.py]"]
  node_utils["Molecule and ESM utilities<br/>[utils.py]"]
end

subgraph group_learn["Model learning"]
  node_dataset["Dataset and batching<br/>[dataset.py]"]
  node_main["Training orchestration<br/>[main.py]"]
  node_train["Optimization and validation<br/>[train.py]"]
  node_protein["Protein encoders<br/>[model.py]"]
  node_molecule["Molecular graph encoders<br/>[model.py]"]
  node_fusion["Feature fusion classifier<br/>[model.py]"]
end

subgraph group_infer["Prediction"]
  node_case["Single-sample prediction<br/>[casestudy.py]"]
end

subgraph group_assets["Data and artifacts"]
  node_assets_data["PROTAC data and features"]
  node_checkpoint["Model checkpoints"]
end

node_user(("Researcher"))
node_input_user(("Input sample"))
node_result(("Degradation prediction"))

node_user -->|"prepares data"| node_prep_script
node_prep_script -->|"writes mol2"| node_assets_data
node_user -->|"precomputes embeddings"| node_embed_script
node_embed_script -->|"stores embeddings"| node_assets_data
node_main -->|"loads splits and features"| node_assets_data
node_main -->|"constructs datasets"| node_dataset
node_main -->|"initializes encoders"| node_protein
node_main -->|"initializes encoders"| node_molecule
node_main -->|"initializes model"| node_fusion
node_main -->|"starts training"| node_train
node_train -->|"trains and validates"| node_fusion
node_train -->|"saves weights"| node_checkpoint
node_input_user -->|"supplies SMILES and FASTA"| node_case
node_case -->|"builds graphs and embeddings"| node_utils
node_case -->|"uses protein encoders"| node_protein
node_case -->|"uses graph encoders"| node_molecule
node_case -->|"runs prediction"| node_fusion
node_case -->|"loads weights"| node_checkpoint
node_case -->|"reports score and class"| node_result

click node_prep_script "https://github.com/drugparadigm/se3-protacs/blob/main/prepare_data.py"
click node_embed_script "https://github.com/drugparadigm/se3-protacs/blob/main/pre_compute_emb.py"
click node_utils "https://github.com/drugparadigm/se3-protacs/blob/main/utils.py"
click node_assets_data "https://github.com/drugparadigm/se3-protacs/tree/main/data"
click node_dataset "https://github.com/drugparadigm/se3-protacs/blob/main/dataset.py"
click node_main "https://github.com/drugparadigm/se3-protacs/blob/main/main.py"
click node_train "https://github.com/drugparadigm/se3-protacs/blob/main/train.py"
click node_protein "https://github.com/drugparadigm/se3-protacs/blob/main/model.py"
click node_molecule "https://github.com/drugparadigm/se3-protacs/blob/main/model.py"
click node_fusion "https://github.com/drugparadigm/se3-protacs/blob/main/model.py"
click node_checkpoint "https://github.com/drugparadigm/se3-protacs/tree/main/model"
click node_case "https://github.com/drugparadigm/se3-protacs/blob/main/casestudy.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_prep_script,node_embed_script,node_utils toneBlue
class node_dataset,node_main,node_train,node_protein,node_molecule,node_fusion toneAmber
class node_case toneMint
class node_assets_data,node_checkpoint toneRose
class node_user,node_input_user,node_result toneIndigo
```

## Components

### Input preparation

- [SMILES conversion](https://github.com/drugparadigm/se3-protacs/blob/main/prepare_data.py): `prepare_data.py`
- [ESM precompute](https://github.com/drugparadigm/se3-protacs/blob/main/pre_compute_emb.py): `pre_compute_emb.py`
- [Molecule and ESM utilities](https://github.com/drugparadigm/se3-protacs/blob/main/utils.py): `utils.py`

### Model learning

- [Dataset and batching](https://github.com/drugparadigm/se3-protacs/blob/main/dataset.py): `dataset.py`
- [Training orchestration](https://github.com/drugparadigm/se3-protacs/blob/main/main.py): `main.py`
- [Optimization and validation](https://github.com/drugparadigm/se3-protacs/blob/main/train.py): `train.py`
- [Protein encoders](https://github.com/drugparadigm/se3-protacs/blob/main/model.py): `model.py`
- [Molecular graph encoders](https://github.com/drugparadigm/se3-protacs/blob/main/model.py): `model.py`
- [Feature fusion classifier](https://github.com/drugparadigm/se3-protacs/blob/main/model.py): `model.py`

### Prediction

- [Single-sample prediction](https://github.com/drugparadigm/se3-protacs/blob/main/casestudy.py): `casestudy.py`

### Data and artifacts

- [PROTAC data and features](https://github.com/drugparadigm/se3-protacs/tree/main/data): `data`
- [Model checkpoints](https://github.com/drugparadigm/se3-protacs/tree/main/model): `model`

### Other components

- **Researcher**
- **Input sample**
- **Degradation prediction**

## Connections

- Researcher → SMILES conversion: prepares data (evidence: `README.md`)
- SMILES conversion → PROTAC data and features: writes mol2 (evidence: `prepare_data.py`)
- Researcher → ESM precompute: precomputes embeddings (evidence: `README.md`)
- ESM precompute → PROTAC data and features: stores embeddings (evidence: `README.md`)
- Training orchestration → PROTAC data and features: loads splits and features (evidence: `main.py`)
- Training orchestration → Dataset and batching: constructs datasets (evidence: `main.py`)
- Training orchestration → Protein encoders: initializes encoders (evidence: `main.py`)
- Training orchestration → Molecular graph encoders: initializes encoders (evidence: `main.py`)
- Training orchestration → Feature fusion classifier: initializes model (evidence: `main.py`)
- Training orchestration → Optimization and validation: starts training (evidence: `main.py`)
- Optimization and validation → Feature fusion classifier: trains and validates (evidence: `train.py`)
- Optimization and validation → Model checkpoints: saves weights (evidence: `train.py`)
- Input sample → Single-sample prediction: supplies SMILES and FASTA (evidence: `README.md`)
- Single-sample prediction → Molecule and ESM utilities: builds graphs and embeddings (evidence: `casestudy.py`)
- Single-sample prediction → Protein encoders: uses protein encoders (evidence: `casestudy.py`)
- Single-sample prediction → Molecular graph encoders: uses graph encoders (evidence: `casestudy.py`)
- Single-sample prediction → Feature fusion classifier: runs prediction (evidence: `README.md`)
- Single-sample prediction → Model checkpoints: loads weights (evidence: `casestudy.py`)
- Single-sample prediction → Degradation prediction: reports score and class (evidence: `casestudy.py`)
