# uthsc-zhang/rmstpowerboost-package architecture

> Architecture diagram of the GitHub repository uthsc-zhang/rmstpowerboost-package, 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/uthsc-zhang/rmstpowerboost-package
- Repository: https://github.com/uthsc-zhang/rmstpowerboost-package

## Overview

RMSTpowerBoost is an R package for calculating power and sample size in RMST-based trials, with an interactive Shiny interface. Users can simulate reference data, calculate power curves, or search for a target-power sample size. The unified interface routes calculations to analytical or bootstrap methods, including stratified, nonlinear GAM, and dependent-censoring approaches. The graph reflects README-documented capabilities and paths in the tree; source excerpts were unavailable, so uncertain internal calls and data handoffs are omitted.

Main entry points: [`R/rmst-interface.R`](https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/R/rmst-interface.R) (Power and sample size), [`R/run_app.R`](https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/R/run_app.R) (App launcher), [`R/datagen-interface.R`](https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/R/datagen-interface.R) (Simulation API), [`inst/shiny_app/app.R`](https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/inst/shiny_app/app.R) (Shiny app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User interfaces"]
  node_r_interface["R interface<br/>[rmst-interface.R]"]
  node_app_launcher["App launcher<br/>[run_app.R]"]
  node_shiny_app["Shiny app<br/>[app.R]"]
end

subgraph group_simulation["Data simulation"]
  node_simulation_api["Simulation API"]
  node_recipe_sim["Recipe simulation"]
  node_recipe_generate["Recipe generation"]
  node_recipe_load["Recipe loading"]
end

subgraph group_calculation["Power and sample size"]
  node_power["Power and sample size<br/>[rmst-interface.R]"]
end

subgraph group_methods["Calculation methods"]
  node_linear_analytical["Linear IPCW analytical"]
  node_linear_boot["Linear IPCW bootstrap<br/>[linear_ipcw_boot.R]"]
  node_additive_analytical["Additive stratified"]
  node_additive_boot["Additive GAM bootstrap"]
  node_multiplicative_analytical["Multiplicative stratified"]
  node_multiplicative_boot["Multiplicative bootstrap"]
  node_dependent_censoring["Dependent censoring"]
end

node_user(("Trial researcher"))
node_result["Power or sample-size result<br/>[rmst-interface.R]"]

node_user -->|"requests simulation"| node_simulation_api
node_simulation_api -->|"simulates data"| node_recipe_sim
node_user -->|"requests calculation"| node_r_interface
node_r_interface -->|"routes request"| node_power
node_power -->|"analytical mode"| node_linear_analytical
node_power -->|"bootstrap mode"| node_linear_boot
node_power -->|"additive strata"| node_additive_analytical
node_power -->|"smooth terms"| node_additive_boot
node_power -->|"multiplicative strata"| node_multiplicative_analytical
node_power -->|"multiplicative bootstrap"| node_multiplicative_boot
node_power -->|"dependent censoring"| node_dependent_censoring
node_power -->|"returns result"| node_result
node_user -->|"opens app"| node_app_launcher
node_app_launcher -->|"launches"| node_shiny_app

click node_r_interface "https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/R/rmst-interface.R"
click node_app_launcher "https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/R/run_app.R"
click node_shiny_app "https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/inst/shiny_app/app.R"
click node_simulation_api "https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/R/datagen-interface.R"
click node_recipe_sim "https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/R/recipe_sim_datagen.R"
click node_recipe_generate "https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/R/generate_sets_datagen.R"
click node_recipe_load "https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/R/load_sets_datagen.R"
click node_power "https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/R/rmst-interface.R"
click node_linear_analytical "https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/R/linear_ipcw_analytical.R"
click node_linear_boot "https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/R/linear_ipcw_boot.R"
click node_additive_analytical "https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/R/additive_stratified_analytical.R"
click node_additive_boot "https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/R/additive_gam_boot.R"
click node_multiplicative_analytical "https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/R/multiplicative_stratified_analytical.R"
click node_multiplicative_boot "https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/R/multiplicative_stratified_boot.R"
click node_dependent_censoring "https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/R/dependent_censoring_analytical.R"
click node_result "https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/R/rmst-interface.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_r_interface,node_app_launcher,node_shiny_app toneBlue
class node_simulation_api,node_recipe_sim,node_recipe_generate,node_recipe_load toneAmber
class node_power toneMint
class node_linear_analytical,node_linear_boot,node_additive_analytical,node_additive_boot,node_multiplicative_analytical,node_multiplicative_boot,node_dependent_censoring toneRose
class node_user toneIndigo
class node_result toneTeal
```

## Components

### User interfaces

- [R interface](https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/R/rmst-interface.R): `R/rmst-interface.R`
- [App launcher](https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/R/run_app.R): `R/run_app.R`
- [Shiny app](https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/inst/shiny_app/app.R): `inst/shiny_app/app.R`

### Data simulation

- [Simulation API](https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/R/datagen-interface.R): `R/datagen-interface.R`
- [Recipe simulation](https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/R/recipe_sim_datagen.R): `R/recipe_sim_datagen.R`
- [Recipe generation](https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/R/generate_sets_datagen.R): `R/generate_sets_datagen.R`
- [Recipe loading](https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/R/load_sets_datagen.R): `R/load_sets_datagen.R`

### Power and sample size

- [Power and sample size](https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/R/rmst-interface.R): `R/rmst-interface.R`

### Calculation methods

- [Linear IPCW analytical](https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/R/linear_ipcw_analytical.R): `R/linear_ipcw_analytical.R`
- [Linear IPCW bootstrap](https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/R/linear_ipcw_boot.R): `R/linear_ipcw_boot.R`
- [Additive stratified](https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/R/additive_stratified_analytical.R): `R/additive_stratified_analytical.R`
- [Additive GAM bootstrap](https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/R/additive_gam_boot.R): `R/additive_gam_boot.R`
- [Multiplicative stratified](https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/R/multiplicative_stratified_analytical.R): `R/multiplicative_stratified_analytical.R`
- [Multiplicative bootstrap](https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/R/multiplicative_stratified_boot.R): `R/multiplicative_stratified_boot.R`
- [Dependent censoring](https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/R/dependent_censoring_analytical.R): `R/dependent_censoring_analytical.R`

### Other components

- **Trial researcher**
- [Power or sample-size result](https://github.com/uthsc-zhang/rmstpowerboost-package/blob/main/R/rmst-interface.R): `R/rmst-interface.R`

## Connections

- Trial researcher → Simulation API: requests simulation
- Simulation API → Recipe simulation: simulates data
- Trial researcher → R interface: requests calculation
- R interface → Power and sample size: routes request
- Power and sample size → Linear IPCW analytical: analytical mode
- Power and sample size → Linear IPCW bootstrap: bootstrap mode
- Power and sample size → Additive stratified: additive strata
- Power and sample size → Additive GAM bootstrap: smooth terms
- Power and sample size → Multiplicative stratified: multiplicative strata
- Power and sample size → Multiplicative bootstrap: multiplicative bootstrap
- Power and sample size → Dependent censoring: dependent censoring
- Power and sample size → Power or sample-size result: returns result
- Trial researcher → App launcher: opens app
- App launcher → Shiny app: launches
