Files
learn-tte/run_all.sh
T
2026-06-08 10:15:36 -07:00

36 lines
1.9 KiB
Bash
Executable File

#!/usr/bin/env bash
# Run the current learning project workflow end to end.
#
# This is intentionally simpler than a targets pipeline.
# It gives us one command that runs the simulation smoke check and renders the
# Quarto notebooks while the project is still small.
set -euo pipefail
# Make the script work even if it is called from another directory.
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$script_dir"
mkdir -p "outputs/reports"
Rscript "scripts/01_simulate_icu_data.R"
quarto render "notebooks/01_target_trial_basics.qmd" --output-dir "../outputs/reports"
quarto render "notebooks/02_explore_simulated_data.qmd" --output-dir "../outputs/reports"
quarto render "notebooks/03_why_naive_analysis_is_biased.qmd" --output-dir "../outputs/reports"
quarto render "notebooks/04_inverse_probability_weighting.qmd" --output-dir "../outputs/reports"
quarto render "notebooks/05_treatment_assignment_windows.qmd" --output-dir "../outputs/reports"
quarto render "notebooks/06_censoring_and_ipcw.qmd" --output-dir "../outputs/reports"
quarto render "notebooks/07_full_emulation_pipeline.qmd" --output-dir "../outputs/reports"
quarto render "notebooks/01_target_trial_basics.qmd" --to docx --output-dir "../outputs/reports"
quarto render "notebooks/02_explore_simulated_data.qmd" --to docx --output-dir "../outputs/reports"
quarto render "notebooks/03_why_naive_analysis_is_biased.qmd" --to docx --output-dir "../outputs/reports"
quarto render "notebooks/04_inverse_probability_weighting.qmd" --to docx --output-dir "../outputs/reports"
quarto render "notebooks/05_treatment_assignment_windows.qmd" --to docx --output-dir "../outputs/reports"
quarto render "notebooks/06_censoring_and_ipcw.qmd" --to docx --output-dir "../outputs/reports"
quarto render "notebooks/07_full_emulation_pipeline.qmd" --to docx --output-dir "../outputs/reports"
printf '\nWorkflow complete. Reports are in outputs/reports/.\n'