# broadinstitute/del-ml-refactor architecture

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

- Interactive diagram: https://gitdiagram.com/broadinstitute/del-ml-refactor
- Repository: https://github.com/broadinstitute/del-ml-refactor

## Overview

This repository supports DEL screening analysis and a reusable molecular prediction workflow. For new compounds, users prepare SMILES, extract Morgan fingerprints, and run a pretrained MLP; Chemprop GNN prediction and t-SNE visualization are documented alternatives or follow-on analyses. Separate DOS-DEL, HitGen, and MSigma scripts handle dataset-specific processing, stratification, and statistics. Some pipeline stages are documented or implied by input/output files but not connected in the sampled code, so those links are omitted or marked unverified.

Main entry points: [`feature_extractor.py`](https://github.com/broadinstitute/del-ml-refactor/blob/main/feature_extractor.py) (Morgan Features), [`example/compound.csv`](https://github.com/broadinstitute/del-ml-refactor/blob/main/example/compound.csv) (Compound SMILES), [`tsne.py`](https://github.com/broadinstitute/del-ml-refactor/blob/main/tsne.py) (t-SNE Embedding), [`data/DOS-DEL/preprocess.py`](https://github.com/broadinstitute/del-ml-refactor/blob/main/data/DOS-DEL/preprocess.py) (Readout Preprocessing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inference["Molecular Inference"]
  node_fingerprints["Morgan Features"]
  node_mlp["MLP Prediction<br/>[prediction.py]"]
  node_models["Pretrained Models"]
  node_chemprop["Chemprop GNN"]
  node_embedding["t-SNE Embedding<br/>[tsne.py]"]
  node_embedded_data["Embedding Outputs"]
end

subgraph group_dos["DOS-DEL Analysis"]
  node_dos_raw["DOS-DEL Screens"]
  node_dos_preprocess["Readout Preprocessing<br/>[preprocess.py]"]
  node_dos_stratify["Hit Stratification<br/>[stratify.py]"]
  node_dos_stats["Library Statistics<br/>[statistics.py]"]
end

subgraph group_hitgen["HitGen Analysis"]
  node_hitgen_raw["HitGen Screens"]
  node_hitgen_stratify["Hit Stratification<br/>[stratify.py]"]
  node_hitgen_stats["Effect-Size Statistics<br/>[statistic.py]"]
end

subgraph group_msigma["MSigma Analysis"]
  node_msigma_raw["MSigma Screens"]
  node_msigma_stratify["Hit Stratification<br/>[stratify.py]"]
  node_msigma_stats["Z-Score Statistics<br/>[statistic.py]"]
end

node_user(("Researcher"))
node_compounds["Compound SMILES<br/>[compound.csv]"]

node_user -->|"prepares SMILES"| node_compounds
node_compounds -->|"extracts features"| node_fingerprints
node_fingerprints -->|"supplies features"| node_mlp
node_models -->|"loads checkpoint"| node_mlp
node_user -.->|"runs prediction"| node_chemprop
node_compounds -->|"supplies SMILES"| node_chemprop
node_fingerprints -->|"supplies features"| node_embedding
node_embedding -->|"writes embedding"| node_embedded_data
node_dos_raw -->|"loads screens"| node_dos_preprocess
node_dos_preprocess -.->|"provides readouts"| node_dos_stratify
node_dos_stratify -.->|"provides strata"| node_dos_stats
node_hitgen_raw -->|"reads screen data"| node_hitgen_stratify
node_hitgen_stratify -->|"provides strata"| node_hitgen_stats
node_msigma_raw -->|"reads screen data"| node_msigma_stratify
node_msigma_stratify -->|"provides strata"| node_msigma_stats

click node_compounds "https://github.com/broadinstitute/del-ml-refactor/blob/main/example/compound.csv"
click node_fingerprints "https://github.com/broadinstitute/del-ml-refactor/blob/main/feature_extractor.py"
click node_mlp "https://github.com/broadinstitute/del-ml-refactor/blob/main/prediction.py"
click node_models "https://github.com/broadinstitute/del-ml-refactor/tree/main/data/HitGen/models"
click node_embedding "https://github.com/broadinstitute/del-ml-refactor/blob/main/tsne.py"
click node_embedded_data "https://github.com/broadinstitute/del-ml-refactor/tree/main/visualization"
click node_dos_raw "https://github.com/broadinstitute/del-ml-refactor/tree/main/data/DOS-DEL/raw"
click node_dos_preprocess "https://github.com/broadinstitute/del-ml-refactor/blob/main/data/DOS-DEL/preprocess.py"
click node_dos_stratify "https://github.com/broadinstitute/del-ml-refactor/blob/main/data/DOS-DEL/stratify.py"
click node_dos_stats "https://github.com/broadinstitute/del-ml-refactor/blob/main/data/DOS-DEL/statistics.py"
click node_hitgen_raw "https://github.com/broadinstitute/del-ml-refactor/tree/main/data/HitGen/raw"
click node_hitgen_stratify "https://github.com/broadinstitute/del-ml-refactor/blob/main/data/HitGen/stratify.py"
click node_hitgen_stats "https://github.com/broadinstitute/del-ml-refactor/blob/main/data/HitGen/statistic.py"
click node_msigma_raw "https://github.com/broadinstitute/del-ml-refactor/tree/main/data/MSigma/raw"
click node_msigma_stratify "https://github.com/broadinstitute/del-ml-refactor/blob/main/data/MSigma/stratify.py"
click node_msigma_stats "https://github.com/broadinstitute/del-ml-refactor/blob/main/data/MSigma/statistic.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_fingerprints,node_mlp,node_models,node_chemprop,node_embedding,node_embedded_data toneBlue
class node_dos_raw,node_dos_preprocess,node_dos_stratify,node_dos_stats toneAmber
class node_hitgen_raw,node_hitgen_stratify,node_hitgen_stats toneMint
class node_msigma_raw,node_msigma_stratify,node_msigma_stats toneRose
class node_user toneIndigo
class node_compounds toneTeal
```

## Components

### Molecular Inference

- [Morgan Features](https://github.com/broadinstitute/del-ml-refactor/blob/main/feature_extractor.py): `feature_extractor.py`
- [MLP Prediction](https://github.com/broadinstitute/del-ml-refactor/blob/main/prediction.py): `prediction.py`
- [Pretrained Models](https://github.com/broadinstitute/del-ml-refactor/tree/main/data/HitGen/models): `data/HitGen/models`
- **Chemprop GNN**
- [t-SNE Embedding](https://github.com/broadinstitute/del-ml-refactor/blob/main/tsne.py): `tsne.py`
- [Embedding Outputs](https://github.com/broadinstitute/del-ml-refactor/tree/main/visualization): `visualization`

### DOS-DEL Analysis

- [DOS-DEL Screens](https://github.com/broadinstitute/del-ml-refactor/tree/main/data/DOS-DEL/raw): `data/DOS-DEL/raw`
- [Readout Preprocessing](https://github.com/broadinstitute/del-ml-refactor/blob/main/data/DOS-DEL/preprocess.py): `data/DOS-DEL/preprocess.py`
- [Hit Stratification](https://github.com/broadinstitute/del-ml-refactor/blob/main/data/DOS-DEL/stratify.py): `data/DOS-DEL/stratify.py`
- [Library Statistics](https://github.com/broadinstitute/del-ml-refactor/blob/main/data/DOS-DEL/statistics.py): `data/DOS-DEL/statistics.py`

### HitGen Analysis

- [HitGen Screens](https://github.com/broadinstitute/del-ml-refactor/tree/main/data/HitGen/raw): `data/HitGen/raw`
- [Hit Stratification](https://github.com/broadinstitute/del-ml-refactor/blob/main/data/HitGen/stratify.py): `data/HitGen/stratify.py`
- [Effect-Size Statistics](https://github.com/broadinstitute/del-ml-refactor/blob/main/data/HitGen/statistic.py): `data/HitGen/statistic.py`

### MSigma Analysis

- [MSigma Screens](https://github.com/broadinstitute/del-ml-refactor/tree/main/data/MSigma/raw): `data/MSigma/raw`
- [Hit Stratification](https://github.com/broadinstitute/del-ml-refactor/blob/main/data/MSigma/stratify.py): `data/MSigma/stratify.py`
- [Z-Score Statistics](https://github.com/broadinstitute/del-ml-refactor/blob/main/data/MSigma/statistic.py): `data/MSigma/statistic.py`

### Other components

- **Researcher**
- [Compound SMILES](https://github.com/broadinstitute/del-ml-refactor/blob/main/example/compound.csv): `example/compound.csv`

## Connections

- Researcher → Compound SMILES: prepares SMILES (evidence: `README.md`)
- Compound SMILES → Morgan Features: extracts features (evidence: `README.md`)
- Morgan Features → MLP Prediction: supplies features (evidence: `README.md`)
- Pretrained Models → MLP Prediction: loads checkpoint (evidence: `prediction.py`)
- Researcher → Chemprop GNN: runs prediction (evidence: `README.md`)
- Compound SMILES → Chemprop GNN: supplies SMILES (evidence: `README.md`)
- Morgan Features → t-SNE Embedding: supplies features (evidence: `README.md`)
- t-SNE Embedding → Embedding Outputs: writes embedding (evidence: `tsne.py`)
- DOS-DEL Screens → Readout Preprocessing: loads screens (evidence: `data/DOS-DEL/preprocess.py`)
- Readout Preprocessing → Hit Stratification: provides readouts
- Hit Stratification → Library Statistics: provides strata
- HitGen Screens → Hit Stratification: reads screen data (evidence: `data/HitGen/stratify.py`)
- Hit Stratification → Effect-Size Statistics: provides strata (evidence: `data/HitGen/statistic.py`)
- MSigma Screens → Hit Stratification: reads screen data (evidence: `data/MSigma/stratify.py`)
- Hit Stratification → Z-Score Statistics: provides strata (evidence: `data/MSigma/statistic.py`)
