# hodgkinlab/cyton2-paper architecture

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

- Interactive diagram: https://gitdiagram.com/hodgkinlab/cyton2-paper
- Repository: https://github.com/hodgkinlab/cyton2-paper

## Overview

This repository contains analysis code accompanying the Cyton2 immune-cell dynamics paper, with two related but distinct workflows. Filming-data scripts process lineage observations into clonal summaries, plots, distribution comparisons, and agent-based simulations; the Cyton2 workflow parses FACS workbooks, fits the population model, and produces plots and simulations. The sampled excerpts establish the parser’s reader/manager dependencies and several fitting scripts’ parser/model usage. Other capability links are documented by the README; unsampled implementation details are not inferred.

Main entry points: [`code/cyton/src/parse.py`](https://github.com/hodgkinlab/cyton2-paper/blob/master/code/cyton/src/parse.py) (Data Parser), [`code/cyton/out`](https://github.com/hodgkinlab/cyton2-paper/tree/master/code/cyton/out) (Cyton2 Results), [`code/cyton/FigS7-simulTree.py`](https://github.com/hodgkinlab/cyton2-paper/blob/master/code/cyton/FigS7-simulTree.py) (Tree Simulation), [`code/tracking/Fig2-procData.py`](https://github.com/hodgkinlab/cyton2-paper/blob/master/code/tracking/Fig2-procData.py) (Filming Processing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_tracking["Filming Data"]
  node_filming_data[("Filming Data")]
  node_fig2_processing["Filming Processing<br/>[Fig2-procData.py]"]
  node_tracking_helpers["Tracking Helpers<br/>[_func.py]"]
end

subgraph group_tracking_analysis["Filming Analysis"]
  node_fig2_results["Figure 2 Results"]
  node_fig3_simulation["Agent Simulation<br/>[Fig3-simulABM.py]"]
  node_fig4_distribution["Distribution Analysis<br/>[Fig4-distClass.py]"]
  node_tracking_results["Figures 3–4"]
end

subgraph group_cyton_core["Cyton2 Core"]
  node_facs_workbooks[("FACS Workbooks")]
  node_cyton_parser["Data Parser<br/>[parse.py]"]
  node_workbook_reader["Workbook Reader<br/>[_reader.py]"]
  node_data_manager["Data Manager<br/>[_manager.py]"]
  node_model_engine["Cyton2 Model<br/>[model.pyx]"]
  node_cell_simulation["Cell Simulation<br/>[cell.py]"]
end

subgraph group_cyton_analysis["Cyton2 Analysis"]
  node_fig5_fit["Figure 5 Fitting<br/>[Fig5AB-modelFit.py]"]
  node_fig5c_fit["Figure 5C Fitting<br/>[Fig5C-modelFit.py]"]
  node_fig5_plot["Figure 5 Analysis<br/>[Fig5-Plot.py]"]
  node_fig6_fit["Figure 6 Fitting"]
  node_fig6_plot["Figure 6 Plotting<br/>[Fig6-Plot.py]"]
  node_tree_simulation["Tree Simulation<br/>[FigS7-simulTree.py]"]
  node_cyton_results["Cyton2 Results"]
end

node_researcher(("Researcher"))

node_researcher -.->|"runs analysis"| node_fig2_processing
node_filming_data -.->|"provides observations"| node_fig2_processing
node_fig2_processing -->|"calls helpers"| node_tracking_helpers
node_fig2_processing -.->|"produces figures"| node_fig2_results
node_researcher -.->|"runs simulation"| node_fig3_simulation
node_fig3_simulation -.->|"produces simulation"| node_tracking_results
node_researcher -.->|"runs analysis"| node_fig4_distribution
node_filming_data -.->|"supplies measured times"| node_fig4_distribution
node_fig4_distribution -->|"uses helpers"| node_tracking_helpers
node_fig4_distribution -->|"writes figures"| node_tracking_results
node_researcher -.->|"runs model workflow"| node_cyton_parser
node_facs_workbooks -.->|"provides datasets"| node_cyton_parser
node_cyton_parser -->|"reads workbooks"| node_workbook_reader
node_cyton_parser -->|"summarizes data"| node_data_manager
node_fig5_fit -->|"parses data"| node_cyton_parser
node_fig5_fit -->|"fits model"| node_model_engine
node_fig5c_fit -->|"parses data"| node_cyton_parser
node_fig6_fit -->|"parses data"| node_cyton_parser
node_fig6_fit -->|"fits model"| node_model_engine
node_fig5_fit -.->|"writes fit results"| node_cyton_results
node_fig5c_fit -.->|"writes fit results"| node_cyton_results
node_fig5_plot -->|"uses parsed data"| node_cyton_parser
node_fig5_plot -.->|"writes plots"| node_cyton_results
node_fig6_fit -.->|"feeds fit results"| node_fig6_plot
node_fig6_plot -->|"uses parsed data"| node_cyton_parser
node_fig6_plot -.->|"writes plots"| node_cyton_results
node_researcher -.->|"runs simulation"| node_tree_simulation
node_tree_simulation -->|"uses parsed data"| node_cyton_parser
node_tree_simulation -->|"uses cell model"| node_cell_simulation
node_tree_simulation -.->|"writes simulation"| node_cyton_results

click node_filming_data "https://github.com/hodgkinlab/cyton2-paper/tree/master/code/tracking/data"
click node_fig2_processing "https://github.com/hodgkinlab/cyton2-paper/blob/master/code/tracking/Fig2-procData.py"
click node_tracking_helpers "https://github.com/hodgkinlab/cyton2-paper/blob/master/code/tracking/_func.py"
click node_fig2_results "https://github.com/hodgkinlab/cyton2-paper/tree/master/code/tracking/out"
click node_fig3_simulation "https://github.com/hodgkinlab/cyton2-paper/blob/master/code/tracking/Fig3-simulABM.py"
click node_fig4_distribution "https://github.com/hodgkinlab/cyton2-paper/blob/master/code/tracking/Fig4-distClass.py"
click node_tracking_results "https://github.com/hodgkinlab/cyton2-paper/tree/master/code/tracking/out"
click node_facs_workbooks "https://github.com/hodgkinlab/cyton2-paper/tree/master/code/cyton/data"
click node_cyton_parser "https://github.com/hodgkinlab/cyton2-paper/blob/master/code/cyton/src/parse.py"
click node_workbook_reader "https://github.com/hodgkinlab/cyton2-paper/blob/master/code/cyton/src/_reader.py"
click node_data_manager "https://github.com/hodgkinlab/cyton2-paper/blob/master/code/cyton/src/_manager.py"
click node_model_engine "https://github.com/hodgkinlab/cyton2-paper/blob/master/code/cyton/src/model.pyx"
click node_cell_simulation "https://github.com/hodgkinlab/cyton2-paper/blob/master/code/cyton/src/cell.py"
click node_fig5_fit "https://github.com/hodgkinlab/cyton2-paper/blob/master/code/cyton/Fig5AB-modelFit.py"
click node_fig5c_fit "https://github.com/hodgkinlab/cyton2-paper/blob/master/code/cyton/Fig5C-modelFit.py"
click node_fig5_plot "https://github.com/hodgkinlab/cyton2-paper/blob/master/code/cyton/Fig5-Plot.py"
click node_fig6_fit "https://github.com/hodgkinlab/cyton2-paper/blob/master/code/cyton/Fig6-modelJointFit.py"
click node_fig6_plot "https://github.com/hodgkinlab/cyton2-paper/blob/master/code/cyton/Fig6-Plot.py"
click node_tree_simulation "https://github.com/hodgkinlab/cyton2-paper/blob/master/code/cyton/FigS7-simulTree.py"
click node_cyton_results "https://github.com/hodgkinlab/cyton2-paper/tree/master/code/cyton/out"

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_filming_data,node_fig2_processing,node_tracking_helpers toneBlue
class node_fig2_results,node_fig3_simulation,node_fig4_distribution,node_tracking_results toneAmber
class node_facs_workbooks,node_cyton_parser,node_workbook_reader,node_data_manager,node_model_engine,node_cell_simulation toneMint
class node_fig5_fit,node_fig5c_fit,node_fig5_plot,node_fig6_fit,node_fig6_plot,node_tree_simulation,node_cyton_results toneRose
class node_researcher toneIndigo
```

## Components

### Filming Data

- [Filming Data](https://github.com/hodgkinlab/cyton2-paper/tree/master/code/tracking/data): `code/tracking/data`
- [Filming Processing](https://github.com/hodgkinlab/cyton2-paper/blob/master/code/tracking/Fig2-procData.py): `code/tracking/Fig2-procData.py`
- [Tracking Helpers](https://github.com/hodgkinlab/cyton2-paper/blob/master/code/tracking/_func.py): `code/tracking/_func.py`

### Filming Analysis

- [Figure 2 Results](https://github.com/hodgkinlab/cyton2-paper/tree/master/code/tracking/out): `code/tracking/out`
- [Agent Simulation](https://github.com/hodgkinlab/cyton2-paper/blob/master/code/tracking/Fig3-simulABM.py): `code/tracking/Fig3-simulABM.py`
- [Distribution Analysis](https://github.com/hodgkinlab/cyton2-paper/blob/master/code/tracking/Fig4-distClass.py): `code/tracking/Fig4-distClass.py`
- [Figures 3–4](https://github.com/hodgkinlab/cyton2-paper/tree/master/code/tracking/out): `code/tracking/out`

### Cyton2 Core

- [FACS Workbooks](https://github.com/hodgkinlab/cyton2-paper/tree/master/code/cyton/data): `code/cyton/data`
- [Data Parser](https://github.com/hodgkinlab/cyton2-paper/blob/master/code/cyton/src/parse.py): `code/cyton/src/parse.py`
- [Workbook Reader](https://github.com/hodgkinlab/cyton2-paper/blob/master/code/cyton/src/_reader.py): `code/cyton/src/_reader.py`
- [Data Manager](https://github.com/hodgkinlab/cyton2-paper/blob/master/code/cyton/src/_manager.py): `code/cyton/src/_manager.py`
- [Cyton2 Model](https://github.com/hodgkinlab/cyton2-paper/blob/master/code/cyton/src/model.pyx): `code/cyton/src/model.pyx`
- [Cell Simulation](https://github.com/hodgkinlab/cyton2-paper/blob/master/code/cyton/src/cell.py): `code/cyton/src/cell.py`

### Cyton2 Analysis

- [Figure 5 Fitting](https://github.com/hodgkinlab/cyton2-paper/blob/master/code/cyton/Fig5AB-modelFit.py): `code/cyton/Fig5AB-modelFit.py`
- [Figure 5C Fitting](https://github.com/hodgkinlab/cyton2-paper/blob/master/code/cyton/Fig5C-modelFit.py): `code/cyton/Fig5C-modelFit.py`
- [Figure 5 Analysis](https://github.com/hodgkinlab/cyton2-paper/blob/master/code/cyton/Fig5-Plot.py): `code/cyton/Fig5-Plot.py`
- [Figure 6 Fitting](https://github.com/hodgkinlab/cyton2-paper/blob/master/code/cyton/Fig6-modelJointFit.py): `code/cyton/Fig6-modelJointFit.py`
- [Figure 6 Plotting](https://github.com/hodgkinlab/cyton2-paper/blob/master/code/cyton/Fig6-Plot.py): `code/cyton/Fig6-Plot.py`
- [Tree Simulation](https://github.com/hodgkinlab/cyton2-paper/blob/master/code/cyton/FigS7-simulTree.py): `code/cyton/FigS7-simulTree.py`
- [Cyton2 Results](https://github.com/hodgkinlab/cyton2-paper/tree/master/code/cyton/out): `code/cyton/out`

### Other components

- **Researcher**

## Connections

- Researcher → Filming Processing: runs analysis (evidence: `README.md`)
- Filming Data → Filming Processing: provides observations (evidence: `README.md`)
- Filming Processing → Tracking Helpers: calls helpers (evidence: `code/tracking/Fig2-procData.py`)
- Filming Processing → Figure 2 Results: produces figures (evidence: `README.md`)
- Researcher → Agent Simulation: runs simulation (evidence: `README.md`)
- Agent Simulation → Figures 3–4: produces simulation (evidence: `README.md`)
- Researcher → Distribution Analysis: runs analysis (evidence: `README.md`)
- Filming Data → Distribution Analysis: supplies measured times (evidence: `README.md`)
- Distribution Analysis → Tracking Helpers: uses helpers (evidence: `code/tracking/Fig4-distClass.py`)
- Distribution Analysis → Figures 3–4: writes figures (evidence: `code/tracking/Fig4-distClass.py`)
- Researcher → Data Parser: runs model workflow (evidence: `README.md`)
- FACS Workbooks → Data Parser: provides datasets (evidence: `README.md`)
- Data Parser → Workbook Reader: reads workbooks (evidence: `code/cyton/src/parse.py`)
- Data Parser → Data Manager: summarizes data (evidence: `code/cyton/src/parse.py`)
- Figure 5 Fitting → Data Parser: parses data (evidence: `code/cyton/Fig5AB-modelFit.py`)
- Figure 5 Fitting → Cyton2 Model: fits model (evidence: `code/cyton/Fig5AB-modelFit.py`)
- Figure 5C Fitting → Data Parser: parses data (evidence: `code/cyton/Fig5C-modelFit.py`)
- Figure 6 Fitting → Data Parser: parses data (evidence: `code/cyton/Fig6-modelJointFit.py`)
- Figure 6 Fitting → Cyton2 Model: fits model (evidence: `code/cyton/Fig6-modelJointFit.py`)
- Figure 5 Fitting → Cyton2 Results: writes fit results (evidence: `README.md`)
- Figure 5C Fitting → Cyton2 Results: writes fit results (evidence: `README.md`)
- Figure 5 Analysis → Data Parser: uses parsed data (evidence: `code/cyton/Fig5-Plot.py`)
- Figure 5 Analysis → Cyton2 Results: writes plots (evidence: `README.md`)
- Figure 6 Fitting → Figure 6 Plotting: feeds fit results (evidence: `README.md`)
- Figure 6 Plotting → Data Parser: uses parsed data (evidence: `code/cyton/Fig6-Plot.py`)
- Figure 6 Plotting → Cyton2 Results: writes plots (evidence: `README.md`)
- Researcher → Tree Simulation: runs simulation (evidence: `README.md`)
- Tree Simulation → Data Parser: uses parsed data (evidence: `code/cyton/FigS7-simulTree.py`)
- Tree Simulation → Cell Simulation: uses cell model (evidence: `code/cyton/FigS7-simulTree.py`)
- Tree Simulation → Cyton2 Results: writes simulation (evidence: `README.md`)
