Bootcamp / Session 4 / 4.0

Session 4.0 · Pre-work, about 15 minutes

Get the notebooks running before Friday.

Session 4 is taught from four marimo notebooks: Python notebooks that run in your browser and rerun every cell that depends on the one you change. One small tool, uv, installs Python, marimo, and every package the notebooks need.

Stuck? Email biocore@umassmed.edu macOS or Windows · Your own computer, with permission to install software

Set up

Can’t install software on your computer? Come anyway. Manuel runs every notebook live, and you can follow on the projector.

Open a terminal

macOS: press Cmd+Space, type Terminal, and press Enter.

Windows: click Start, type PowerShell, and press Enter.

Paste each command below into the terminal and press Enter.

Install uv and Python

uv runs the notebooks, and it also installs Python for you: no Python installer to download and no admin rights needed. A Python you installed earlier does no harm; uv keeps its own.

macOS:

curl -LsSf https://astral.sh/uv/install.sh | sh

Windows PowerShell:

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Close the terminal and open a new one, so it finds the new uv command. If you use the terminal inside VS Code and uv is still not found, quit VS Code completely and open it again.

Had uv already, from before today? Update it, because the notebooks need uv 0.7.21 or newer. If it answers that uv was installed another way (pip or Homebrew), update it that way, or use the troubleshooting prompt in the next step.

uv self update

Then, on either system:

uv --version
uv python install
uv run python --version

Already set up Claude Code or Codex in 3.0? You can ask it to do this step instead. It asks before each command it runs, so read each one and allow it:

Check whether uv is installed and is version 0.7.21 or newer. If it is older, update it. If it is missing, install it with the official installer from astral.sh for my operating system (the install.sh script on macOS, the install.ps1 script in PowerShell on Windows). Then run uv python install, and show me the output of uv run python --version. If a step fails, stop and tell me what it said.

Checkpoint The first command prints uv 0.7.21 or newer, and the last prints a Python version, such as Python 3.13.7. If an install fails, see the next step.

If an install fails, fix it with your agent

Errors during installs are normal, and an agent is good at reading them. Select the whole error in the terminal, copy it, and paste it into Claude Code or Codex (from 3.0) inside this prompt, replacing the two lines in angle brackets. No agent set up? A claude.ai chat works too.

I ran this command in a terminal on my computer: <paste the command> It failed with this error: <paste the full error> Tell me which operating system and terminal you think I am using, explain in plain words what went wrong, and suggest the smallest fix. Do not run anything until I say yes.
  • Paste the whole error, not just the last line. The cause is often near the top.
  • Before you paste, delete anything that looks like a password or access token.
  • Read the fix before you allow it. If it needs admin rights (sudo on macOS, Run as administrator on Windows), stop and email biocore@umassmed.edu.
  • Still stuck after two tries? Email biocore@umassmed.edu with the command and the error. Come on Friday anyway: Manuel runs every notebook live.

Make your Session 4 folder

Everything for Session 4 goes in one folder, Documents/bootcamp/session4: the notebooks, their data, and the folder you work in during 4.2. Later sessions get their own folder next to it. Make it and move into it:

macOS:

mkdir -p ~/Documents/bootcamp/session4
cd ~/Documents/bootcamp/session4

Windows PowerShell:

$S4 = Join-Path ([Environment]::GetFolderPath('MyDocuments')) 'bootcamp\session4'
New-Item -ItemType Directory -Force $S4 | Out-Null
cd $S4

macOS may ask whether Terminal can use your Documents folder; click Allow. On Windows, the first line finds your real Documents folder, also when OneDrive keeps it, so it is the same Documents you see in File Explorer.

Checkpoint pwd prints a path that ends in Documents/bootcamp/session4 (on Windows, Documents\bootcamp\session4).

Download the notebooks

From the session folder, download the course repository, unzip it, and move into it. No git needed.

macOS:

curl -L -o bootcamp-bulk-rnaseq.zip https://github.com/UMMS-Biocore/bootcamp-bulk-rnaseq/archive/refs/heads/main.zip
unzip -o bootcamp-bulk-rnaseq.zip
cd bootcamp-bulk-rnaseq-main

Windows PowerShell:

curl.exe -L -o bootcamp-bulk-rnaseq.zip https://github.com/UMMS-Biocore/bootcamp-bulk-rnaseq/archive/refs/heads/main.zip
Expand-Archive bootcamp-bulk-rnaseq.zip -DestinationPath . -Force
cd bootcamp-bulk-rnaseq-main
GIT Use git instead
From the session folder, on either system. The last word names the folder the same as the ZIP does, so every later step still fits.
git clone https://github.com/UMMS-Biocore/bootcamp-bulk-rnaseq.git bootcamp-bulk-rnaseq-main
cd bootcamp-bulk-rnaseq-main

Already downloaded it somewhere else, such as your Desktop? Run these lines anyway, so all of Session 4 sits in one folder.

Checkpoint You are in the notebook folder, Documents/bootcamp/session4/bootcamp-bulk-rnaseq-main: ls lists files such as 02_ttest_is_lm.py. Every command below runs from here.

Download the data

One file holds every dataset the notebooks use (10 MB). Still in the notebook folder, bootcamp-bulk-rnaseq-main, download it and unzip it there. Its folders match the repository, so each file lands where the notebooks look for it.

macOS:

curl -LO https://biocore.umassmed.edu/data/session4/session4_data.zip
unzip -o session4_data.zip

Windows PowerShell:

curl.exe -LO https://biocore.umassmed.edu/data/session4/session4_data.zip
Expand-Archive session4_data.zip -DestinationPath . -Force
WHAT What is in it
  • data/array/: the GEO microarray dataset GSE8658 (human monocyte-derived dendritic cells) and its probe-to-gene map, for notebooks 1 and 4.
  • data/genes/: gene lengths from GENCODE v44, for computing TPM.
  • data/rnaseq/: a public dendritic-cell RNA-seq count table, for notebook 4.

Open a notebook

uvx marimo edit --sandbox 02_ttest_is_lm.py

The first run takes a minute or two while uv downloads the packages listed at the top of the notebook. marimo then opens the notebook in your browser.

Checkpoint The notebook shows figures and a table of coefficients, with no red error boxes. Notebook 2 uses only simulated data, so it needs no downloads. If it runs, you are ready for Friday. Press Ctrl+C in the terminal to stop marimo.

WHY Why --sandbox?
Each notebook lists the packages it needs in its first lines. With --sandbox, uv builds a private environment from that list, so nothing you install here touches any other Python on your computer.

Optional: open notebook 4

Notebook 4 reads the RNA-seq table from the data you just unzipped. Tell it where with BULK_RNASEQ_DIR.

macOS:

BULK_RNASEQ_DIR=data/rnaseq uvx marimo edit --sandbox 04_variance_estimation.py

Windows PowerShell:

$env:BULK_RNASEQ_DIR = "data/rnaseq"
uvx marimo edit --sandbox 04_variance_estimation.py

Checkpoint The replicate scatter plots and the variance-versus-mean curves appear, with no yellow “Not found” box.

Next time: back to the notebook folder

Every new terminal starts in your home folder. Before running a notebook in 4.1, go back to the notebook folder:

macOS:

cd ~/Documents/bootcamp/session4/bootcamp-bulk-rnaseq-main

Windows PowerShell:

cd (Join-Path ([Environment]::GetFolderPath('MyDocuments')) 'bootcamp\session4\bootcamp-bulk-rnaseq-main')