# aidrabd/pgppred architecture

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

- Interactive diagram: https://gitdiagram.com/aidrabd/pgppred
- Repository: https://github.com/aidrabd/pgppred

## Overview

PGPpred is a command-line protein-sequence classifier. The workflow selects input FASTA files, loads the trained model, parses sequences, encodes them in batches, predicts PGP/Non-PGP classes, and writes detailed CSV and class-grouped FASTA results. Its principal runtime is implemented in one script, so several distinct responsibilities share that source path. The README documents batch and directory processing; the source excerpt confirms the dispatch and output flow. The bundled model is shown as an input artifact, not an inspected model architecture.

Main entry points: [`pgppred_predict.py`](https://github.com/aidrabd/pgppred/blob/main/pgppred_predict.py) (Prediction coordinator), [`pgppred.h5`](https://github.com/aidrabd/pgppred/blob/main/pgppred.h5) (Trained model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Input handling"]
  node_cli["CLI and file selection<br/>[pgppred_predict.py]"]
  node_fasta["FASTA parser<br/>[pgppred_predict.py]"]
end

subgraph group_prediction["Prediction"]
  node_model_file["Trained model<br/>[pgppred.h5]"]
  node_predictor["Prediction coordinator<br/>[pgppred_predict.py]"]
  node_encoder["Sequence batch encoder<br/>[pgppred_predict.py]"]
  node_classifier["CNN-RNN inference<br/>[pgppred_predict.py]"]
end

subgraph group_results["Results"]
  node_summary["Class summary<br/>[pgppred_predict.py]"]
  node_csv["Prediction CSV<br/>[pgppred_predict.py]"]
  node_grouped_fasta["Class-grouped FASTA<br/>[pgppred_predict.py]"]
end

node_user(("CLI user"))

node_user -->|"provides options"| node_cli
node_cli -->|"starts prediction"| node_predictor
node_predictor -->|"loads model"| node_model_file
node_predictor -->|"reads sequences"| node_fasta
node_predictor -->|"creates batches"| node_encoder
node_predictor -->|"requests predictions"| node_classifier
node_predictor -->|"counts classes"| node_summary
node_predictor -->|"writes predictions"| node_csv
node_predictor -->|"writes class groups"| node_grouped_fasta

click node_cli "https://github.com/aidrabd/pgppred/blob/main/pgppred_predict.py"
click node_fasta "https://github.com/aidrabd/pgppred/blob/main/pgppred_predict.py"
click node_model_file "https://github.com/aidrabd/pgppred/blob/main/pgppred.h5"
click node_predictor "https://github.com/aidrabd/pgppred/blob/main/pgppred_predict.py"
click node_encoder "https://github.com/aidrabd/pgppred/blob/main/pgppred_predict.py"
click node_classifier "https://github.com/aidrabd/pgppred/blob/main/pgppred_predict.py"
click node_summary "https://github.com/aidrabd/pgppred/blob/main/pgppred_predict.py"
click node_csv "https://github.com/aidrabd/pgppred/blob/main/pgppred_predict.py"
click node_grouped_fasta "https://github.com/aidrabd/pgppred/blob/main/pgppred_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_cli,node_fasta,node_user toneBlue
class node_model_file,node_predictor,node_encoder,node_classifier toneAmber
class node_summary,node_csv,node_grouped_fasta toneMint
```

## Components

### Input handling

- [CLI and file selection](https://github.com/aidrabd/pgppred/blob/main/pgppred_predict.py): `pgppred_predict.py`
- [FASTA parser](https://github.com/aidrabd/pgppred/blob/main/pgppred_predict.py): `pgppred_predict.py`

### Prediction

- [Trained model](https://github.com/aidrabd/pgppred/blob/main/pgppred.h5): `pgppred.h5`
- [Prediction coordinator](https://github.com/aidrabd/pgppred/blob/main/pgppred_predict.py): `pgppred_predict.py`
- [Sequence batch encoder](https://github.com/aidrabd/pgppred/blob/main/pgppred_predict.py): `pgppred_predict.py`
- [CNN-RNN inference](https://github.com/aidrabd/pgppred/blob/main/pgppred_predict.py): `pgppred_predict.py`

### Results

- [Class summary](https://github.com/aidrabd/pgppred/blob/main/pgppred_predict.py): `pgppred_predict.py`
- [Prediction CSV](https://github.com/aidrabd/pgppred/blob/main/pgppred_predict.py): `pgppred_predict.py`
- [Class-grouped FASTA](https://github.com/aidrabd/pgppred/blob/main/pgppred_predict.py): `pgppred_predict.py`

### Other components

- **CLI user**

## Connections

- CLI user → CLI and file selection: provides options (evidence: `pgppred_predict.py`)
- CLI and file selection → Prediction coordinator: starts prediction (evidence: `pgppred_predict.py`)
- Prediction coordinator → Trained model: loads model (evidence: `pgppred_predict.py`)
- Prediction coordinator → FASTA parser: reads sequences (evidence: `pgppred_predict.py`)
- Prediction coordinator → Sequence batch encoder: creates batches (evidence: `pgppred_predict.py`)
- Prediction coordinator → CNN-RNN inference: requests predictions (evidence: `pgppred_predict.py`)
- Prediction coordinator → Class summary: counts classes (evidence: `pgppred_predict.py`)
- Prediction coordinator → Prediction CSV: writes predictions (evidence: `pgppred_predict.py`)
- Prediction coordinator → Class-grouped FASTA: writes class groups (evidence: `pgppred_predict.py`)
