Analysis Tools
Most flow cytometry labs use GUI software like FlowJo or FCS Express. These tools are excellent for small panels and routine immunophenotyping. But as panels grow beyond 20 parameters, scripted analysis in R or Python becomes essential for reproducibility and scalability.
Traditional GUI Software
Section titled “Traditional GUI Software”FlowJo is a commercial package for manual gating, compensation, basic statistics, and figure export. It runs on Mac and Windows.
FCS Express offers similar functionality with stronger integration into PowerPoint and Excel workflows. Some labs prefer it for its layout and reporting features.
These tools work well for conventional panels of up to 10 markers. Their main limitation is manual gating. Every analysis requires an operator to draw gates by hand, which introduces the reproducibility problems discussed in the previous page.
R Packages
Section titled “R Packages”R has the most mature set of packages for computational flow cytometry. The Bioconductor project hosts most of them.
Reading and Managing Data
Section titled “Reading and Managing Data”flowCore is the foundation package. It reads FCS files into R, stores events as a flowFrame object, and provides basic operations like compensation, transformation, and simple gating. Almost every other flow cytometry package in R depends on flowCore. The FCS I/O page reads one file and a set of files with it.
flowWorkspace manages gating hierarchies. It stores a tree of gates applied to a flowSet, making it easy to extract populations at any level. This is the R equivalent of the gating tree you see in FlowJo.
Visualization
Section titled “Visualization”ggcyto extends ggplot2 for flow cytometry data. It understands flowFrame and GatingSet objects, so you can create publication quality dot plots, density plots, and histograms with familiar ggplot2 syntax.
library(ggcyto)autoplot(gs[[1]], "CD4", "CD8")CytoExploreR provides interactive exploration of flow cytometry data. It is useful for quickly inspecting gating strategies and comparing samples during early analysis.
Automated Gating
Section titled “Automated Gating”openCyto implements template based automated gating. You define your gating hierarchy in a CSV file specifying which algorithm to use at each step. The package then applies those gates consistently across all samples, and the same template produces the same gates on every run. The automated gating page prints a four-row template and fits it to two samples.
Unsupervised Clustering
Section titled “Unsupervised Clustering”FlowSOM clusters cells across all markers at once with a self-organizing map. It takes the number of metaclusters as an argument, so it works best when you have a reasonable estimate of the number of populations. The clustering page runs it on the Bodenmiller panel.
Differential Analysis
Section titled “Differential Analysis”CATALYST provides a complete workflow for differential discovery and differential abundance analysis. It is designed for mass cytometry. CATALYST handles clustering, dimensionality reduction, and statistical testing for differences between conditions.
Analysis in Seurat
Section titled “Analysis in Seurat”Seumetry stores cytometry data in a Seurat object, so the R tools built for single-cell RNA-seq run on it, as pytometry does for scanpy in Python. The clustering page runs it on the same 20000 Bodenmiller events as R FlowSOM and pytometry, through its isolation forest outlier score, FlowSOM and Seurat’s Louvain clustering. It also tests differential abundance with edgeR and differential expression with limma, and it does not gate or unmix, so pre-gate and unmix before you load the files.
Python Packages
Section titled “Python Packages”Python tools for flow cytometry are less mature than the R packages, and they are growing.
Reading FCS Files
Section titled “Reading FCS Files”FlowIO and fcsparser both read FCS files into Python. FlowIO is a pure Python implementation. fcsparser is simpler and returns data as a pandas DataFrame.
import fcsparsermeta, data = fcsparser.parse("sample.fcs")FlowKit reads FCS files, applies compensation and transforms, and imports gates from GatingML 2.0 and FlowJo workspaces.
pytometry reads FCS files into AnnData and adds compensation, the cytometry transforms and FlowSOM on top of scanpy. The clustering page runs its self-organizing map beside the R FlowSOM package.
Calibration
Section titled “Calibration”FlowCal provides calibration routines for converting arbitrary fluorescence units to standardized units using calibration beads. This is important for quantitative flow cytometry where you need to compare fluorescence intensities across experiments.
Repurposing Single-Cell Tools
Section titled “Repurposing Single-Cell Tools”Some researchers use scanpy and anndata for flow cytometry analysis. These tools were built for single-cell RNA-seq, but the data structure is similar: cells as rows, features as columns. Loading flow cytometry data into an AnnData object gives you access to UMAP, Leiden clustering, and the rest of scanpy.
import anndata as adimport scanpy as sc
adata = ad.AnnData(X=data[markers].values)sc.pp.neighbors(adata)sc.tl.umap(adata)sc.tl.leiden(adata)scanpy on its own has no compensation and no FCS reader, so the data must be preprocessed before it reaches anndata. pytometry fills that gap.
Unsupervised Analysis Concepts
Section titled “Unsupervised Analysis Concepts”The manual versus automated gating page explains why panels of more than 10 markers need clustering, and how FlowSOM, PhenoGraph and Leiden differ. All of them run on transformed values, and the transformation page compares the arcsinh transform with logicle, with the usual cofactors of 5 for mass cytometry and 150 for fluorescence.
Dimensionality Reduction
Section titled “Dimensionality Reduction”UMAP and tSNE reduce high-dimensional cytometry data to two dimensions for visualization. These are the same algorithms used in single-cell RNA-seq analysis. They show the overall structure of cell populations but should not be used for quantitative analysis. Distances on a UMAP plot do not represent real distances in marker space.
R vs Python Comparison
Section titled “R vs Python Comparison”| Feature | R | Python |
|---|---|---|
| FCS file reading | flowCore, full spec support | FlowIO, fcsparser, FlowKit, pytometry |
| Compensation | flowCore (built-in) | FlowKit, pytometry |
| Automated gating | openCyto (mature, template-based) | No template-based equivalent |
| Unsupervised clustering | FlowSOM, CATALYST | pytometry FlowSOM, scanpy Leiden |
| Visualization | ggcyto (publication quality) | matplotlib, scanpy plots |
| Community and publications | Large, established | Growing |
| Best for | Standard and high-dimensional analysis | Integration with ML pipelines |
For most flow cytometry analysis, R is the stronger choice. The Bioconductor packages were built for this data type. Python is a good option when you need to integrate flow cytometry data with machine learning workflows or when your lab already works primarily in Python.
Choosing Your Tools
Section titled “Choosing Your Tools”If you are starting a new flow cytometry analysis project, here is a practical guide:
- Small panels (up to 10 markers), routine work: FlowJo or FCS Express. Manual gating is fine.
- Small panels, need reproducibility: openCyto in R with a gating template.
- Large panels (more than 10 markers): FlowSOM or CATALYST in R. Manual gating cannot cover all dimensions.
- Integration with Python ML pipelines: Load preprocessed data into anndata and use scanpy, or pytometry for the cytometry steps.
Scientific references
Section titled “Scientific references”Wolf, Angerer, and Theis, 2018 describe Scanpy, the Python toolkit for large-scale single-cell expression analysis.
Further reading
Section titled “Further reading”The ggcyto autoplot reference distinguishes channel arguments for a flow frame from population arguments for a gating hierarchy.
The fcsparser reference shows how parse returns metadata and a data table, and lists the supported FCS versions.
The AnnData constructor reference defines the cells-by-features matrix and its observation and variable annotations.
The Scanpy neighbors reference explains the representation and neighbor graph used before UMAP or clustering.
The Scanpy UMAP reference describes how the neighbor graph produces an embedding.
The Scanpy Leiden reference documents the graph partition and its resolution, random seed, and implementation choices.