# shaankhurshid/ecg_ai architecture

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

- Interactive diagram: https://gitdiagram.com/shaankhurshid/ecg_ai
- Repository: https://github.com/shaankhurshid/ecg_ai

## Overview

This repository is a small set of ECG-AI data-processing scripts. The README says they assume existing five-year atrial-fibrillation risk inferences, but does not describe their outputs or how the scripts call shared functions. The script names indicate Cox/IPCW and UKBB two-year analyses; their implementation and wiring cannot be confirmed because no source excerpts were provided.

Main entry points: [`cox_ipcw.R`](https://github.com/shaankhurshid/ecg_ai/blob/main/cox_ipcw.R) (Cox IPCW processing), [`cox_ukbb_2y.R`](https://github.com/shaankhurshid/ecg_ai/blob/main/cox_ukbb_2y.R) (UKBB 2-year analysis)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_analyst(("Data analyst"))
node_risk_inferences["5-year AF risk inferences"]
node_ipcw["Cox IPCW processing<br/>[cox_ipcw.R]"]
node_ukbb["UKBB 2-year analysis<br/>[cox_ukbb_2y.R]"]
node_functions["Shared functions<br/>[functions.R]"]

node_risk_inferences -->|"assumed input"| node_ipcw
node_risk_inferences -->|"assumed input"| node_ukbb
node_analyst -->|"runs"| node_ipcw
node_analyst -->|"runs"| node_ukbb

click node_ipcw "https://github.com/shaankhurshid/ecg_ai/blob/main/cox_ipcw.R"
click node_ukbb "https://github.com/shaankhurshid/ecg_ai/blob/main/cox_ukbb_2y.R"
click node_functions "https://github.com/shaankhurshid/ecg_ai/blob/main/functions/functions.R"

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_analyst,node_risk_inferences toneIndigo
class node_ipcw,node_ukbb,node_functions toneTeal
```

## Components

### Other components

- **Data analyst**
- **5-year AF risk inferences**
- [Cox IPCW processing](https://github.com/shaankhurshid/ecg_ai/blob/main/cox_ipcw.R): `cox_ipcw.R`
- [UKBB 2-year analysis](https://github.com/shaankhurshid/ecg_ai/blob/main/cox_ukbb_2y.R): `cox_ukbb_2y.R`
- [Shared functions](https://github.com/shaankhurshid/ecg_ai/blob/main/functions/functions.R): `functions/functions.R`

## Connections

- 5-year AF risk inferences → Cox IPCW processing: assumed input
- 5-year AF risk inferences → UKBB 2-year analysis: assumed input
- Data analyst → Cox IPCW processing: runs
- Data analyst → UKBB 2-year analysis: runs
