# oohs/tigrfinder architecture

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

- Interactive diagram: https://gitdiagram.com/oohs/tigrfinder
- Repository: https://github.com/oohs/tigrfinder

## Overview

TIGRFinder is a command-line analyzer for detecting and annotating dual-repeat and stem-loop TIGR arrays in FASTA sequences. Its main workflow loads records, runs either or both architecture-specific detectors (optionally in worker processes), then writes CSV and GFF3 results and a run log. The README recommends preparing Tas-neighborhood sequences upstream; HMMER is not invoked by this tool. Detector internals are only partially sampled, so the graph shows documented stages and directly evidenced orchestration and output relationships, omitting uncertain internal wiring.

Main entry points: [`tigrfinder/main.py`](https://github.com/oohs/tigrfinder/blob/main/tigrfinder/main.py) (CLI orchestration), [`tigrfinder/stem_loop.py`](https://github.com/oohs/tigrfinder/blob/main/tigrfinder/stem_loop.py) (Contig filters), [`tigrfinder/dual_repeat.py`](https://github.com/oohs/tigrfinder/blob/main/tigrfinder/dual_repeat.py) (Dual-repeat detector), [`tasprofile.hmm`](https://github.com/oohs/tigrfinder/blob/main/tasprofile.hmm) (Tas HMM profile)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Input workflow"]
  node_tas_candidates["Tas candidates"]
  node_tas_profile["Tas HMM profile<br/>[tasprofile.hmm]"]
  node_loci["Tas loci FASTA"]
end

subgraph group_analysis["Array detection"]
  node_cli["CLI orchestration<br/>[main.py]"]
  node_fasta_load["FASTA loading<br/>[main.py]"]
  node_record_dispatch["Record dispatch<br/>[main.py]"]
  node_dual["Dual-repeat detector<br/>[dual_repeat.py]"]
  node_stem["Stem-loop detector<br/>[stem_loop.py]"]
  node_stem_filters["Contig filters<br/>[stem_loop.py]"]
end

subgraph group_results["Results and reporting"]
  node_dual_rows["Dual-repeat rows<br/>[dual_repeat.py]"]
  node_stem_rows["Stem-loop rows<br/>[stem_loop.py]"]
  node_csv_out["CSV annotations<br/>[main.py]"]
  node_gff_out["GFF3 annotations<br/>[main.py]"]
  node_run_log["Run log<br/>[main.py]"]
  node_annotations[("Known annotations")]
end

node_researcher(("User"))
node_safari["TIGRSafari"]

node_researcher -->|"identifies"| node_tas_candidates
node_tas_profile -.->|"screens"| node_tas_candidates
node_tas_candidates -->|"guides extraction"| node_loci
node_researcher -->|"prepares"| node_loci
node_loci -->|"supplies FASTA"| node_cli
node_researcher -->|"runs"| node_cli
node_cli -->|"parses"| node_fasta_load
node_fasta_load -->|"provides records"| node_record_dispatch
node_record_dispatch -->|"dispatches mode"| node_dual
node_record_dispatch -->|"dispatches mode"| node_stem
node_dual -->|"returns rows"| node_dual_rows
node_stem -->|"returns rows"| node_stem_rows
node_cli -->|"filters rows"| node_stem_filters
node_stem_rows -->|"supplies rows"| node_stem_filters
node_dual_rows -->|"returns results"| node_cli
node_stem_filters -->|"returns filtered rows"| node_cli
node_cli -->|"writes CSV"| node_csv_out
node_cli -->|"writes GFF3"| node_gff_out
node_cli -->|"writes log"| node_run_log
node_researcher -->|"inspects"| node_csv_out
node_researcher -->|"inspects"| node_gff_out
node_researcher -->|"inspects"| node_run_log
node_annotations -.->|"browses collection"| node_safari

click node_tas_profile "https://github.com/oohs/tigrfinder/blob/main/tasprofile.hmm"
click node_cli "https://github.com/oohs/tigrfinder/blob/main/tigrfinder/main.py"
click node_fasta_load "https://github.com/oohs/tigrfinder/blob/main/tigrfinder/main.py"
click node_record_dispatch "https://github.com/oohs/tigrfinder/blob/main/tigrfinder/main.py"
click node_dual "https://github.com/oohs/tigrfinder/blob/main/tigrfinder/dual_repeat.py"
click node_stem "https://github.com/oohs/tigrfinder/blob/main/tigrfinder/stem_loop.py"
click node_stem_filters "https://github.com/oohs/tigrfinder/blob/main/tigrfinder/stem_loop.py"
click node_dual_rows "https://github.com/oohs/tigrfinder/blob/main/tigrfinder/dual_repeat.py"
click node_stem_rows "https://github.com/oohs/tigrfinder/blob/main/tigrfinder/stem_loop.py"
click node_csv_out "https://github.com/oohs/tigrfinder/blob/main/tigrfinder/main.py"
click node_gff_out "https://github.com/oohs/tigrfinder/blob/main/tigrfinder/main.py"
click node_run_log "https://github.com/oohs/tigrfinder/blob/main/tigrfinder/main.py"
click node_annotations "https://github.com/oohs/tigrfinder/tree/main/TIGR_ANNOTATIONS_FULL"

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_tas_candidates,node_tas_profile,node_loci,node_researcher toneBlue
class node_cli,node_fasta_load,node_record_dispatch,node_dual,node_stem,node_stem_filters toneAmber
class node_dual_rows,node_stem_rows,node_csv_out,node_gff_out,node_run_log,node_annotations toneMint
class node_safari toneIndigo
```

## Components

### Input workflow

- **Tas candidates**
- [Tas HMM profile](https://github.com/oohs/tigrfinder/blob/main/tasprofile.hmm): `tasprofile.hmm`
- **Tas loci FASTA**

### Array detection

- [CLI orchestration](https://github.com/oohs/tigrfinder/blob/main/tigrfinder/main.py): `tigrfinder/main.py`
- [FASTA loading](https://github.com/oohs/tigrfinder/blob/main/tigrfinder/main.py): `tigrfinder/main.py`
- [Record dispatch](https://github.com/oohs/tigrfinder/blob/main/tigrfinder/main.py): `tigrfinder/main.py`
- [Dual-repeat detector](https://github.com/oohs/tigrfinder/blob/main/tigrfinder/dual_repeat.py): `tigrfinder/dual_repeat.py`
- [Stem-loop detector](https://github.com/oohs/tigrfinder/blob/main/tigrfinder/stem_loop.py): `tigrfinder/stem_loop.py`
- [Contig filters](https://github.com/oohs/tigrfinder/blob/main/tigrfinder/stem_loop.py): `tigrfinder/stem_loop.py`

### Results and reporting

- [Dual-repeat rows](https://github.com/oohs/tigrfinder/blob/main/tigrfinder/dual_repeat.py): `tigrfinder/dual_repeat.py`
- [Stem-loop rows](https://github.com/oohs/tigrfinder/blob/main/tigrfinder/stem_loop.py): `tigrfinder/stem_loop.py`
- [CSV annotations](https://github.com/oohs/tigrfinder/blob/main/tigrfinder/main.py): `tigrfinder/main.py`
- [GFF3 annotations](https://github.com/oohs/tigrfinder/blob/main/tigrfinder/main.py): `tigrfinder/main.py`
- [Run log](https://github.com/oohs/tigrfinder/blob/main/tigrfinder/main.py): `tigrfinder/main.py`
- [Known annotations](https://github.com/oohs/tigrfinder/tree/main/TIGR_ANNOTATIONS_FULL): `TIGR_ANNOTATIONS_FULL`

### Other components

- **User**
- **TIGRSafari**

## Connections

- User → Tas candidates: identifies
- Tas HMM profile → Tas candidates: screens
- Tas candidates → Tas loci FASTA: guides extraction
- User → Tas loci FASTA: prepares
- Tas loci FASTA → CLI orchestration: supplies FASTA
- User → CLI orchestration: runs
- CLI orchestration → FASTA loading: parses
- FASTA loading → Record dispatch: provides records
- Record dispatch → Dual-repeat detector: dispatches mode
- Record dispatch → Stem-loop detector: dispatches mode
- Dual-repeat detector → Dual-repeat rows: returns rows
- Stem-loop detector → Stem-loop rows: returns rows
- CLI orchestration → Contig filters: filters rows
- Stem-loop rows → Contig filters: supplies rows
- Dual-repeat rows → CLI orchestration: returns results
- Contig filters → CLI orchestration: returns filtered rows
- CLI orchestration → CSV annotations: writes CSV
- CLI orchestration → GFF3 annotations: writes GFF3
- CLI orchestration → Run log: writes log
- User → CSV annotations: inspects
- User → GFF3 annotations: inspects
- User → Run log: inspects
- Known annotations → TIGRSafari: browses collection
