# yigang-chen/scope-dti architecture

> Architecture diagram of the GitHub repository yigang-chen/scope-dti, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yigang-chen/scope-dti
- Repository: https://github.com/yigang-chen/scope-dti

## Overview

SCOPE-DTI trains and evaluates a drug–target interaction predictor. The principal workflow loads configured train/validation/test interaction tables, prepares drug and protein features in either 3D graph or 1D sequence mode, batches them into the model, and trains/evaluates interaction scores. The graph preserves both protein-processing branches, drug representation, bilinear fusion, and evaluation outputs. Edges follow shown imports/calls or README descriptions; some internal model dispatch and dataset-construction details are unsampled, so those relationships are omitted rather than inferred.

Main entry points: [`main.py`](https://github.com/yigang-chen/scope-dti/blob/main/main.py) (Experiment runner), [`models.py`](https://github.com/yigang-chen/scope-dti/blob/main/models.py) (SCOPE predictor), [`dataloader.py`](https://github.com/yigang-chen/scope-dti/blob/main/dataloader.py) (DTI datasets), [`trainer.py`](https://github.com/yigang-chen/scope-dti/blob/main/trainer.py) (Trainer and evaluation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_run["Run orchestration"]
  node_config["Configuration<br/>[configs.py]"]
  node_entry["Experiment runner<br/>[main.py]"]
end

subgraph group_data["Data preparation"]
  node_tables["Interaction splits"]
  node_coordinates["Protein coordinates"]
  node_dataset["DTI datasets<br/>[dataloader.py]"]
  node_graphbuild["Protein graph builder<br/>[graph_utils.py]"]
  node_batching["Feature encoding and batching<br/>[utils.py]"]
end

subgraph group_model["Prediction model"]
  node_drug["Drug GVP encoder<br/>[models.py]"]
  node_protein_graph["Protein graph encoder<br/>[models.py]"]
  node_protein_seq["Protein sequence CNN<br/>[models.py]"]
  node_gvp["GVP layers<br/>[gvp.py]"]
  node_fusion["Bilinear attention fusion<br/>[ban.py]"]
  node_classifier["Interaction classifier<br/>[models.py]"]
  node_scope["SCOPE predictor<br/>[models.py]"]
end

subgraph group_learn["Training and results"]
  node_trainer["Trainer and evaluation<br/>[trainer.py]"]
  node_results["Metrics and checkpoints<br/>[trainer.py]"]
end

node_user(("Researcher"))

node_user -->|"runs"| node_entry
node_entry -->|"loads"| node_config
node_entry -->|"reads splits"| node_tables
node_entry -->|"builds datasets"| node_dataset
node_dataset -->|"builds graphs"| node_graphbuild
node_dataset -->|"reads coordinates"| node_coordinates
node_entry -->|"selects collator"| node_batching
node_entry -->|"constructs"| node_scope
node_scope -->|"encodes drug"| node_drug
node_scope -->|"encodes graph"| node_protein_graph
node_scope -->|"encodes sequence"| node_protein_seq
node_drug -->|"uses layers"| node_gvp
node_scope -->|"fuses features"| node_fusion
node_fusion -->|"scores interaction"| node_classifier
node_entry -->|"starts training"| node_trainer
node_trainer -->|"trains and evaluates"| node_scope
node_trainer -->|"writes metrics"| node_results

click node_config "https://github.com/yigang-chen/scope-dti/blob/main/configs.py"
click node_entry "https://github.com/yigang-chen/scope-dti/blob/main/main.py"
click node_tables "https://github.com/yigang-chen/scope-dti/tree/main/data/demo_data"
click node_coordinates "https://github.com/yigang-chen/scope-dti/blob/main/data/demo_unip_cords.pkl"
click node_dataset "https://github.com/yigang-chen/scope-dti/blob/main/dataloader.py"
click node_graphbuild "https://github.com/yigang-chen/scope-dti/blob/main/graph_utils.py"
click node_batching "https://github.com/yigang-chen/scope-dti/blob/main/utils.py"
click node_drug "https://github.com/yigang-chen/scope-dti/blob/main/models.py"
click node_protein_graph "https://github.com/yigang-chen/scope-dti/blob/main/models.py"
click node_protein_seq "https://github.com/yigang-chen/scope-dti/blob/main/models.py"
click node_gvp "https://github.com/yigang-chen/scope-dti/blob/main/gvp.py"
click node_fusion "https://github.com/yigang-chen/scope-dti/blob/main/ban.py"
click node_classifier "https://github.com/yigang-chen/scope-dti/blob/main/models.py"
click node_scope "https://github.com/yigang-chen/scope-dti/blob/main/models.py"
click node_trainer "https://github.com/yigang-chen/scope-dti/blob/main/trainer.py"
click node_results "https://github.com/yigang-chen/scope-dti/blob/main/trainer.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_config,node_entry toneBlue
class node_tables,node_coordinates,node_dataset,node_graphbuild,node_batching toneAmber
class node_drug,node_protein_graph,node_protein_seq,node_gvp,node_fusion,node_classifier,node_scope toneMint
class node_trainer,node_results toneRose
class node_user toneIndigo
```

## Components

### Run orchestration

- [Configuration](https://github.com/yigang-chen/scope-dti/blob/main/configs.py): `configs.py`
- [Experiment runner](https://github.com/yigang-chen/scope-dti/blob/main/main.py): `main.py`

### Data preparation

- [Interaction splits](https://github.com/yigang-chen/scope-dti/tree/main/data/demo_data): `data/demo_data`
- [Protein coordinates](https://github.com/yigang-chen/scope-dti/blob/main/data/demo_unip_cords.pkl): `data/demo_unip_cords.pkl`
- [DTI datasets](https://github.com/yigang-chen/scope-dti/blob/main/dataloader.py): `dataloader.py`
- [Protein graph builder](https://github.com/yigang-chen/scope-dti/blob/main/graph_utils.py): `graph_utils.py`
- [Feature encoding and batching](https://github.com/yigang-chen/scope-dti/blob/main/utils.py): `utils.py`

### Prediction model

- [Drug GVP encoder](https://github.com/yigang-chen/scope-dti/blob/main/models.py): `models.py`
- [Protein graph encoder](https://github.com/yigang-chen/scope-dti/blob/main/models.py): `models.py`
- [Protein sequence CNN](https://github.com/yigang-chen/scope-dti/blob/main/models.py): `models.py`
- [GVP layers](https://github.com/yigang-chen/scope-dti/blob/main/gvp.py): `gvp.py`
- [Bilinear attention fusion](https://github.com/yigang-chen/scope-dti/blob/main/ban.py): `ban.py`
- [Interaction classifier](https://github.com/yigang-chen/scope-dti/blob/main/models.py): `models.py`
- [SCOPE predictor](https://github.com/yigang-chen/scope-dti/blob/main/models.py): `models.py`

### Training and results

- [Trainer and evaluation](https://github.com/yigang-chen/scope-dti/blob/main/trainer.py): `trainer.py`
- [Metrics and checkpoints](https://github.com/yigang-chen/scope-dti/blob/main/trainer.py): `trainer.py`

### Other components

- **Researcher**

## Connections

- Researcher → Experiment runner: runs (evidence: `README.md`)
- Experiment runner → Configuration: loads (evidence: `main.py`)
- Experiment runner → Interaction splits: reads splits (evidence: `main.py`)
- Experiment runner → DTI datasets: builds datasets (evidence: `main.py`)
- DTI datasets → Protein graph builder: builds graphs (evidence: `dataloader.py`)
- DTI datasets → Protein coordinates: reads coordinates (evidence: `dataloader.py`)
- Experiment runner → Feature encoding and batching: selects collator (evidence: `main.py`)
- Experiment runner → SCOPE predictor: constructs (evidence: `main.py`)
- SCOPE predictor → Drug GVP encoder: encodes drug (evidence: `models.py`)
- SCOPE predictor → Protein graph encoder: encodes graph (evidence: `models.py`)
- SCOPE predictor → Protein sequence CNN: encodes sequence (evidence: `models.py`)
- Drug GVP encoder → GVP layers: uses layers (evidence: `models.py`)
- SCOPE predictor → Bilinear attention fusion: fuses features (evidence: `models.py`)
- Bilinear attention fusion → Interaction classifier: scores interaction (evidence: `models.py`)
- Experiment runner → Trainer and evaluation: starts training (evidence: `main.py`)
- Trainer and evaluation → SCOPE predictor: trains and evaluates (evidence: `trainer.py`)
- Trainer and evaluation → Metrics and checkpoints: writes metrics (evidence: `trainer.py`)
