This repo provides a reproducible environment for Case Study 4 using:
- Docker (RStudio Server + Quarto)
- A project-local Python environment (
.venv) - PyCoGAPS built from source (includes the C++ CoGAPS core)
This project assumes you download the dataset once via your browser and mount it into the container.
The notebook expects the dataset at:
/opt/data/kang_counts_25k.h5ad
Download the file from Figshare (use a web browser if curl fails):
Save it as:
kang_counts_25k.h5ad
Create a local folder (in the repo root) and place the file there:
mkdir -p data_mount
# move or save the downloaded file here:
# data_mount/kang_counts_25k.h5adFrom the repo root (where the Dockerfile is):
docker build --platform linux/amd64 -t cogaps-case-study4:dev .Apple Silicon Macs: the
--platform linux/amd64flag is required.
This run command mounts:
- your local repo →
/home/rstudio/project(so edits + renders persist on your machine) - your dataset folder →
/opt/data(read-only)
docker run --platform linux/amd64 -it --rm \
-p 8787:8787 \
-e PASSWORD="Password12" \
-v "$PWD":/home/rstudio/project \
-w /home/rstudio/project \
-v "$PWD/data_mount":/opt/data:ro \
cogaps-case-study4:devOpen:
- http://localhost:8787
- User:
rstudio - Password:
Password12(or whatever you set)
In RStudio → Terminal:
cd /home/rstudio/project
bash setup_venv.sh(Optional sanity check)
source _environment
quarto check jupyterOpen the .qmd file in RStudio and run chunks one by one:
cogaps_case_study4_student.qmd(render-safe version recommended)
cd /home/rstudio/project
source _environment
quarto render cogaps_case_study4_student.qmdRun distributed CoGAPS as a standalone script (not during Quarto render):
cd /home/rstudio/project
source _environment
./.venv/bin/python run_pycogaps_distributed.pyThis should write:
data/cogaps_result_distributed.h5ad