# xiangyang1984/pneumo-typer architecture

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

- Interactive diagram: https://gitdiagram.com/xiangyang1984/pneumo-typer
- Repository: https://github.com/xiangyang1984/pneumo-typer

## Overview

Pneumo-Typer accepts genome files and documents a workflow that extracts or predicts genes, calls MLST/cgMLST and serotype analysis, then writes predictions and capsule visualizations. The graph also includes the documented optional dataset-update capability and its datasets. Source excerpts were unavailable, so relationships are based on the README; unsampled implementation details are not inferred.

Main entry points: [`pneumo-typer.pl`](https://github.com/xiangyang1984/pneumo-typer/blob/main/pneumo-typer.pl) (Pneumo-Typer), [`update_mlstdb_cgmlstdb.pl`](https://github.com/xiangyang1984/pneumo-typer/blob/main/update_mlstdb_cgmlstdb.pl) (Dataset Updater), [`ST_tool/ST_profile.pl`](https://github.com/xiangyang1984/pneumo-typer/blob/main/ST_tool/ST_profile.pl) (MLST Analysis), [`ST_tool/ST_profile_cg.pl`](https://github.com/xiangyang1984/pneumo-typer/blob/main/ST_tool/ST_profile_cg.pl) (cgMLST Analysis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_analysis["Genome Analysis"]
  node_runner["Pneumo-Typer<br/>[pneumo-typer.pl]"]
  node_genome_prep["Genome Preparation<br/>[pneumo-typer.pl]"]
  node_prodigal["Prodigal"]
  node_blastn["BLASTN"]
  node_blat["BLAT"]
end

subgraph group_typing["Typing and Serotype"]
  node_mlst["MLST Analysis<br/>[ST_profile.pl]"]
  node_cgmlst["cgMLST Analysis<br/>[ST_profile_cg.pl]"]
  node_serotype["Serotype Prediction"]
  node_capsule["Capsule Genotyping"]
end

subgraph group_results["Results and Visualization"]
  node_tables["Result Tables<br/>[pneumo-typer.pl]"]
  node_heatmap["Gene Heatmap<br/>[heatmap.pl]"]
  node_cluster_view["Capsule Visualization"]
end

subgraph group_data["Reference Data"]
  node_updater["Dataset Updater"]
  node_mlst_data[("MLST Dataset")]
  node_cgmlst_data[("cgMLST Dataset")]
end

node_user(("Genome User"))

node_user -->|"provides genomes"| node_runner
node_runner -->|"prepares genomes"| node_genome_prep
node_genome_prep -->|"annotates genomes"| node_prodigal
node_runner -->|"runs MLST"| node_mlst
node_runner -->|"runs cgMLST"| node_cgmlst
node_runner -->|"predicts serotype"| node_serotype
node_runner -->|"assigns genotype"| node_capsule
node_mlst -->|"aligns loci"| node_blastn
node_cgmlst -->|"aligns loci"| node_blat
node_serotype -->|"matches genes"| node_blastn
node_runner -->|"outputs results"| node_tables
node_runner -->|"creates heatmap"| node_heatmap
node_runner -->|"visualizes clusters"| node_cluster_view
node_updater -->|"updates dataset"| node_mlst_data
node_updater -->|"updates dataset"| node_cgmlst_data

click node_runner "https://github.com/xiangyang1984/pneumo-typer/blob/main/pneumo-typer.pl"
click node_genome_prep "https://github.com/xiangyang1984/pneumo-typer/blob/main/pneumo-typer.pl"
click node_mlst "https://github.com/xiangyang1984/pneumo-typer/blob/main/ST_tool/ST_profile.pl"
click node_cgmlst "https://github.com/xiangyang1984/pneumo-typer/blob/main/ST_tool/ST_profile_cg.pl"
click node_serotype "https://github.com/xiangyang1984/pneumo-typer/blob/main/script/serotype_correct.pl"
click node_capsule "https://github.com/xiangyang1984/pneumo-typer/blob/main/script/capsule_genotype.pl"
click node_tables "https://github.com/xiangyang1984/pneumo-typer/blob/main/pneumo-typer.pl"
click node_heatmap "https://github.com/xiangyang1984/pneumo-typer/blob/main/script/heatmap.pl"
click node_cluster_view "https://github.com/xiangyang1984/pneumo-typer/blob/main/script/capsule_genotype.pl"
click node_updater "https://github.com/xiangyang1984/pneumo-typer/blob/main/update_mlstdb_cgmlstdb.pl"
click node_mlst_data "https://github.com/xiangyang1984/pneumo-typer/tree/main/ST_tool/database/mlst"
click node_cgmlst_data "https://github.com/xiangyang1984/pneumo-typer/tree/main/ST_tool/database/cgmlst"

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_runner,node_genome_prep,node_prodigal,node_blastn,node_blat,node_user toneBlue
class node_mlst,node_cgmlst,node_serotype,node_capsule toneAmber
class node_tables,node_heatmap,node_cluster_view toneMint
class node_updater,node_mlst_data,node_cgmlst_data toneRose
```

## Components

### Genome Analysis

- [Pneumo-Typer](https://github.com/xiangyang1984/pneumo-typer/blob/main/pneumo-typer.pl): `pneumo-typer.pl`
- [Genome Preparation](https://github.com/xiangyang1984/pneumo-typer/blob/main/pneumo-typer.pl): `pneumo-typer.pl`
- **Prodigal**
- **BLASTN**
- **BLAT**

### Typing and Serotype

- [MLST Analysis](https://github.com/xiangyang1984/pneumo-typer/blob/main/ST_tool/ST_profile.pl): `ST_tool/ST_profile.pl`
- [cgMLST Analysis](https://github.com/xiangyang1984/pneumo-typer/blob/main/ST_tool/ST_profile_cg.pl): `ST_tool/ST_profile_cg.pl`
- [Serotype Prediction](https://github.com/xiangyang1984/pneumo-typer/blob/main/script/serotype_correct.pl): `script/serotype_correct.pl`
- [Capsule Genotyping](https://github.com/xiangyang1984/pneumo-typer/blob/main/script/capsule_genotype.pl): `script/capsule_genotype.pl`

### Results and Visualization

- [Result Tables](https://github.com/xiangyang1984/pneumo-typer/blob/main/pneumo-typer.pl): `pneumo-typer.pl`
- [Gene Heatmap](https://github.com/xiangyang1984/pneumo-typer/blob/main/script/heatmap.pl): `script/heatmap.pl`
- [Capsule Visualization](https://github.com/xiangyang1984/pneumo-typer/blob/main/script/capsule_genotype.pl): `script/capsule_genotype.pl`

### Reference Data

- [Dataset Updater](https://github.com/xiangyang1984/pneumo-typer/blob/main/update_mlstdb_cgmlstdb.pl): `update_mlstdb_cgmlstdb.pl`
- [MLST Dataset](https://github.com/xiangyang1984/pneumo-typer/tree/main/ST_tool/database/mlst): `ST_tool/database/mlst`
- [cgMLST Dataset](https://github.com/xiangyang1984/pneumo-typer/tree/main/ST_tool/database/cgmlst): `ST_tool/database/cgmlst`

### Other components

- **Genome User**

## Connections

- Genome User → Pneumo-Typer: provides genomes (evidence: `README.md`)
- Pneumo-Typer → Genome Preparation: prepares genomes (evidence: `README.md`)
- Genome Preparation → Prodigal: annotates genomes (evidence: `README.md`)
- Pneumo-Typer → MLST Analysis: runs MLST (evidence: `README.md`)
- Pneumo-Typer → cgMLST Analysis: runs cgMLST (evidence: `README.md`)
- Pneumo-Typer → Serotype Prediction: predicts serotype (evidence: `README.md`)
- Pneumo-Typer → Capsule Genotyping: assigns genotype (evidence: `README.md`)
- MLST Analysis → BLASTN: aligns loci (evidence: `README.md`)
- cgMLST Analysis → BLAT: aligns loci (evidence: `README.md`)
- Serotype Prediction → BLASTN: matches genes (evidence: `README.md`)
- Pneumo-Typer → Result Tables: outputs results (evidence: `README.md`)
- Pneumo-Typer → Gene Heatmap: creates heatmap (evidence: `README.md`)
- Pneumo-Typer → Capsule Visualization: visualizes clusters (evidence: `README.md`)
- Dataset Updater → MLST Dataset: updates dataset (evidence: `README.md`)
- Dataset Updater → cgMLST Dataset: updates dataset (evidence: `README.md`)
