Skip to content

Flow Cytometry

Flow cytometry measures protein on single cells as they pass a laser, and the analysis problem is not the measurement but the gate. A panel of ten colours produces 45 biaxial plots, and a 40-marker spectral panel produces 780. The person who draws the gates by hand is a large source of variation between laboratories, and the software that replaces them is almost all command-line R that clinical labs do not use.

This section takes public data through the full computational path, in R, in one pinned container. Every number on these pages comes from a real run of the code you can read on the page, and the run needs no network, because the container carries the data.

The first four pages are the concepts, and they carry no code. Everything after them runs.

Page What it does
How flow cytometry works fluidics, optics and detectors, what scatter measures, where spillover comes from
Compensation and panel design why spectral overlap needs correcting, and how to choose a panel that avoids the worst of it
Manual versus automated gating the reproducibility argument, and what the high-dimensional alternatives are
Analysis tools the R and Python package landscape, and where each one fits
The FCS file and flowCore the file format, and what flowCore sees when it opens one
FCS I/O reading one file and a set, parameters, keywords, the metadata you must keep
Compensation the spillover matrix applied, and the correction seen on ten thousand events
Transformation and QC logicle and arcsinh side by side, and removing poor events with flowAI
Gating the sequential hierarchy, and what one fixed boundary costs across two samples
Automated gating an openCyto template, fitted per sample, including a gate that fails
Clustering FlowSOM and UMAP to find populations the gate did not name
Identifying cells from clusters scoring each cluster against a table of marker rules, and the margin that says which labels to trust
Harmonisation how much of a flow result is the analyst, and what a centralised analysis removes

Three further pages run on deposits too large to ship in a container. They carry a visible note saying so, and every number on them comes from a real run in the everything-flow-cytometry repository rather than from this site’s own.

Page What it does
Computing compensation from controls building the spillover matrix from single stains, and finding the stored one was typed by hand
Gating a published panel an openCyto template against OMIP-039, where the authors’ own gates are deposited too
Spectral flow cytometry what unmixing changes, the channel that silently disappears, and a 35 marker reanalysis

The package set for computational cytometry lives in R and Bioconductor: flowCore, flowAI, ggcyto, CATALYST, FlowSOM, and HDCytoData for the bundled teaching datasets. Python reads FCS files into AnnData, but the gating and clustering workflow is R. These pages are R only, and the runnable scripts live in the companion code repo under guides/flow-cytometry/.

The pages use two sources. The I/O, compensation and transformation pages use the small FCS files that ship inside flowCore, so nothing is downloaded. The gating, clustering and harmonisation pages use the Bodenmiller BCR-XL dataset, which ships inside the Bioconductor HDCytoData package, and the container carries it already, so no page downloads anything. The real 103 GB archive behind the larger reports is referenced in the prose but never needed to reproduce a number here.