# fixfoul1/dna-aiagent architecture

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

- Interactive diagram: https://gitdiagram.com/fixfoul1/dna-aiagent
- Repository: https://github.com/fixfoul1/dna-aiagent

## Overview

This is a DNA mutation-analysis application with a Streamlit dashboard and a separate command-line Gemini agent. The main workflow accepts reference and sample sequences, asks Gemini to orchestrate deterministic bioinformatics tools, then displays sequence metrics and an explanatory report. The toolkit covers GC content, reverse complements, translation, and global-alignment mutation classification. Source excerpts show the dashboard’s tool setup and calls; the README documents the broader capabilities. The CLI is a separate entry point.

Main entry points: [`app.py`](https://github.com/fixfoul1/dna-aiagent/blob/main/app.py) (Streamlit dashboard), [`agent.py`](https://github.com/fixfoul1/dna-aiagent/blob/main/agent.py) (Command-line agent), [`dna_tools.py`](https://github.com/fixfoul1/dna-aiagent/blob/main/dna_tools.py) (GC content)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interfaces"]
  node_dashboard["Streamlit dashboard<br/>[app.py]"]
  node_report["Metrics and report<br/>[app.py]"]
  node_cli["Command-line agent<br/>[agent.py]"]
end

subgraph group_agent["AI orchestration"]
end

subgraph group_analysis["DNA analysis"]
  node_gc["GC content<br/>[dna_tools.py]"]
  node_complement["Reverse complement<br/>[dna_tools.py]"]
  node_translation["DNA translation<br/>[dna_tools.py]"]
  node_mutations["Global alignment mutations<br/>[dna_tools.py]"]
end

node_user(("User"))
node_gemini["Gemini API"]
node_biopython["Biopython"]

node_user -->|"enters sequences"| node_dashboard
node_dashboard -->|"sends query"| node_gemini
node_dashboard -->|"calculates metrics"| node_gc
node_dashboard -->|"offers tool"| node_complement
node_dashboard -->|"offers tool"| node_translation
node_dashboard -->|"offers tool"| node_mutations
node_gemini -->|"returns response"| node_dashboard
node_dashboard -->|"renders results"| node_report
node_user -->|"provides prompt"| node_cli
node_cli -->|"sends prompt"| node_gemini
node_cli -->|"offers tool"| node_gc
node_cli -->|"offers tool"| node_complement
node_cli -->|"offers tool"| node_translation
node_cli -->|"offers tool"| node_mutations
node_gc -->|"uses Seq"| node_biopython
node_complement -->|"uses Seq"| node_biopython
node_translation -->|"uses Seq"| node_biopython
node_mutations -->|"uses aligner"| node_biopython

click node_dashboard "https://github.com/fixfoul1/dna-aiagent/blob/main/app.py"
click node_report "https://github.com/fixfoul1/dna-aiagent/blob/main/app.py"
click node_cli "https://github.com/fixfoul1/dna-aiagent/blob/main/agent.py"
click node_gc "https://github.com/fixfoul1/dna-aiagent/blob/main/dna_tools.py"
click node_complement "https://github.com/fixfoul1/dna-aiagent/blob/main/dna_tools.py"
click node_translation "https://github.com/fixfoul1/dna-aiagent/blob/main/dna_tools.py"
click node_mutations "https://github.com/fixfoul1/dna-aiagent/blob/main/dna_tools.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_dashboard,node_report,node_cli,node_user toneBlue
class node_gc,node_complement,node_translation,node_mutations,node_gemini toneMint
class node_biopython toneIndigo
```

## Components

### User interfaces

- [Streamlit dashboard](https://github.com/fixfoul1/dna-aiagent/blob/main/app.py): `app.py`
- [Metrics and report](https://github.com/fixfoul1/dna-aiagent/blob/main/app.py): `app.py`
- [Command-line agent](https://github.com/fixfoul1/dna-aiagent/blob/main/agent.py): `agent.py`

### DNA analysis

- [GC content](https://github.com/fixfoul1/dna-aiagent/blob/main/dna_tools.py): `dna_tools.py`
- [Reverse complement](https://github.com/fixfoul1/dna-aiagent/blob/main/dna_tools.py): `dna_tools.py`
- [DNA translation](https://github.com/fixfoul1/dna-aiagent/blob/main/dna_tools.py): `dna_tools.py`
- [Global alignment mutations](https://github.com/fixfoul1/dna-aiagent/blob/main/dna_tools.py): `dna_tools.py`

### Other components

- **User**
- **Gemini API**
- **Biopython**

## Connections

- User → Streamlit dashboard: enters sequences (evidence: `app.py`)
- Streamlit dashboard → Gemini API: sends query (evidence: `app.py`)
- Streamlit dashboard → GC content: calculates metrics (evidence: `app.py`)
- Streamlit dashboard → Reverse complement: offers tool (evidence: `app.py`)
- Streamlit dashboard → DNA translation: offers tool (evidence: `app.py`)
- Streamlit dashboard → Global alignment mutations: offers tool (evidence: `app.py`)
- Gemini API → Streamlit dashboard: returns response (evidence: `app.py`)
- Streamlit dashboard → Metrics and report: renders results (evidence: `app.py`)
- User → Command-line agent: provides prompt (evidence: `agent.py`)
- Command-line agent → Gemini API: sends prompt (evidence: `agent.py`)
- Command-line agent → GC content: offers tool (evidence: `agent.py`)
- Command-line agent → Reverse complement: offers tool (evidence: `agent.py`)
- Command-line agent → DNA translation: offers tool (evidence: `agent.py`)
- Command-line agent → Global alignment mutations: offers tool (evidence: `agent.py`)
- GC content → Biopython: uses Seq (evidence: `dna_tools.py`)
- Reverse complement → Biopython: uses Seq (evidence: `dna_tools.py`)
- DNA translation → Biopython: uses Seq (evidence: `dna_tools.py`)
- Global alignment mutations → Biopython: uses aligner (evidence: `dna_tools.py`)
