# parktj4264/drb-code architecture

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

- Interactive diagram: https://gitdiagram.com/parktj4264/drb-code
- Repository: https://github.com/parktj4264/drb-code

## Overview

DRB-Code automates REF-versus-TARGET measurement analysis: users provide raw measurements and ROOTID group mappings, choose GUI or script execution, and receive Sigma results plus review outputs. The README documents both launch paths invoking the shared main pipeline, configurable analysis inputs, and CSV, PowerPoint, and Spotfire outputs. The source excerpts were unavailable, so internal calls between the pipeline stages are not asserted; those stages are represented only where the tree supports their paths.

Main entry points: [`main.R`](https://github.com/parktj4264/drb-code/blob/develop/main.R) (Shared pipeline), [`src/gui/gui_app.R`](https://github.com/parktj4264/drb-code/blob/develop/src/gui/gui_app.R) (GUI workflow), [`run_gui.R`](https://github.com/parktj4264/drb-code/blob/develop/run_gui.R) (GUI launch), [`run.R`](https://github.com/parktj4264/drb-code/blob/develop/run.R) (Script launch)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Execution"]
  node_gui["GUI launch<br/>[run_gui.R]"]
  node_script["Script launch<br/>[run.R]"]
  node_gui_app["GUI workflow<br/>[gui_app.R]"]
  node_preview["Quick preview<br/>[gui_preview.R]"]
end

subgraph group_analysis["Analysis"]
  node_inputs[("Analysis inputs")]
  node_pipeline["Shared pipeline<br/>[main.R]"]
  node_load["Data loading<br/>[01_load_data.R]"]
  node_stats["Statistical analysis<br/>[02_calc_stats.R]"]
  node_metric_sigma["One-sigma metric<br/>[metric_one_sigma.R]"]
  node_metric_custom["Custom metrics<br/>[metric_custom.R]"]
end

subgraph group_outputs["Results and reports"]
  node_results["Analysis results<br/>[results.csv]"]
  node_issues["Metric issue summary"]
  node_ppt["Review presentation<br/>[03_create_ppt.R]"]
  node_ppt_output["Sigma summary PPT"]
  node_finalize["Output finalization"]
end

subgraph group_integration["Spotfire"]
  node_spotfire_gen["Spotfire data generation"]
  node_spotfire_data["Spotfire data files"]
  node_spotfire_app["Spotfire project<br/>[drb_spotfire.dxp]"]
end

node_user(("Analyst"))

node_user -->|"launches"| node_gui
node_user -->|"launches"| node_script
node_gui -->|"starts GUI"| node_gui_app
node_gui_app -->|"runs full analysis"| node_pipeline
node_script -->|"runs analysis"| node_pipeline
node_inputs -->|"provides inputs"| node_pipeline
node_pipeline -->|"produces results"| node_results
node_pipeline -->|"reports issues"| node_issues
node_pipeline -->|"creates presentation"| node_ppt
node_ppt -->|"writes PPT"| node_ppt_output
node_pipeline -.->|"generates when enabled"| node_spotfire_gen
node_spotfire_gen -->|"writes data"| node_spotfire_data
node_user -->|"requests preview"| node_preview
node_gui_app -->|"offers preview"| node_preview
node_user -.->|"may open"| node_spotfire_app

click node_inputs "https://github.com/parktj4264/drb-code/tree/develop/data"
click node_gui "https://github.com/parktj4264/drb-code/blob/develop/run_gui.R"
click node_script "https://github.com/parktj4264/drb-code/blob/develop/run.R"
click node_gui_app "https://github.com/parktj4264/drb-code/blob/develop/src/gui/gui_app.R"
click node_preview "https://github.com/parktj4264/drb-code/blob/develop/src/gui/gui_preview.R"
click node_pipeline "https://github.com/parktj4264/drb-code/blob/develop/main.R"
click node_load "https://github.com/parktj4264/drb-code/blob/develop/src/01_load_data.R"
click node_stats "https://github.com/parktj4264/drb-code/blob/develop/src/02_calc_stats.R"
click node_metric_sigma "https://github.com/parktj4264/drb-code/blob/develop/src/metrics/metric_one_sigma.R"
click node_metric_custom "https://github.com/parktj4264/drb-code/blob/develop/src/metrics/metric_custom.R"
click node_results "https://github.com/parktj4264/drb-code/blob/develop/output/results.csv"
click node_issues "https://github.com/parktj4264/drb-code/blob/develop/output/metric_issues_latest.csv"
click node_ppt "https://github.com/parktj4264/drb-code/blob/develop/src/03_create_ppt.R"
click node_ppt_output "https://github.com/parktj4264/drb-code/blob/develop/output/sigma_summary_latest.pptx"
click node_spotfire_gen "https://github.com/parktj4264/drb-code/blob/develop/src/04_create_spotfire.R"
click node_finalize "https://github.com/parktj4264/drb-code/blob/develop/src/05_finalize_outputs.R"
click node_spotfire_data "https://github.com/parktj4264/drb-code/tree/develop/spotfire"
click node_spotfire_app "https://github.com/parktj4264/drb-code/blob/develop/spotfire/drb_spotfire.dxp"

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_gui,node_script,node_gui_app,node_preview toneBlue
class node_inputs,node_pipeline,node_load,node_stats,node_metric_sigma,node_metric_custom toneAmber
class node_results,node_issues,node_ppt,node_ppt_output,node_finalize toneMint
class node_spotfire_gen,node_spotfire_data,node_spotfire_app toneRose
class node_user toneIndigo
```

## Components

### Execution

- [GUI launch](https://github.com/parktj4264/drb-code/blob/develop/run_gui.R): `run_gui.R`
- [Script launch](https://github.com/parktj4264/drb-code/blob/develop/run.R): `run.R`
- [GUI workflow](https://github.com/parktj4264/drb-code/blob/develop/src/gui/gui_app.R): `src/gui/gui_app.R`
- [Quick preview](https://github.com/parktj4264/drb-code/blob/develop/src/gui/gui_preview.R): `src/gui/gui_preview.R`

### Analysis

- [Analysis inputs](https://github.com/parktj4264/drb-code/tree/develop/data): `data`
- [Shared pipeline](https://github.com/parktj4264/drb-code/blob/develop/main.R): `main.R`
- [Data loading](https://github.com/parktj4264/drb-code/blob/develop/src/01_load_data.R): `src/01_load_data.R`
- [Statistical analysis](https://github.com/parktj4264/drb-code/blob/develop/src/02_calc_stats.R): `src/02_calc_stats.R`
- [One-sigma metric](https://github.com/parktj4264/drb-code/blob/develop/src/metrics/metric_one_sigma.R): `src/metrics/metric_one_sigma.R`
- [Custom metrics](https://github.com/parktj4264/drb-code/blob/develop/src/metrics/metric_custom.R): `src/metrics/metric_custom.R`

### Results and reports

- [Analysis results](https://github.com/parktj4264/drb-code/blob/develop/output/results.csv): `output/results.csv`
- [Metric issue summary](https://github.com/parktj4264/drb-code/blob/develop/output/metric_issues_latest.csv): `output/metric_issues_latest.csv`
- [Review presentation](https://github.com/parktj4264/drb-code/blob/develop/src/03_create_ppt.R): `src/03_create_ppt.R`
- [Sigma summary PPT](https://github.com/parktj4264/drb-code/blob/develop/output/sigma_summary_latest.pptx): `output/sigma_summary_latest.pptx`
- [Output finalization](https://github.com/parktj4264/drb-code/blob/develop/src/05_finalize_outputs.R): `src/05_finalize_outputs.R`

### Spotfire

- [Spotfire data generation](https://github.com/parktj4264/drb-code/blob/develop/src/04_create_spotfire.R): `src/04_create_spotfire.R`
- [Spotfire data files](https://github.com/parktj4264/drb-code/tree/develop/spotfire): `spotfire`
- [Spotfire project](https://github.com/parktj4264/drb-code/blob/develop/spotfire/drb_spotfire.dxp): `spotfire/drb_spotfire.dxp`

### Other components

- **Analyst**

## Connections

- Analyst → GUI launch: launches (evidence: `README.md`)
- Analyst → Script launch: launches (evidence: `README.md`)
- GUI launch → GUI workflow: starts GUI (evidence: `README.md`)
- GUI workflow → Shared pipeline: runs full analysis (evidence: `README.md`)
- Script launch → Shared pipeline: runs analysis (evidence: `README.md`)
- Analysis inputs → Shared pipeline: provides inputs (evidence: `README.md`)
- Shared pipeline → Analysis results: produces results (evidence: `README.md`)
- Shared pipeline → Metric issue summary: reports issues (evidence: `README.md`)
- Shared pipeline → Review presentation: creates presentation (evidence: `README.md`)
- Review presentation → Sigma summary PPT: writes PPT (evidence: `README.md`)
- Shared pipeline → Spotfire data generation: generates when enabled (evidence: `README.md`)
- Spotfire data generation → Spotfire data files: writes data (evidence: `README.md`)
- Analyst → Quick preview: requests preview (evidence: `README.md`)
- GUI workflow → Quick preview: offers preview (evidence: `README.md`)
- Analyst → Spotfire project: may open (evidence: `README.md`)
