# traviswheelerlab/mirror architecture

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

- Interactive diagram: https://gitdiagram.com/traviswheelerlab/mirror
- Repository: https://github.com/traviswheelerlab/mirror

## Overview

MIRROR is a Python toolkit for matching peptide sequences to tandem mass spectra and producing annotations. The apparent workflow accepts spectra and sequence-search resources, constructs fragment-mass targets and spectrum graphs, explores alignments and candidate paths, then assembles labeled annotations. The source index establishes many module dependencies, but the README is empty and main.py’s references are not listed; its precise user-facing orchestration and several runtime calls therefore remain uncertain.

Main entry points: [`mirror/annotation.py`](https://github.com/traviswheelerlab/mirror/blob/main/mirror/annotation.py) (Annotation), [`mirror/enumeration.py`](https://github.com/traviswheelerlab/mirror/blob/main/mirror/enumeration.py) (Enumeration), [`mirror/evaluation/costmodels.py`](https://github.com/traviswheelerlab/mirror/blob/main/mirror/evaluation/costmodels.py) (Path cost models), [`mirror/alignment.py`](https://github.com/traviswheelerlab/mirror/blob/main/mirror/alignment.py) (Alignment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_entrypoint["Application<br/>[main.py]"]
  node_enumeration["Enumeration<br/>[enumeration.py]"]
  node_alignment["Alignment<br/>[alignment.py]"]
end

subgraph group_inputs["Spectra and sequence data"]
  node_spectrum["Spectrum data<br/>[types.py]"]
  node_simulation["Spectrum simulation<br/>[simulation.py]"]
  node_suffix["Suffix array<br/>[suffix_array.py]"]
  node_queries["Sequence queries<br/>[queries.py]"]
end

subgraph group_matching["Fragment matching"]
  node_fragmenttypes["Fragment spaces<br/>[types.py]"]
  node_fragmentmasses["Target masses<br/>[masses.py]"]
  node_fragmentsearch["Fragment search<br/>[search.py]"]
  node_annotation["Annotation<br/>[annotation.py]"]
end

subgraph group_graphs["Graph search"]
  node_graphtypes["Spectrum graphs<br/>[types.py]"]
  node_propagation["Cost propagation<br/>[propagate.py]"]
  node_tracing["Path tracing<br/>[trace.py]"]
end

subgraph group_results["Evaluation and results"]
  node_costmodels["Path cost models<br/>[costmodels.py]"]
  node_pathspaces["Path spaces<br/>[pathspaces.py]"]
  node_pairing["Affix pairing<br/>[affix_pairing.py]"]
  node_candidates["Candidate paths<br/>[candidates.py]"]
  node_labeledpeaks["Labeled peaks<br/>[labeled_peaks.py]"]
  node_topology["Spectrum topology"]
  node_io["Serialization<br/>[io.py]"]
end

node_user(("User"))

node_user -.->|"invokes"| node_entrypoint
node_entrypoint -.->|"dispatches"| node_enumeration
node_enumeration -->|"uses"| node_annotation
node_enumeration -->|"uses"| node_alignment
node_enumeration -->|"queries"| node_suffix
node_enumeration -->|"uses"| node_pairing
node_enumeration -->|"uses"| node_candidates
node_enumeration -->|"traces"| node_tracing
node_enumeration -->|"scores"| node_costmodels
node_spectrum -->|"simulates"| node_simulation
node_queries -->|"queries"| node_suffix
node_annotation -->|"reads"| node_spectrum
node_annotation -->|"uses"| node_fragmenttypes
node_annotation -->|"constructs"| node_fragmentmasses
node_annotation -->|"searches"| node_fragmentsearch
node_annotation -->|"queries"| node_suffix
node_annotation -->|"uses"| node_queries
node_annotation -->|"labels"| node_labeledpeaks
node_annotation -->|"builds"| node_topology
node_annotation -->|"serializes"| node_io
node_alignment -->|"propagates"| node_propagation
node_alignment -->|"scores"| node_costmodels
node_alignment -->|"uses"| node_annotation
node_propagation -->|"builds"| node_graphtypes
node_tracing -->|"reads"| node_graphtypes
node_tracing -->|"creates"| node_pathspaces
node_costmodels -->|"uses"| node_propagation
node_costmodels -->|"produces"| node_pathspaces
node_costmodels -->|"queries"| node_suffix
node_pairing -->|"uses"| node_costmodels
node_pairing -->|"uses"| node_pathspaces
node_candidates -->|"reads"| node_pathspaces
node_candidates -->|"uses"| node_tracing
node_candidates -->|"reads"| node_graphtypes
node_labeledpeaks -->|"reads"| node_spectrum
node_labeledpeaks -->|"uses"| node_fragmenttypes
node_topology -->|"uses"| node_labeledpeaks
node_fragmentmasses -->|"uses"| node_fragmenttypes
node_fragmentsearch -->|"uses"| node_fragmenttypes

click node_entrypoint "https://github.com/traviswheelerlab/mirror/blob/main/main.py"
click node_enumeration "https://github.com/traviswheelerlab/mirror/blob/main/mirror/enumeration.py"
click node_alignment "https://github.com/traviswheelerlab/mirror/blob/main/mirror/alignment.py"
click node_spectrum "https://github.com/traviswheelerlab/mirror/blob/main/mirror/spectra/types.py"
click node_simulation "https://github.com/traviswheelerlab/mirror/blob/main/mirror/spectra/simulation.py"
click node_suffix "https://github.com/traviswheelerlab/mirror/blob/main/mirror/sequences/suffix_array.py"
click node_queries "https://github.com/traviswheelerlab/mirror/blob/main/mirror/sequences/queries.py"
click node_fragmenttypes "https://github.com/traviswheelerlab/mirror/blob/main/mirror/fragments/types.py"
click node_fragmentmasses "https://github.com/traviswheelerlab/mirror/blob/main/mirror/fragments/masses.py"
click node_fragmentsearch "https://github.com/traviswheelerlab/mirror/blob/main/mirror/fragments/search.py"
click node_annotation "https://github.com/traviswheelerlab/mirror/blob/main/mirror/annotation.py"
click node_graphtypes "https://github.com/traviswheelerlab/mirror/blob/main/mirror/graphs/types.py"
click node_propagation "https://github.com/traviswheelerlab/mirror/blob/main/mirror/graphs/propagate.py"
click node_tracing "https://github.com/traviswheelerlab/mirror/blob/main/mirror/graphs/trace.py"
click node_costmodels "https://github.com/traviswheelerlab/mirror/blob/main/mirror/evaluation/costmodels.py"
click node_pathspaces "https://github.com/traviswheelerlab/mirror/blob/main/mirror/evaluation/pathspaces.py"
click node_pairing "https://github.com/traviswheelerlab/mirror/blob/main/mirror/evaluation/affix_pairing.py"
click node_candidates "https://github.com/traviswheelerlab/mirror/blob/main/mirror/evaluation/candidates.py"
click node_labeledpeaks "https://github.com/traviswheelerlab/mirror/blob/main/mirror/evaluation/labeled_peaks.py"
click node_topology "https://github.com/traviswheelerlab/mirror/blob/main/mirror/evaluation/spectrum_topology.py"
click node_io "https://github.com/traviswheelerlab/mirror/blob/main/mirror/io.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_entrypoint,node_enumeration,node_alignment,node_user toneBlue
class node_spectrum,node_simulation,node_suffix,node_queries toneAmber
class node_fragmenttypes,node_fragmentmasses,node_fragmentsearch,node_annotation toneMint
class node_graphtypes,node_propagation,node_tracing toneRose
class node_costmodels,node_pathspaces,node_pairing,node_candidates,node_labeledpeaks,node_topology,node_io toneIndigo
```

## Components

### Application entry

- [Application](https://github.com/traviswheelerlab/mirror/blob/main/main.py): `main.py`
- [Enumeration](https://github.com/traviswheelerlab/mirror/blob/main/mirror/enumeration.py): `mirror/enumeration.py`
- [Alignment](https://github.com/traviswheelerlab/mirror/blob/main/mirror/alignment.py): `mirror/alignment.py`

### Spectra and sequence data

- [Spectrum data](https://github.com/traviswheelerlab/mirror/blob/main/mirror/spectra/types.py): `mirror/spectra/types.py`
- [Spectrum simulation](https://github.com/traviswheelerlab/mirror/blob/main/mirror/spectra/simulation.py): `mirror/spectra/simulation.py`
- [Suffix array](https://github.com/traviswheelerlab/mirror/blob/main/mirror/sequences/suffix_array.py): `mirror/sequences/suffix_array.py`
- [Sequence queries](https://github.com/traviswheelerlab/mirror/blob/main/mirror/sequences/queries.py): `mirror/sequences/queries.py`

### Fragment matching

- [Fragment spaces](https://github.com/traviswheelerlab/mirror/blob/main/mirror/fragments/types.py): `mirror/fragments/types.py`
- [Target masses](https://github.com/traviswheelerlab/mirror/blob/main/mirror/fragments/masses.py): `mirror/fragments/masses.py`
- [Fragment search](https://github.com/traviswheelerlab/mirror/blob/main/mirror/fragments/search.py): `mirror/fragments/search.py`
- [Annotation](https://github.com/traviswheelerlab/mirror/blob/main/mirror/annotation.py): `mirror/annotation.py`

### Graph search

- [Spectrum graphs](https://github.com/traviswheelerlab/mirror/blob/main/mirror/graphs/types.py): `mirror/graphs/types.py`
- [Cost propagation](https://github.com/traviswheelerlab/mirror/blob/main/mirror/graphs/propagate.py): `mirror/graphs/propagate.py`
- [Path tracing](https://github.com/traviswheelerlab/mirror/blob/main/mirror/graphs/trace.py): `mirror/graphs/trace.py`

### Evaluation and results

- [Path cost models](https://github.com/traviswheelerlab/mirror/blob/main/mirror/evaluation/costmodels.py): `mirror/evaluation/costmodels.py`
- [Path spaces](https://github.com/traviswheelerlab/mirror/blob/main/mirror/evaluation/pathspaces.py): `mirror/evaluation/pathspaces.py`
- [Affix pairing](https://github.com/traviswheelerlab/mirror/blob/main/mirror/evaluation/affix_pairing.py): `mirror/evaluation/affix_pairing.py`
- [Candidate paths](https://github.com/traviswheelerlab/mirror/blob/main/mirror/evaluation/candidates.py): `mirror/evaluation/candidates.py`
- [Labeled peaks](https://github.com/traviswheelerlab/mirror/blob/main/mirror/evaluation/labeled_peaks.py): `mirror/evaluation/labeled_peaks.py`
- [Spectrum topology](https://github.com/traviswheelerlab/mirror/blob/main/mirror/evaluation/spectrum_topology.py): `mirror/evaluation/spectrum_topology.py`
- [Serialization](https://github.com/traviswheelerlab/mirror/blob/main/mirror/io.py): `mirror/io.py`

### Other components

- **User**

## Connections

- User → Application: invokes
- Application → Enumeration: dispatches
- Enumeration → Annotation: uses (evidence: `mirror/enumeration.py`)
- Enumeration → Alignment: uses (evidence: `mirror/enumeration.py`)
- Enumeration → Suffix array: queries (evidence: `mirror/enumeration.py`)
- Enumeration → Affix pairing: uses (evidence: `mirror/enumeration.py`)
- Enumeration → Candidate paths: uses (evidence: `mirror/enumeration.py`)
- Enumeration → Path tracing: traces (evidence: `mirror/enumeration.py`)
- Enumeration → Path cost models: scores (evidence: `mirror/enumeration.py`)
- Spectrum data → Spectrum simulation: simulates (evidence: `mirror/spectra/types.py`)
- Sequence queries → Suffix array: queries (evidence: `mirror/sequences/queries.py`)
- Annotation → Spectrum data: reads (evidence: `mirror/annotation.py`)
- Annotation → Fragment spaces: uses (evidence: `mirror/annotation.py`)
- Annotation → Target masses: constructs (evidence: `mirror/annotation.py`)
- Annotation → Fragment search: searches (evidence: `mirror/annotation.py`)
- Annotation → Suffix array: queries (evidence: `mirror/annotation.py`)
- Annotation → Sequence queries: uses (evidence: `mirror/annotation.py`)
- Annotation → Labeled peaks: labels (evidence: `mirror/annotation.py`)
- Annotation → Spectrum topology: builds (evidence: `mirror/annotation.py`)
- Annotation → Serialization: serializes (evidence: `mirror/annotation.py`)
- Alignment → Cost propagation: propagates (evidence: `mirror/alignment.py`)
- Alignment → Path cost models: scores (evidence: `mirror/alignment.py`)
- Alignment → Annotation: uses (evidence: `mirror/alignment.py`)
- Cost propagation → Spectrum graphs: builds (evidence: `mirror/graphs/propagate.py`)
- Path tracing → Spectrum graphs: reads (evidence: `mirror/graphs/trace.py`)
- Path tracing → Path spaces: creates (evidence: `mirror/graphs/trace.py`)
- Path cost models → Cost propagation: uses (evidence: `mirror/evaluation/costmodels.py`)
- Path cost models → Path spaces: produces (evidence: `mirror/evaluation/costmodels.py`)
- Path cost models → Suffix array: queries (evidence: `mirror/evaluation/costmodels.py`)
- Affix pairing → Path cost models: uses (evidence: `mirror/evaluation/affix_pairing.py`)
- Affix pairing → Path spaces: uses (evidence: `mirror/evaluation/affix_pairing.py`)
- Candidate paths → Path spaces: reads (evidence: `mirror/evaluation/candidates.py`)
- Candidate paths → Path tracing: uses (evidence: `mirror/evaluation/candidates.py`)
- Candidate paths → Spectrum graphs: reads (evidence: `mirror/evaluation/candidates.py`)
- Labeled peaks → Spectrum data: reads (evidence: `mirror/evaluation/labeled_peaks.py`)
- Labeled peaks → Fragment spaces: uses (evidence: `mirror/evaluation/labeled_peaks.py`)
- Spectrum topology → Labeled peaks: uses (evidence: `mirror/evaluation/spectrum_topology.py`)
- Target masses → Fragment spaces: uses (evidence: `mirror/fragments/masses.py`)
- Fragment search → Fragment spaces: uses (evidence: `mirror/fragments/search.py`)
