# liushuotong/oggi architecture

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

- Interactive diagram: https://gitdiagram.com/liushuotong/oggi
- Repository: https://github.com/liushuotong/oggi

## Overview

OGGI is a command-line toolkit for plant pangenome analyses. Its main workflow prepares assembly annotations and proteins, identifies target-family genes, evaluates local synteny, then compares clustering methods and reports candidate partitions. Separate branches construct BUSCO-based species trees, infer family HOGs from gene and species trees, and run whole-proteome OrthoFinder or standalone tool wrappers. The graph follows documented command-level workflows and sampled caller behavior; unsampled implementation details are represented only at supported module or directory paths.

Main entry points: [`oggi.py`](https://github.com/liushuotong/oggi/blob/main/oggi.py) (OGGI CLI), [`sub_collinearity.py`](https://github.com/liushuotong/oggi/blob/main/sub_collinearity.py) (Local synteny), [`cluster_engine/hog_tree.py`](https://github.com/liushuotong/oggi/blob/main/cluster_engine/hog_tree.py) (Family HOG inference), [`cluster_engine`](https://github.com/liushuotong/oggi/tree/main/cluster_engine) (Cluster engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Family workflow"]
  node_cli["OGGI CLI<br/>[oggi.py]"]
  node_reduce["Assembly reduction"]
  node_identify["Family identification"]
  node_familydata["Family FASTA and map"]
  node_subcoli["Local synteny"]
  node_collinearity["Collinearity algorithms<br/>[collinearity.py]"]
  node_pairs["Collinear pairs"]
end

subgraph group_phylogeny["Trees and HOGs"]
  node_busco["BUSCO assessment<br/>[busco_process.py]"]
  node_buscores["BUSCO results"]
  node_speciestree["Species-tree inference<br/>[species_tree.py]"]
  node_tree["Species tree"]
  node_hog["Family HOG inference<br/>[hog_tree.py]"]
  node_hogcore["HOG algorithms"]
end

subgraph group_cluster["Clustering and evaluation"]
  node_clusterengine["Cluster engine"]
  node_clusteroutputs["Partitions and reports"]
end

subgraph group_wrappers["Tool integrations"]
  node_orthofinder["Whole-proteome OrthoFinder"]
  node_hogimport["OrthoFinder HOG import<br/>[hog_import.py]"]
  node_wrappers["Standalone wrappers<br/>[oggi.py]"]
end

node_researcher(("Researcher"))
node_externaltools{{"Bioinformatics tools"}}
node_inputs["GFF and genome inputs"]

node_researcher -->|"invokes"| node_cli
node_inputs -->|"provides inputs"| node_cli
node_cli -->|"dispatches reduce"| node_reduce
node_reduce -.->|"uses AGAT tools"| node_externaltools
node_reduce -->|"prepared assemblies"| node_identify
node_cli -->|"dispatches identify"| node_identify
node_identify -->|"searches with HMMER and DIAMOND"| node_externaltools
node_identify -->|"writes FASTA and map"| node_familydata
node_cli -->|"dispatches subcoli"| node_subcoli
node_familydata -->|"supplies family map"| node_subcoli
node_subcoli -->|"searches with DIAMOND"| node_externaltools
node_subcoli -->|"calls"| node_collinearity
node_subcoli -->|"writes observed pairs"| node_pairs
node_cli -->|"dispatches cluster"| node_clusterengine
node_familydata -->|"supplies targets"| node_clusterengine
node_pairs -->|"supplies evidence"| node_clusterengine
node_clusterengine -.->|"uses clustering tools"| node_externaltools
node_clusterengine -->|"writes partitions and reports"| node_clusteroutputs
node_cli -->|"dispatches busco"| node_busco
node_busco -->|"runs BUSCO"| node_externaltools
node_busco -->|"writes results"| node_buscores
node_cli -->|"dispatches species-tree"| node_speciestree
node_buscores -->|"supplies loci"| node_speciestree
node_speciestree -->|"uses MAFFT and IQ-TREE"| node_externaltools
node_speciestree -->|"writes Newick"| node_tree
node_cli -->|"dispatches hog-tree"| node_hog
node_familydata -->|"supplies family sequences"| node_hog
node_tree -->|"supplies species tree"| node_hog
node_hog -->|"calls"| node_hogcore
node_hog -->|"writes HOG assignments"| node_clusteroutputs
node_cli -->|"dispatches orthofinder"| node_orthofinder
node_orthofinder -->|"runs OrthoFinder"| node_externaltools
node_cli -->|"dispatches HOG import"| node_hogimport
node_orthofinder -->|"provides results"| node_hogimport
node_cli -->|"dispatches wrappers"| node_wrappers
node_wrappers -->|"runs selected tool"| node_externaltools

click node_cli "https://github.com/liushuotong/oggi/blob/main/oggi.py"
click node_reduce "https://github.com/liushuotong/oggi/tree/main/reduce_rs"
click node_identify "https://github.com/liushuotong/oggi/blob/main/gene_family_identification.py"
click node_subcoli "https://github.com/liushuotong/oggi/blob/main/sub_collinearity.py"
click node_collinearity "https://github.com/liushuotong/oggi/blob/main/collinearity.py"
click node_clusterengine "https://github.com/liushuotong/oggi/tree/main/cluster_engine"
click node_busco "https://github.com/liushuotong/oggi/blob/main/busco_process.py"
click node_speciestree "https://github.com/liushuotong/oggi/blob/main/species_tree.py"
click node_hog "https://github.com/liushuotong/oggi/blob/main/cluster_engine/hog_tree.py"
click node_hogcore "https://github.com/liushuotong/oggi/tree/main/orthofinder_hog"
click node_orthofinder "https://github.com/liushuotong/oggi/blob/main/orthofinder_process.py"
click node_hogimport "https://github.com/liushuotong/oggi/blob/main/cluster_engine/hog_import.py"
click node_wrappers "https://github.com/liushuotong/oggi/blob/main/oggi.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_reduce,node_identify,node_familydata,node_subcoli,node_collinearity,node_pairs toneBlue
class node_busco,node_buscores,node_speciestree,node_tree,node_hog,node_hogcore toneAmber
class node_clusterengine,node_clusteroutputs toneMint
class node_orthofinder,node_hogimport,node_wrappers toneRose
class node_researcher,node_externaltools,node_inputs toneIndigo
```

## Components

### Family workflow

- [OGGI CLI](https://github.com/liushuotong/oggi/blob/main/oggi.py): `oggi.py`
- [Assembly reduction](https://github.com/liushuotong/oggi/tree/main/reduce_rs): `reduce_rs`
- [Family identification](https://github.com/liushuotong/oggi/blob/main/gene_family_identification.py): `gene_family_identification.py`
- **Family FASTA and map**
- [Local synteny](https://github.com/liushuotong/oggi/blob/main/sub_collinearity.py): `sub_collinearity.py`
- [Collinearity algorithms](https://github.com/liushuotong/oggi/blob/main/collinearity.py): `collinearity.py`
- **Collinear pairs**

### Trees and HOGs

- [BUSCO assessment](https://github.com/liushuotong/oggi/blob/main/busco_process.py): `busco_process.py`
- **BUSCO results**
- [Species-tree inference](https://github.com/liushuotong/oggi/blob/main/species_tree.py): `species_tree.py`
- **Species tree**
- [Family HOG inference](https://github.com/liushuotong/oggi/blob/main/cluster_engine/hog_tree.py): `cluster_engine/hog_tree.py`
- [HOG algorithms](https://github.com/liushuotong/oggi/tree/main/orthofinder_hog): `orthofinder_hog`

### Clustering and evaluation

- [Cluster engine](https://github.com/liushuotong/oggi/tree/main/cluster_engine): `cluster_engine`
- **Partitions and reports**

### Tool integrations

- [Whole-proteome OrthoFinder](https://github.com/liushuotong/oggi/blob/main/orthofinder_process.py): `orthofinder_process.py`
- [OrthoFinder HOG import](https://github.com/liushuotong/oggi/blob/main/cluster_engine/hog_import.py): `cluster_engine/hog_import.py`
- [Standalone wrappers](https://github.com/liushuotong/oggi/blob/main/oggi.py): `oggi.py`

### Other components

- **Researcher**
- **Bioinformatics tools**
- **GFF and genome inputs**

## Connections

- Researcher → OGGI CLI: invokes
- GFF and genome inputs → OGGI CLI: provides inputs
- OGGI CLI → Assembly reduction: dispatches reduce
- Assembly reduction → Bioinformatics tools: uses AGAT tools
- Assembly reduction → Family identification: prepared assemblies
- OGGI CLI → Family identification: dispatches identify
- Family identification → Bioinformatics tools: searches with HMMER and DIAMOND
- Family identification → Family FASTA and map: writes FASTA and map
- OGGI CLI → Local synteny: dispatches subcoli
- Family FASTA and map → Local synteny: supplies family map
- Local synteny → Bioinformatics tools: searches with DIAMOND
- Local synteny → Collinearity algorithms: calls
- Local synteny → Collinear pairs: writes observed pairs
- OGGI CLI → Cluster engine: dispatches cluster
- Family FASTA and map → Cluster engine: supplies targets
- Collinear pairs → Cluster engine: supplies evidence
- Cluster engine → Bioinformatics tools: uses clustering tools
- Cluster engine → Partitions and reports: writes partitions and reports
- OGGI CLI → BUSCO assessment: dispatches busco
- BUSCO assessment → Bioinformatics tools: runs BUSCO
- BUSCO assessment → BUSCO results: writes results
- OGGI CLI → Species-tree inference: dispatches species-tree
- BUSCO results → Species-tree inference: supplies loci
- Species-tree inference → Bioinformatics tools: uses MAFFT and IQ-TREE
- Species-tree inference → Species tree: writes Newick
- OGGI CLI → Family HOG inference: dispatches hog-tree
- Family FASTA and map → Family HOG inference: supplies family sequences
- Species tree → Family HOG inference: supplies species tree
- Family HOG inference → HOG algorithms: calls
- Family HOG inference → Partitions and reports: writes HOG assignments
- OGGI CLI → Whole-proteome OrthoFinder: dispatches orthofinder
- Whole-proteome OrthoFinder → Bioinformatics tools: runs OrthoFinder
- OGGI CLI → OrthoFinder HOG import: dispatches HOG import
- Whole-proteome OrthoFinder → OrthoFinder HOG import: provides results
- OGGI CLI → Standalone wrappers: dispatches wrappers
- Standalone wrappers → Bioinformatics tools: runs selected tool
