# jiangwy666/qpcr-analysis-tool architecture

> Architecture diagram of the GitHub repository jiangwy666/qpcr-analysis-tool, 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/jiangwy666/qpcr-analysis-tool
- Repository: https://github.com/jiangwy666/qpcr-analysis-tool

## Overview

This is a desktop qPCR analysis application that turns instrument-exported Excel data into normalized relative-expression values and Prism-ready outputs. The main workflow is file import, sample grouping and optional biological-replicate pairing, reference-gene normalization and ΔΔCt analysis, then preview, clipboard copy, or Excel export. The graph preserves pairing review, undetected-well handling, and QC/reporting as distinct capabilities. The README documents these features; sampled source confirms the main modules and data structures, but GUI call sites were partly omitted, so uncertain wiring is not shown.

Main entry points: [`qpcr_tool/gui.py`](https://github.com/jiangwy666/qpcr-analysis-tool/blob/main/qpcr_tool/gui.py) (Analysis window), [`qpcr_tool/analysis.py`](https://github.com/jiangwy666/qpcr-analysis-tool/blob/main/qpcr_tool/analysis.py) (ΔΔCt analysis), [`qpcr_tool/reader.py`](https://github.com/jiangwy666/qpcr-analysis-tool/blob/main/qpcr_tool/reader.py) (Parsed plate data), [`qpcr_tool/replicates.py`](https://github.com/jiangwy666/qpcr-analysis-tool/blob/main/qpcr_tool/replicates.py) (Replicate pairing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_app_entry["Application entry<br/>[main.py]"]
  node_main_window["Analysis window<br/>[gui.py]"]
  node_pair_preview["Pairing preview<br/>[gui.py]"]
end

subgraph group_ingestion["Data ingestion"]
  node_reader["Excel reader<br/>[reader.py]"]
  node_plate["Parsed plate data<br/>[reader.py]"]
end

subgraph group_preparation["Sample preparation"]
  node_grouping["Sample grouping<br/>[grouping.py]"]
  node_pairing["Replicate pairing<br/>[replicates.py]"]
end

subgraph group_calculation["Analysis and QC"]
  node_analysis["ΔΔCt analysis<br/>[analysis.py]"]
  node_reference_norm["Reference normalization<br/>[analysis.py]"]
  node_well_qc["Well and replicate QC<br/>[analysis.py]"]
  node_analysis_result["Analysis results<br/>[analysis.py]"]
end

subgraph group_delivery["Results and export"]
  node_wide_table["Prism wide table<br/>[exporter.py]"]
  node_excel_report["QC Excel report<br/>[exporter.py]"]
end

node_user(("Researcher"))
node_source_excel["Instrument Excel"]
node_clipboard["System clipboard"]
node_prism(("GraphPad Prism"))
node_output_excel["Exported workbook"]

node_user -->|"launches"| node_app_entry
node_app_entry -->|"opens"| node_main_window
node_user -->|"selects file"| node_main_window
node_source_excel -->|"provides workbook"| node_reader
node_main_window -->|"loads file"| node_reader
node_reader -->|"parses wells"| node_plate
node_plate -->|"returns plate"| node_main_window
node_main_window -->|"forms groups"| node_grouping
node_main_window -->|"configures pairing"| node_pairing
node_pairing -->|"annotates wells"| node_plate
node_main_window -->|"requests preview"| node_pairing
node_pairing -->|"builds preview"| node_pair_preview
node_main_window -->|"runs analysis"| node_analysis
node_plate -->|"supplies wells"| node_analysis
node_grouping -->|"supplies groups"| node_analysis
node_analysis -->|"calculates baseline"| node_reference_norm
node_analysis -->|"checks wells"| node_well_qc
node_analysis -->|"produces results"| node_analysis_result
node_main_window -->|"builds preview table"| node_wide_table
node_analysis_result -->|"formats values"| node_wide_table
node_main_window -->|"requests export"| node_excel_report
node_analysis_result -->|"provides results"| node_excel_report
node_plate -->|"provides source wells"| node_excel_report
node_excel_report -->|"writes workbook"| node_output_excel
node_main_window -->|"copies TSV"| node_clipboard
node_wide_table -->|"supplies TSV"| node_clipboard
node_user -->|"pastes values"| node_prism
node_clipboard -->|"provides tabular data"| node_prism

click node_app_entry "https://github.com/jiangwy666/qpcr-analysis-tool/blob/main/main.py"
click node_main_window "https://github.com/jiangwy666/qpcr-analysis-tool/blob/main/qpcr_tool/gui.py"
click node_reader "https://github.com/jiangwy666/qpcr-analysis-tool/blob/main/qpcr_tool/reader.py"
click node_plate "https://github.com/jiangwy666/qpcr-analysis-tool/blob/main/qpcr_tool/reader.py"
click node_grouping "https://github.com/jiangwy666/qpcr-analysis-tool/blob/main/qpcr_tool/grouping.py"
click node_pairing "https://github.com/jiangwy666/qpcr-analysis-tool/blob/main/qpcr_tool/replicates.py"
click node_pair_preview "https://github.com/jiangwy666/qpcr-analysis-tool/blob/main/qpcr_tool/gui.py"
click node_analysis "https://github.com/jiangwy666/qpcr-analysis-tool/blob/main/qpcr_tool/analysis.py"
click node_reference_norm "https://github.com/jiangwy666/qpcr-analysis-tool/blob/main/qpcr_tool/analysis.py"
click node_well_qc "https://github.com/jiangwy666/qpcr-analysis-tool/blob/main/qpcr_tool/analysis.py"
click node_analysis_result "https://github.com/jiangwy666/qpcr-analysis-tool/blob/main/qpcr_tool/analysis.py"
click node_wide_table "https://github.com/jiangwy666/qpcr-analysis-tool/blob/main/qpcr_tool/exporter.py"
click node_excel_report "https://github.com/jiangwy666/qpcr-analysis-tool/blob/main/qpcr_tool/exporter.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_app_entry,node_main_window,node_pair_preview toneBlue
class node_reader,node_plate toneAmber
class node_grouping,node_pairing toneMint
class node_analysis,node_reference_norm,node_well_qc,node_analysis_result toneRose
class node_wide_table,node_excel_report,node_user,node_source_excel,node_clipboard,node_prism,node_output_excel toneIndigo
```

## Components

### User interface

- [Application entry](https://github.com/jiangwy666/qpcr-analysis-tool/blob/main/main.py): `main.py`
- [Analysis window](https://github.com/jiangwy666/qpcr-analysis-tool/blob/main/qpcr_tool/gui.py): `qpcr_tool/gui.py`
- [Pairing preview](https://github.com/jiangwy666/qpcr-analysis-tool/blob/main/qpcr_tool/gui.py): `qpcr_tool/gui.py`

### Data ingestion

- [Excel reader](https://github.com/jiangwy666/qpcr-analysis-tool/blob/main/qpcr_tool/reader.py): `qpcr_tool/reader.py`
- [Parsed plate data](https://github.com/jiangwy666/qpcr-analysis-tool/blob/main/qpcr_tool/reader.py): `qpcr_tool/reader.py`

### Sample preparation

- [Sample grouping](https://github.com/jiangwy666/qpcr-analysis-tool/blob/main/qpcr_tool/grouping.py): `qpcr_tool/grouping.py`
- [Replicate pairing](https://github.com/jiangwy666/qpcr-analysis-tool/blob/main/qpcr_tool/replicates.py): `qpcr_tool/replicates.py`

### Analysis and QC

- [ΔΔCt analysis](https://github.com/jiangwy666/qpcr-analysis-tool/blob/main/qpcr_tool/analysis.py): `qpcr_tool/analysis.py`
- [Reference normalization](https://github.com/jiangwy666/qpcr-analysis-tool/blob/main/qpcr_tool/analysis.py): `qpcr_tool/analysis.py`
- [Well and replicate QC](https://github.com/jiangwy666/qpcr-analysis-tool/blob/main/qpcr_tool/analysis.py): `qpcr_tool/analysis.py`
- [Analysis results](https://github.com/jiangwy666/qpcr-analysis-tool/blob/main/qpcr_tool/analysis.py): `qpcr_tool/analysis.py`

### Results and export

- [Prism wide table](https://github.com/jiangwy666/qpcr-analysis-tool/blob/main/qpcr_tool/exporter.py): `qpcr_tool/exporter.py`
- [QC Excel report](https://github.com/jiangwy666/qpcr-analysis-tool/blob/main/qpcr_tool/exporter.py): `qpcr_tool/exporter.py`

### Other components

- **Researcher**
- **Instrument Excel**
- **System clipboard**
- **GraphPad Prism**
- **Exported workbook**

## Connections

- Researcher → Application entry: launches
- Application entry → Analysis window: opens
- Researcher → Analysis window: selects file
- Instrument Excel → Excel reader: provides workbook
- Analysis window → Excel reader: loads file
- Excel reader → Parsed plate data: parses wells
- Parsed plate data → Analysis window: returns plate
- Analysis window → Sample grouping: forms groups
- Analysis window → Replicate pairing: configures pairing
- Replicate pairing → Parsed plate data: annotates wells
- Analysis window → Replicate pairing: requests preview
- Replicate pairing → Pairing preview: builds preview
- Analysis window → ΔΔCt analysis: runs analysis
- Parsed plate data → ΔΔCt analysis: supplies wells
- Sample grouping → ΔΔCt analysis: supplies groups
- ΔΔCt analysis → Reference normalization: calculates baseline
- ΔΔCt analysis → Well and replicate QC: checks wells
- ΔΔCt analysis → Analysis results: produces results
- Analysis window → Prism wide table: builds preview table
- Analysis results → Prism wide table: formats values
- Analysis window → QC Excel report: requests export
- Analysis results → QC Excel report: provides results
- Parsed plate data → QC Excel report: provides source wells
- QC Excel report → Exported workbook: writes workbook
- Analysis window → System clipboard: copies TSV
- Prism wide table → System clipboard: supplies TSV
- Researcher → GraphPad Prism: pastes values
- System clipboard → GraphPad Prism: provides tabular data
