# bio-ontology-research-group/d4 architecture

> Architecture diagram of the GitHub repository bio-ontology-research-group/d4, 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/bio-ontology-research-group/d4
- Repository: https://github.com/bio-ontology-research-group/d4

## Overview

D4 is a research workflow for predicting drug–drug interactions and interpreting them across 11 biological mechanisms. Its principal path uses drug embeddings and labeled interaction data to tune a neural network, trains/evaluates a model, ranks candidate interactions, and records evaluation data for AUC plotting. The README documents the handoff from hyperparameter search to ANN training. The scripts use hard-coded local file paths; their external data locations and any additional mechanism-processing stages are not implemented in this tree.

Main entry points: [`ANNmodel.py`](https://github.com/bio-ontology-research-group/d4/blob/master/ANNmodel.py) (ANN training), [`Hypers.py`](https://github.com/bio-ontology-research-group/d4/blob/master/Hypers.py) (Hyperparameter search), [`AUC-code.py`](https://github.com/bio-ontology-research-group/d4/blob/master/AUC-code.py) (AUC analysis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Model inputs"]
  node_drug_embeddings["Drug embeddings"]
  node_ddi_labels["DDI labels"]
end

subgraph group_modeling["Modeling and prediction"]
  node_hyperparameter_search["Hyperparameter search<br/>[Hypers.py]"]
  node_ann_training["ANN training<br/>[ANNmodel.py]"]
  node_interaction_ranking["Interaction ranking<br/>[ANNmodel.py]"]
end

subgraph group_evaluation["Evaluation"]
  node_rank_results["Rank results<br/>[ANNmodel.py]"]
  node_auc_analysis["AUC analysis<br/>[AUC-code.py]"]
  node_auc_plot["AUC plot<br/>[AUC-code.py]"]
end

node_drug_embeddings -->|"provides vectors"| node_hyperparameter_search
node_ddi_labels -->|"provides labels"| node_hyperparameter_search
node_hyperparameter_search -->|"guides parameters"| node_ann_training
node_drug_embeddings -->|"provides vectors"| node_ann_training
node_ddi_labels -->|"provides labels"| node_ann_training
node_ann_training -->|"scores candidates"| node_interaction_ranking
node_interaction_ranking -->|"writes ranks"| node_rank_results
node_rank_results -->|"loads rank data"| node_auc_analysis
node_auc_analysis -->|"plots curves"| node_auc_plot

click node_hyperparameter_search "https://github.com/bio-ontology-research-group/d4/blob/master/Hypers.py"
click node_ann_training "https://github.com/bio-ontology-research-group/d4/blob/master/ANNmodel.py"
click node_interaction_ranking "https://github.com/bio-ontology-research-group/d4/blob/master/ANNmodel.py"
click node_rank_results "https://github.com/bio-ontology-research-group/d4/blob/master/ANNmodel.py"
click node_auc_analysis "https://github.com/bio-ontology-research-group/d4/blob/master/AUC-code.py"
click node_auc_plot "https://github.com/bio-ontology-research-group/d4/blob/master/AUC-code.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_drug_embeddings,node_ddi_labels toneBlue
class node_hyperparameter_search,node_ann_training,node_interaction_ranking toneAmber
class node_rank_results,node_auc_analysis,node_auc_plot toneMint
```

## Components

### Model inputs

- **Drug embeddings**
- **DDI labels**

### Modeling and prediction

- [Hyperparameter search](https://github.com/bio-ontology-research-group/d4/blob/master/Hypers.py): `Hypers.py`
- [ANN training](https://github.com/bio-ontology-research-group/d4/blob/master/ANNmodel.py): `ANNmodel.py`
- [Interaction ranking](https://github.com/bio-ontology-research-group/d4/blob/master/ANNmodel.py): `ANNmodel.py`

### Evaluation

- [Rank results](https://github.com/bio-ontology-research-group/d4/blob/master/ANNmodel.py): `ANNmodel.py`
- [AUC analysis](https://github.com/bio-ontology-research-group/d4/blob/master/AUC-code.py): `AUC-code.py`
- [AUC plot](https://github.com/bio-ontology-research-group/d4/blob/master/AUC-code.py): `AUC-code.py`

## Connections

- Drug embeddings → Hyperparameter search: provides vectors (evidence: `README.md`)
- DDI labels → Hyperparameter search: provides labels (evidence: `Hypers.py`)
- Hyperparameter search → ANN training: guides parameters (evidence: `README.md`)
- Drug embeddings → ANN training: provides vectors (evidence: `ANNmodel.py`)
- DDI labels → ANN training: provides labels (evidence: `ANNmodel.py`)
- ANN training → Interaction ranking: scores candidates (evidence: `ANNmodel.py`)
- Interaction ranking → Rank results: writes ranks (evidence: `ANNmodel.py`)
- Rank results → AUC analysis: loads rank data (evidence: `AUC-code.py`)
- AUC analysis → AUC plot: plots curves (evidence: `AUC-code.py`)
