# barricklab/breseq architecture

> Architecture diagram of the GitHub repository barricklab/breseq, 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/barricklab/breseq
- Repository: https://github.com/barricklab/breseq

## Overview

breseq analyzes sequencing reads against a reference genome to identify and report candidate mutations. The principal workflow is read/reference input, alignment and alignment resolution, evidence-based mutation identification, and GenomeDiff/output generation. Coverage analysis is a related branch that computes coverage summaries and plots. The tree and README establish the product’s identity, while the excerpts provide only partial implementation evidence; the graph therefore omits uncertain wiring and does not attempt to represent unsampled orchestration.

Main entry points: [`src/breseq/reference_sequence.cpp`](https://github.com/barricklab/breseq/blob/master/src/breseq/reference_sequence.cpp) (Reference handling), [`src/breseq/identify_mutations.cpp`](https://github.com/barricklab/breseq/blob/master/src/breseq/identify_mutations.cpp) (Mutation evidence), [`src/breseq/genome_diff.cpp`](https://github.com/barricklab/breseq/blob/master/src/breseq/genome_diff.cpp) (GenomeDiff data), [`src/breseq/resolve_alignments.cpp`](https://github.com/barricklab/breseq/blob/master/src/breseq/resolve_alignments.cpp) (Resolve alignments)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Inputs and configuration"]
  node_reads(("Read files"))
  node_reference(("Reference sequence"))
  node_settings["Run settings<br/>[settings.cpp]"]
  node_fastq["FASTQ handling<br/>[fastq.cpp]"]
  node_fasta["Reference handling"]
end

subgraph group_mapping["Read mapping"]
  node_alignment["Alignment operations<br/>[alignment.cpp]"]
  node_samtools["Samtools commands"]
  node_resolve["Resolve alignments"]
end

subgraph group_analysis["Evidence and analysis"]
  node_pileup["Read pileup<br/>[pileup.cpp]"]
  node_evidence["Mutation evidence"]
  node_junctions["Junction evidence"]
  node_coverage["Coverage analysis"]
  node_predictor["Mutation prediction"]
  node_annotation["Reference annotation"]
end

subgraph group_results["Results and reporting"]
  node_coverage_output["Coverage tables and plots"]
  node_genomediff[("GenomeDiff data<br/>[genome_diff.cpp]")]
  node_output["Result reporting<br/>[output.cpp]"]
  node_summary["Run summaries<br/>[summary.cpp]"]
end

node_reads -->|"provides reads"| node_fastq
node_reference -->|"provides reference"| node_fasta
node_fastq -->|"read sequences"| node_alignment
node_fasta -->|"reference sequences"| node_alignment
node_settings -->|"configures"| node_resolve
node_samtools -->|"alignment commands"| node_resolve
node_alignment -->|"alignment data"| node_resolve
node_resolve -->|"resolved alignments"| node_evidence
node_evidence -->|"pileup evidence"| node_pileup
node_evidence -->|"junction analysis"| node_junctions
node_fasta -->|"reference sequences"| node_coverage
node_coverage -->|"coverage statistics"| node_coverage_output
node_evidence -->|"records evidence"| node_genomediff
node_genomediff -->|"mutation entries"| node_predictor
node_predictor -->|"updates entries"| node_genomediff
node_fasta -->|"annotates mutations"| node_annotation
node_genomediff -->|"reported entries"| node_output
node_summary -->|"coverage statistics"| node_coverage

click node_settings "https://github.com/barricklab/breseq/blob/master/src/breseq/settings.cpp"
click node_fastq "https://github.com/barricklab/breseq/blob/master/src/breseq/fastq.cpp"
click node_fasta "https://github.com/barricklab/breseq/blob/master/src/breseq/reference_sequence.cpp"
click node_alignment "https://github.com/barricklab/breseq/blob/master/src/breseq/alignment.cpp"
click node_samtools "https://github.com/barricklab/breseq/blob/master/src/breseq/samtools_commands.cpp"
click node_resolve "https://github.com/barricklab/breseq/blob/master/src/breseq/resolve_alignments.cpp"
click node_pileup "https://github.com/barricklab/breseq/blob/master/src/breseq/pileup.cpp"
click node_evidence "https://github.com/barricklab/breseq/blob/master/src/breseq/identify_mutations.cpp"
click node_junctions "https://github.com/barricklab/breseq/blob/master/src/breseq/candidate_junctions.cpp"
click node_coverage "https://github.com/barricklab/breseq/blob/master/src/breseq/coverage_distribution.cpp"
click node_coverage_output "https://github.com/barricklab/breseq/blob/master/src/breseq/coverage_output.cpp"
click node_predictor "https://github.com/barricklab/breseq/blob/master/src/breseq/mutation_predictor.cpp"
click node_genomediff "https://github.com/barricklab/breseq/blob/master/src/breseq/genome_diff.cpp"
click node_annotation "https://github.com/barricklab/breseq/blob/master/src/breseq/reference_sequence.cpp"
click node_output "https://github.com/barricklab/breseq/blob/master/src/breseq/output.cpp"
click node_summary "https://github.com/barricklab/breseq/blob/master/src/breseq/summary.cpp"

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_reads,node_reference,node_settings,node_fastq,node_fasta toneBlue
class node_alignment,node_samtools,node_resolve toneAmber
class node_pileup,node_evidence,node_junctions,node_coverage,node_predictor,node_annotation toneMint
class node_coverage_output,node_genomediff,node_output,node_summary toneRose
```

## Components

### Inputs and configuration

- **Read files**
- **Reference sequence**
- [Run settings](https://github.com/barricklab/breseq/blob/master/src/breseq/settings.cpp): `src/breseq/settings.cpp`
- [FASTQ handling](https://github.com/barricklab/breseq/blob/master/src/breseq/fastq.cpp): `src/breseq/fastq.cpp`
- [Reference handling](https://github.com/barricklab/breseq/blob/master/src/breseq/reference_sequence.cpp): `src/breseq/reference_sequence.cpp`

### Read mapping

- [Alignment operations](https://github.com/barricklab/breseq/blob/master/src/breseq/alignment.cpp): `src/breseq/alignment.cpp`
- [Samtools commands](https://github.com/barricklab/breseq/blob/master/src/breseq/samtools_commands.cpp): `src/breseq/samtools_commands.cpp`
- [Resolve alignments](https://github.com/barricklab/breseq/blob/master/src/breseq/resolve_alignments.cpp): `src/breseq/resolve_alignments.cpp`

### Evidence and analysis

- [Read pileup](https://github.com/barricklab/breseq/blob/master/src/breseq/pileup.cpp): `src/breseq/pileup.cpp`
- [Mutation evidence](https://github.com/barricklab/breseq/blob/master/src/breseq/identify_mutations.cpp): `src/breseq/identify_mutations.cpp`
- [Junction evidence](https://github.com/barricklab/breseq/blob/master/src/breseq/candidate_junctions.cpp): `src/breseq/candidate_junctions.cpp`
- [Coverage analysis](https://github.com/barricklab/breseq/blob/master/src/breseq/coverage_distribution.cpp): `src/breseq/coverage_distribution.cpp`
- [Mutation prediction](https://github.com/barricklab/breseq/blob/master/src/breseq/mutation_predictor.cpp): `src/breseq/mutation_predictor.cpp`
- [Reference annotation](https://github.com/barricklab/breseq/blob/master/src/breseq/reference_sequence.cpp): `src/breseq/reference_sequence.cpp`

### Results and reporting

- [Coverage tables and plots](https://github.com/barricklab/breseq/blob/master/src/breseq/coverage_output.cpp): `src/breseq/coverage_output.cpp`
- [GenomeDiff data](https://github.com/barricklab/breseq/blob/master/src/breseq/genome_diff.cpp): `src/breseq/genome_diff.cpp`
- [Result reporting](https://github.com/barricklab/breseq/blob/master/src/breseq/output.cpp): `src/breseq/output.cpp`
- [Run summaries](https://github.com/barricklab/breseq/blob/master/src/breseq/summary.cpp): `src/breseq/summary.cpp`

## Connections

- Read files → FASTQ handling: provides reads
- Reference sequence → Reference handling: provides reference
- FASTQ handling → Alignment operations: read sequences
- Reference handling → Alignment operations: reference sequences
- Run settings → Resolve alignments: configures
- Samtools commands → Resolve alignments: alignment commands
- Alignment operations → Resolve alignments: alignment data
- Resolve alignments → Mutation evidence: resolved alignments
- Mutation evidence → Read pileup: pileup evidence
- Mutation evidence → Junction evidence: junction analysis
- Reference handling → Coverage analysis: reference sequences
- Coverage analysis → Coverage tables and plots: coverage statistics
- Mutation evidence → GenomeDiff data: records evidence
- GenomeDiff data → Mutation prediction: mutation entries
- Mutation prediction → GenomeDiff data: updates entries
- Reference handling → Reference annotation: annotates mutations
- GenomeDiff data → Result reporting: reported entries
- Run summaries → Coverage analysis: coverage statistics
