11  Pipeline Reference

Complete reference for all Makefile targets, R package dependencies, configuration files, and troubleshooting.

11.1 All Makefile Targets

Target Description Dependencies
help Show available targets None
setup One-time environment bootstrap None
verify Check environment health None
init Create new project directory tree Python (uv)
simulate Generate simulated data (single scenario) R
simulate-all Generate all 7 simulated datasets R
validate-data Validate TTE data structure R
profile-data Generate data profile report R
diagnose Run all 6 diagnostic checks + report R, validate-data, profile-data
route Diagnose and recommend analysis path R, Python, diagnose
analyze-standard Standard KM + Cox (6 scripts) R
analyze-competing Competing risks (5 scripts) R
analyze-recurrent Recurrent/multi-state (8 scripts) R
analyze-time-varying Time-varying exposure (5 scripts) R
analyze-advanced Advanced adjustments (5 scripts) R
analyze-auto Auto-select and run analysis R, Python, route
figures Generate publication figures R
manuscript Build Table 1 and results section R
render Render Quarto to PDF + DOCX Quarto, LaTeX
qa Run QA validation Python
checkpoint Create pipeline checkpoint Python
all Full pipeline end-to-end All above
demo-all Run all demo scenarios All above
clean Remove generated outputs (keeps raw data) rip

11.2 R Package Dependencies

Package Purpose
survival Core survival analysis (Surv, coxph, survfit)
survminer KM curve visualisation (ggsurvplot)
cmprsk Competing risks (cuminc, crr)
mstate Multi-state models
frailtypack Frailty models
gtsummary Table 1 and regression tables
ggplot2 Grammar of graphics
patchwork Multi-panel figure assembly
ggsci Journal colour palettes
dplyr / tidyr Data wrangling
renv Package version management

11.3 Configuration Files

File Location Purpose
Makefile Project root All pipeline targets
setup.sh Project root Environment bootstrap
verify_environment.sh Project root Health check
renv.lock Project root R package versions
.python-version Project root Python version pin
_quarto.yml Per-project manuscript dir Quarto render settings

11.4 Simulation Scenarios

Scenario Description Routed To
1 Standard single-endpoint sa-standard-km
2 Competing risks (2 event types) sa-competing-risks
3 Recurrent events sa-recurrent-multistate
4 Multi-state transitions sa-recurrent-multistate
5 Time-varying exposure sa-time-varying
6 Complex (multiple flags) Multiple modules
7 Combined adjustments needed Primary + sa-advanced-adjustments

11.5 Troubleshooting

WarningCommon Issues

frailtypack fails to install — Install gfortran first: brew install gcc on macOS.

Quarto PDF rendering fails — Install TinyTeX: quarto install tinytex.

renv::restore() hangs — Delete renv/library/ and re-run bash setup.sh.

Diagnostic router returns “unknown path” — Ensure make diagnose completed successfully and check 02_diagnostics/diagnostic_report.json.

Figures are low resolution — Verify dpi = 300 in ggsave() calls; check the units argument matches your width/height.