.qmd notebook is and why we use one.Tip
You do not need to be a software engineer. You need to know the tools well enough to use them confidently and interpret what they do.
Tip
The #1 single-cell bottleneck is RAM: a big count matrix must fit in memory. “Out of memory” usually means get more RAM or move to the cluster, not a faster CPU.
CPU
GPU
Note
Most of this workshop runs on the CPU. GPUs matter for deep-learning steps and a few accelerated tools — covered in Module 09.
| Tier | Typical latency | Volatile? | Example |
|---|---|---|---|
| CPU cache | ~1 ns | yes | L1/L2 inside the chip |
| RAM | ~100 ns | yes | 16–64 GB laptop, 256 GB–4 TB server |
| SSD | ~0.1 ms | no | laptop local drive |
| HDD / NAS | ~10 ms | no | lab server, archive |
| Cloud / HPC scratch | variable | no | Talapas /projects/ |
Note
scRNA-seq count matrices are read from disk once, held in RAM for analysis, and written back to disk as .rds or .h5 files. Keep your inputs on fast storage and your working data in RAM.
Tip
Unix/Linux is the lingua franca of scientific computing — the same shell commands work on your Mac laptop and on Talapas.
/ on Unix/macOS (or C:\ on Windows)./home/wcresko/scRNAseq_tutorial/data/counts.rds../data/counts.rds. = here, .. = one level up, ~ = your home directory.Files live in a tree of directories rooted at /. Your home (~) is your branch; paths are addresses within the tree.
Ctrl/Cmd + `).Every shell command has the same shape: the command, its options/flags (e.g. -l), and its arguments (what it acts on).
Tip
ls -la shows everything — including hidden configuration files whose names start with .
cd/ — unambiguous from anywhere.., or .. — shorter, and survive moving the whole project.You’re in /home/wcresko/scRNAseq_tutorial/data. Get to scripts/ two ways:
Note
Relative paths are portable — move the project folder and they still work. Absolute paths are unambiguous but break if anything above them moves.
Warning
rm has no Trash. rm -r is permanent and recursive — always double-check the path before running it.
Warning
Never cat a huge file — a 3 GB genome file will flood your terminal. Use head, tail, or less; they never load the whole file into memory.
Wildcards let one command act on many files at once.
cd ~/p1_practice
touch sample_01.fastq sample_02.fastq sample_03.fastq control.fastq notes.md
ls *.fastq # everything ending in .fastq
ls sample_*.fastq # the three sample_ files
ls sample_0?.fastq # ? matches exactly one character
ls sample_0[12].fastq # only sample_01 and sample_02
ls *.{fastq,md} # brace expansion: .fastq OR .mdTip
Wildcards are expanded by the shell before the command runs — so rm *.fastq deletes every matching file in one command.
Two ideas power most command-line work:
# Redirection — save output to (or read input from) a file
ls -l > listing.txt # write (overwrites)
echo "generated $(date)" >> listing.txt # append
wc -l < big.txt # feed a file as input
# Pipes — stream output of one command into the next
cat big.txt | wc -l # count lines via pipe
head -n 50 big.txt | tail -n 5 # lines 46–50
ls *.fastq | wc -l # how many .fastq files?
# A longer pipeline: most common words in a file
cat readme.txt | tr ' ' '\n' | sort | uniq -c | sort -rn | headTip
> saves to disk. | streams straight into another program. They combine freely: ls | wc -l > count.txt.
Every Unix program has three standard streams:
| Stream | Number | Default | Redirect |
|---|---|---|---|
| stdin | 0 | keyboard | < file |
| stdout | 1 | terminal | > file or >> file |
| stderr | 2 | terminal | 2> errors.log |
wget / curlGenomic references and datasets usually come from a URL — fetch them directly, no browser needed.
cd ~/p1_practice
# wget — straightforward download
wget https://raw.githubusercontent.com/githubtraining/hellogitworld/master/README.txt
# curl — -o names the output file
curl -o readme_copy.txt \
https://raw.githubusercontent.com/githubtraining/hellogitworld/master/README.txt
ls -lh README.txt # -h = human-readable size
head README.txtTip
On Talapas you will use wget to pull reference genomes and annotation files straight to /projects/. Same command, no GUI needed.
| Task | Command |
|---|---|
| Where am I? | pwd |
| What’s here? | ls -lF |
| Go somewhere | cd path |
| Make a folder | mkdir name |
| Copy | cp src dst |
| Move / rename | mv src dst |
| Delete file | rm file |
| Delete folder | rm -r dir |
| Peek at a file | head / tail / less |
| Count lines | wc -l file |
| Download | wget URL |
| Save output | cmd > file |
| Chain commands | cmd1 \| cmd2 |
RStudio
VS Code
.qmd documents.qmd documents, live preview in the editor..csv files as a formatted table.Install from the Extensions panel (Ctrl/Cmd + Shift + X) or from the command line:
Ctrl/Cmd + \.Ctrl/Cmd + `.Ctrl/Cmd + Shift + P) — access almost every VS Code command by typing.File → Open Folder… opens the root of a project.Ctrl/Cmd + ` — a full shell inside the editor window.Tip
Ctrl/Cmd + ` toggles the terminal open and closed — one of the most useful shortcuts.
.qmd files: edit prose and code chunks side by side; click Preview or Ctrl/Cmd + Shift + K to render..R files: send lines to an R terminal with Ctrl/Cmd + Enter — exactly like RStudio..qmd chunk with the ▶ button above the chunk (ignores eval: false — runs interactively regardless).| What | Shortcut |
|---|---|
| Toggle word wrap | Alt+Z |
| Find in file | Ctrl/Cmd+F |
| Find across all files | Ctrl/Cmd+Shift+F |
| Go to line | Ctrl/Cmd+G |
| Format file | Shift+Alt+F |
| New terminal | Ctrl/Cmd+Shift+` |
| Split editor | Ctrl/Cmd+\ |
| Command Palette | Ctrl/Cmd+Shift+P |
Tip
Split the editor (Ctrl/Cmd + \) to see a .qmd source and its live preview side by side.
Tip
Rule of thumb: prototype small on your laptop (Wednesday/Thursday), or in interactive mode on Talapas (Friday) then scale the same workflow up on Talapas using batch jobs (Friday, Module 09).
All Modules 00–08 use the same folder layout. Set it up once; use it everywhere.
data/raw/ is read-only — always read from here, never write to it.output/ is expendable — everything in it can be regenerated from scripts/ + data/raw/.../data/raw/counts.rds) so the project is portable._ or - instead (module_01_qc.qmd, not module 01 qc.qmd).2026-06-09_umap_clusters.png.output/ or data/processed/.01_qc.R, 02_normalize.R, 03_cluster.R..qmd notebook?.qmd file is plain text that mixes prose (Markdown), code chunks (R, Python, bash), and output (plots, tables)..qmd — you edit, run, and read the same file.Note
eval: false in a document’s YAML header prevents its chunks from running on render — the workshop chapters and tutorials use this so the site shows the code without executing it (the lecture decks run their chunks). The ▶ button in VS Code or RStudio runs a chunk interactively regardless.
Tip
Same commands, bigger machine. pwd, ls, cd, pipes, redirection — all of it works the same on a compute node.
pwd/ls/cd; mkdir/cp/mv/rm; head/tail/less; wildcards; pipes | and redirection >/>>; wget/curl.scripts/ + data/raw/ + output/ — consistent across Modules 00–08..qmd — prose + code + output in one reproducible document.Tip
Everything from today — the shell, VS Code, project layout — is the scaffolding. P2 adds the R layer on top, and then the analysis modules fill it with biology.
Single Cell RNA-seq Workshop · P1 — Computer Systems & the Command Line