# bio-ontology-research-group/deepgo2 architecture

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

- Interactive diagram: https://gitdiagram.com/bio-ontology-research-group/deepgo2
- Repository: https://github.com/bio-ontology-research-group/deepgo2

## Overview

DeepGO-SE predicts Gene Ontology functions for proteins from sequence-derived features, using learned models and ontology axioms; it also supports model training, evaluation, and dataset generation. The principal user workflow is FASTA input to prediction output. Training uses prepared protein datasets and normalized GO axioms; separate scripts cover graph-attention and baseline models, while evaluation includes approximate semantic entailment. Edges reflect README workflow statements and SOURCE INDEX references; some runtime details, especially unsampled prediction and entailment internals, are not verified.

Main entry points: [`deepgo/data.py`](https://github.com/bio-ontology-research-group/deepgo2/blob/main/deepgo/data.py) (Protein datasets), [`predict.py`](https://github.com/bio-ontology-research-group/deepgo2/blob/main/predict.py) (Prediction CLI), [`deepgo/models.py`](https://github.com/bio-ontology-research-group/deepgo2/blob/main/deepgo/models.py) (GO prediction models), [`train.py`](https://github.com/bio-ontology-research-group/deepgo2/blob/main/train.py) (DeepGO training)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_dataset["Protein datasets<br/>[data.py]"]
  node_uniprot["UniProt conversion<br/>[uni2pandas.py]"]
  node_datasetgen["Dataset generation"]
end

subgraph group_runtime["Prediction"]
  node_predict["Prediction CLI<br/>[predict.py]"]
  node_esm["ESM embeddings<br/>[extract_esm.py]"]
  node_model["GO prediction models<br/>[models.py]"]
  node_ontology["GO ontology utilities<br/>[utils.py]"]
end

subgraph group_learning["Training"]
  node_axioms["Axiom loading<br/>[data.py]"]
  node_train["DeepGO training<br/>[train.py]"]
  node_gat["Graph attention training<br/>[train_gat.py]"]
  node_cnn["CNN baseline<br/>[train_cnn.py]"]
  node_mlp["MLP baseline<br/>[train_mlp.py]"]
  node_dgg["DeepGraphGO baseline<br/>[train_dgg.py]"]
  node_base["Entailment layers<br/>[base.py]"]
end

subgraph group_evaluation["Evaluation"]
  node_eval["Prediction evaluation<br/>[evaluate.py]"]
  node_entail_eval["Entailment evaluation"]
  node_metrics["GO metrics<br/>[metrics.py]"]
end

node_user(("Researcher"))
node_fasta["Protein FASTA"]
node_predictions["GO predictions"]

node_user -->|"provides sequences"| node_fasta
node_fasta -->|"supplies input"| node_predict
node_predict -->|"outputs predictions"| node_predictions
node_predict -->|"uses models"| node_model
node_predict -->|"loads data"| node_dataset
node_predict -->|"extracts embeddings"| node_esm
node_uniprot -->|"extracts embeddings"| node_esm
node_uniprot -.->|"prepares proteins"| node_datasetgen
node_datasetgen -.->|"produces training data"| node_dataset
node_train -->|"loads data"| node_dataset
node_train -->|"loads axioms"| node_axioms
node_train -->|"trains model"| node_model
node_gat -->|"loads graph data"| node_dataset
node_gat -->|"trains graph model"| node_model
node_cnn -->|"uses data"| node_dataset
node_mlp -->|"uses data"| node_dataset
node_dgg -->|"uses data"| node_dataset
node_model -->|"extends layers"| node_base
node_eval -->|"computes metrics"| node_metrics
node_entail_eval -->|"computes metrics"| node_metrics
node_eval -->|"evaluates predictions"| node_predictions
node_entail_eval -->|"evaluates entailment"| node_predictions
node_ontology -->|"provides ontology utilities"| node_metrics

click node_predict "https://github.com/bio-ontology-research-group/deepgo2/blob/main/predict.py"
click node_esm "https://github.com/bio-ontology-research-group/deepgo2/blob/main/deepgo/extract_esm.py"
click node_model "https://github.com/bio-ontology-research-group/deepgo2/blob/main/deepgo/models.py"
click node_ontology "https://github.com/bio-ontology-research-group/deepgo2/blob/main/deepgo/utils.py"
click node_dataset "https://github.com/bio-ontology-research-group/deepgo2/blob/main/deepgo/data.py"
click node_uniprot "https://github.com/bio-ontology-research-group/deepgo2/blob/main/gendata/uni2pandas.py"
click node_datasetgen "https://github.com/bio-ontology-research-group/deepgo2/tree/main/gendata"
click node_axioms "https://github.com/bio-ontology-research-group/deepgo2/blob/main/deepgo/data.py"
click node_train "https://github.com/bio-ontology-research-group/deepgo2/blob/main/train.py"
click node_gat "https://github.com/bio-ontology-research-group/deepgo2/blob/main/train_gat.py"
click node_cnn "https://github.com/bio-ontology-research-group/deepgo2/blob/main/train_cnn.py"
click node_mlp "https://github.com/bio-ontology-research-group/deepgo2/blob/main/train_mlp.py"
click node_dgg "https://github.com/bio-ontology-research-group/deepgo2/blob/main/train_dgg.py"
click node_base "https://github.com/bio-ontology-research-group/deepgo2/blob/main/deepgo/base.py"
click node_eval "https://github.com/bio-ontology-research-group/deepgo2/blob/main/evaluate.py"
click node_entail_eval "https://github.com/bio-ontology-research-group/deepgo2/blob/main/evaluate_entailment.py"
click node_metrics "https://github.com/bio-ontology-research-group/deepgo2/blob/main/deepgo/metrics.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_dataset,node_uniprot,node_datasetgen toneBlue
class node_predict,node_esm,node_model,node_ontology toneAmber
class node_axioms,node_train,node_gat,node_cnn,node_mlp,node_dgg,node_base toneMint
class node_eval,node_entail_eval,node_metrics toneRose
class node_user,node_fasta,node_predictions toneIndigo
```

## Components

### Data preparation

- [Protein datasets](https://github.com/bio-ontology-research-group/deepgo2/blob/main/deepgo/data.py): `deepgo/data.py`
- [UniProt conversion](https://github.com/bio-ontology-research-group/deepgo2/blob/main/gendata/uni2pandas.py): `gendata/uni2pandas.py`
- [Dataset generation](https://github.com/bio-ontology-research-group/deepgo2/tree/main/gendata): `gendata`

### Prediction

- [Prediction CLI](https://github.com/bio-ontology-research-group/deepgo2/blob/main/predict.py): `predict.py`
- [ESM embeddings](https://github.com/bio-ontology-research-group/deepgo2/blob/main/deepgo/extract_esm.py): `deepgo/extract_esm.py`
- [GO prediction models](https://github.com/bio-ontology-research-group/deepgo2/blob/main/deepgo/models.py): `deepgo/models.py`
- [GO ontology utilities](https://github.com/bio-ontology-research-group/deepgo2/blob/main/deepgo/utils.py): `deepgo/utils.py`

### Training

- [Axiom loading](https://github.com/bio-ontology-research-group/deepgo2/blob/main/deepgo/data.py): `deepgo/data.py`
- [DeepGO training](https://github.com/bio-ontology-research-group/deepgo2/blob/main/train.py): `train.py`
- [Graph attention training](https://github.com/bio-ontology-research-group/deepgo2/blob/main/train_gat.py): `train_gat.py`
- [CNN baseline](https://github.com/bio-ontology-research-group/deepgo2/blob/main/train_cnn.py): `train_cnn.py`
- [MLP baseline](https://github.com/bio-ontology-research-group/deepgo2/blob/main/train_mlp.py): `train_mlp.py`
- [DeepGraphGO baseline](https://github.com/bio-ontology-research-group/deepgo2/blob/main/train_dgg.py): `train_dgg.py`
- [Entailment layers](https://github.com/bio-ontology-research-group/deepgo2/blob/main/deepgo/base.py): `deepgo/base.py`

### Evaluation

- [Prediction evaluation](https://github.com/bio-ontology-research-group/deepgo2/blob/main/evaluate.py): `evaluate.py`
- [Entailment evaluation](https://github.com/bio-ontology-research-group/deepgo2/blob/main/evaluate_entailment.py): `evaluate_entailment.py`
- [GO metrics](https://github.com/bio-ontology-research-group/deepgo2/blob/main/deepgo/metrics.py): `deepgo/metrics.py`

### Other components

- **Researcher**
- **Protein FASTA**
- **GO predictions**

## Connections

- Researcher → Protein FASTA: provides sequences (evidence: `README.md`)
- Protein FASTA → Prediction CLI: supplies input (evidence: `README.md`)
- Prediction CLI → GO predictions: outputs predictions (evidence: `README.md`)
- Prediction CLI → GO prediction models: uses models (evidence: `predict.py`)
- Prediction CLI → Protein datasets: loads data (evidence: `predict.py`)
- Prediction CLI → ESM embeddings: extracts embeddings (evidence: `predict.py`)
- UniProt conversion → ESM embeddings: extracts embeddings (evidence: `gendata/uni2pandas.py`)
- UniProt conversion → Dataset generation: prepares proteins
- Dataset generation → Protein datasets: produces training data (evidence: `gendata/mfpreds_data.py`)
- DeepGO training → Protein datasets: loads data (evidence: `train.py`)
- DeepGO training → Axiom loading: loads axioms (evidence: `train.py`)
- DeepGO training → GO prediction models: trains model (evidence: `README.md`)
- Graph attention training → Protein datasets: loads graph data (evidence: `train_gat.py`)
- Graph attention training → GO prediction models: trains graph model (evidence: `README.md`)
- CNN baseline → Protein datasets: uses data (evidence: `train_cnn.py`)
- MLP baseline → Protein datasets: uses data (evidence: `train_mlp.py`)
- DeepGraphGO baseline → Protein datasets: uses data (evidence: `train_dgg.py`)
- GO prediction models → Entailment layers: extends layers (evidence: `deepgo/models.py`)
- Prediction evaluation → GO metrics: computes metrics (evidence: `evaluate.py`)
- Entailment evaluation → GO metrics: computes metrics (evidence: `evaluate_entailment.py`)
- Prediction evaluation → GO predictions: evaluates predictions (evidence: `README.md`)
- Entailment evaluation → GO predictions: evaluates entailment (evidence: `README.md`)
- GO ontology utilities → GO metrics: provides ontology utilities (evidence: `deepgo/metrics.py`)
