# yuexujiang/deepdom architecture

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

- Interactive diagram: https://gitdiagram.com/yuexujiang/deepdom
- Repository: https://github.com/yuexujiang/deepdom

## Overview

DeepDom predicts protein domain-boundary scores from amino-acid sequences, and also supports training custom sequence models. The main prediction workflow is sequence input → preprocessing with dataprocess.pl → model inference in predict.py → per-residue scores written to an output file. The training branch preprocesses sequences and boundary labels, trains the stacked bidirectional LSTM in train.py, and saves a model usable for prediction. The README documents preprocessing behavior and model choices; source excerpts show inference, score aggregation, and training, but not dataprocess.pl internals.

Main entry points: [`predict.py`](https://github.com/yuexujiang/deepdom/blob/master/predict.py) (LSTM inference), [`dataprocess.pl`](https://github.com/yuexujiang/deepdom/blob/master/dataprocess.pl) (Sequence preprocessing), [`train.py`](https://github.com/yuexujiang/deepdom/blob/master/train.py) (Model training), [`foldmodel_bilstmwrapper_4sum200_80_40nr_sliwin.h5`](https://github.com/yuexujiang/deepdom/blob/master/foldmodel_bilstmwrapper_4sum200_80_40nr_sliwin.h5) (Pretrained GPU model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prep["Data preparation"]
  node_preprocess["Sequence preprocessing<br/>[dataprocess.pl]"]
end

subgraph group_learning["Model training"]
  node_train["Model training<br/>[train.py]"]
  node_trained_model[("Custom model<br/>[train.py]")]
end

subgraph group_inference["Boundary prediction"]
  node_gpu_model[("Pretrained GPU model")]
  node_cpu_model[("Pretrained CPU model<br/>[cpu_model.h5]")]
  node_input_reader["Processed input reader<br/>[predict.py]"]
  node_encoding["Residue encoding<br/>[predict.py]"]
  node_inference_engine["LSTM inference<br/>[predict.py]"]
  node_score_merge["Window score aggregation<br/>[predict.py]"]
end

node_user(("Researcher"))
node_sequence["Protein sequences"]
node_annotations["Boundary labels"]
node_result["Residue scores"]

node_user -->|"provides"| node_sequence
node_user -->|"provides"| node_annotations
node_sequence -->|"preprocesses"| node_preprocess
node_annotations -->|"preprocesses"| node_preprocess
node_preprocess -->|"provides processed data"| node_train
node_preprocess -->|"provides processed sequences"| node_input_reader
node_user -->|"starts training"| node_train
node_train -->|"saves"| node_trained_model
node_user -->|"starts prediction"| node_input_reader
node_input_reader -->|"reads sequences"| node_encoding
node_encoding -->|"encodes residues"| node_inference_engine
node_inference_engine -->|"loads by default"| node_gpu_model
node_inference_engine -->|"loads when selected"| node_cpu_model
node_inference_engine -->|"loads when selected"| node_trained_model
node_inference_engine -->|"predicts window scores"| node_score_merge
node_score_merge -->|"writes residue scores"| node_result
node_user -->|"receives output"| node_result

click node_preprocess "https://github.com/yuexujiang/deepdom/blob/master/dataprocess.pl"
click node_train "https://github.com/yuexujiang/deepdom/blob/master/train.py"
click node_trained_model "https://github.com/yuexujiang/deepdom/blob/master/train.py"
click node_gpu_model "https://github.com/yuexujiang/deepdom/blob/master/foldmodel_bilstmwrapper_4sum200_80_40nr_sliwin.h5"
click node_cpu_model "https://github.com/yuexujiang/deepdom/blob/master/cpu_model.h5"
click node_input_reader "https://github.com/yuexujiang/deepdom/blob/master/predict.py"
click node_encoding "https://github.com/yuexujiang/deepdom/blob/master/predict.py"
click node_inference_engine "https://github.com/yuexujiang/deepdom/blob/master/predict.py"
click node_score_merge "https://github.com/yuexujiang/deepdom/blob/master/predict.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_preprocess toneBlue
class node_train,node_trained_model toneAmber
class node_gpu_model,node_cpu_model,node_input_reader,node_encoding,node_inference_engine,node_score_merge toneMint
class node_user,node_sequence,node_annotations,node_result toneIndigo
```

## Components

### Data preparation

- [Sequence preprocessing](https://github.com/yuexujiang/deepdom/blob/master/dataprocess.pl): `dataprocess.pl`

### Model training

- [Model training](https://github.com/yuexujiang/deepdom/blob/master/train.py): `train.py`
- [Custom model](https://github.com/yuexujiang/deepdom/blob/master/train.py): `train.py`

### Boundary prediction

- [Pretrained GPU model](https://github.com/yuexujiang/deepdom/blob/master/foldmodel_bilstmwrapper_4sum200_80_40nr_sliwin.h5): `foldmodel_bilstmwrapper_4sum200_80_40nr_sliwin.h5`
- [Pretrained CPU model](https://github.com/yuexujiang/deepdom/blob/master/cpu_model.h5): `cpu_model.h5`
- [Processed input reader](https://github.com/yuexujiang/deepdom/blob/master/predict.py): `predict.py`
- [Residue encoding](https://github.com/yuexujiang/deepdom/blob/master/predict.py): `predict.py`
- [LSTM inference](https://github.com/yuexujiang/deepdom/blob/master/predict.py): `predict.py`
- [Window score aggregation](https://github.com/yuexujiang/deepdom/blob/master/predict.py): `predict.py`

### Other components

- **Researcher**
- **Protein sequences**
- **Boundary labels**
- **Residue scores**

## Connections

- Researcher → Protein sequences: provides (evidence: `README.md`)
- Researcher → Boundary labels: provides (evidence: `README.md`)
- Protein sequences → Sequence preprocessing: preprocesses (evidence: `README.md`)
- Boundary labels → Sequence preprocessing: preprocesses (evidence: `README.md`)
- Sequence preprocessing → Model training: provides processed data (evidence: `README.md`)
- Sequence preprocessing → Processed input reader: provides processed sequences (evidence: `README.md`)
- Researcher → Model training: starts training (evidence: `README.md`)
- Model training → Custom model: saves (evidence: `train.py`)
- Researcher → Processed input reader: starts prediction (evidence: `README.md`)
- Processed input reader → Residue encoding: reads sequences (evidence: `predict.py`)
- Residue encoding → LSTM inference: encodes residues (evidence: `predict.py`)
- LSTM inference → Pretrained GPU model: loads by default (evidence: `predict.py`)
- LSTM inference → Pretrained CPU model: loads when selected (evidence: `README.md`)
- LSTM inference → Custom model: loads when selected (evidence: `README.md`)
- LSTM inference → Window score aggregation: predicts window scores (evidence: `predict.py`)
- Window score aggregation → Residue scores: writes residue scores (evidence: `predict.py`)
- Researcher → Residue scores: receives output (evidence: `README.md`)
