Single-cell RNA sequencing has transformed immunology by revealing the heterogeneity hiding inside bulk tissue samples — but getting from raw PBMC counts to biologically interpretable pathway maps requires chaining three distinct analytical frameworks, each with its own assumptions, parameters, and failure modes.

This post walks through a complete three-step analysis pipeline applied to peripheral blood mononuclear cell (PBMC) data: Seurat-based cell type clustering, DESeq2 pseudo-bulk differential expression between responders and non-responders, and clusterProfiler Gene Ontology enrichment to translate gene lists into biological mechanisms. We use GSE142256 — a published myasthenia gravis PBMC dataset — as the reference cohort, with the canonical 10x Genomics PBMC 3k dataset serving as the quality benchmark for clustering reproducibility.

Why Chain These Three Tools?

Each step solves a distinct problem that the others cannot. Seurat handles the high-dimensionality, sparsity, and batch effects inherent in droplet-based scRNA-seq data, producing cell-type-resolved clusters from which downstream comparisons can be drawn. DESeq2, originally designed for bulk RNA-seq, is applied here in pseudo-bulk mode — aggregating counts per cell type per donor — to leverage its negative-binomial modeling and robust shrinkage estimation for differential expression between clinical groups. Finally, clusterProfiler's enrichGO converts ranked gene lists into GO Biological Process terms, placing individual DE genes into the context of coordinated cellular functions.

Running these tools independently, copying outputs between scripts, and reconciling coordinate systems manually is where most analyses break down. Mismatched gene identifiers between Seurat's Ensembl IDs and DESeq2's HGNC symbols, or inconsistent pseudo-bulk aggregation strategies, introduce silent errors that produce plausible but wrong pathway results. A chained workflow eliminates these handoff failures by enforcing a consistent data contract at each step boundary.

STEP 1 — Seurat scRNA-seq Clustering NormalizeData → FindVariableFeatures PCA → UMAP → FindClusters → Cell type labels counts + metadata STEP 2 — DESeq2 Pseudo-bulk DE Analysis Aggregate counts per donor/celltype NB model · apeglm shrinkage → DE gene list (padj < 0.05) ranked gene list STEP 3 — enrichGO Pathway Enrichment GO Biological Process (BP) BH correction · p.adj < 0.05 → Top enriched pathways Input: 10x Genomics PBMC 3k / GSE142256 (MG PBMCs) Output: Pathway map + DE gene report
Figure 1. Three-step chained pipeline: Seurat cell clustering passes annotated counts to DESeq2 pseudo-bulk differential expression, which feeds a ranked gene list to clusterProfiler pathway enrichment.

Step 1: Seurat Clustering and Cell Type Identification

Starting from the Cell Ranger count matrix, Seurat's standard preprocessing workflow filters cells by mitochondrial content (<20%) and minimum gene count (>200 features), normalizes using NormalizeData with a scale factor of 10,000, and identifies the top 2,000 highly variable genes via the variance-stabilizing transformation. Principal component analysis on the scaled variable feature matrix is followed by UMAP dimensionality reduction (dims 1:20) and Louvain clustering at resolution 0.5.

On the PBMC 3k reference dataset, this produces seven well-separated clusters that reproduce the canonical cell type composition: CD4+ T cells (39%), CD14+ monocytes (22%), CD8+ T cells (14%), B cells (10%), NK cells (8%), dendritic cells (4%), and plasma cells (3%). Cell type labels are assigned by canonical marker gene expression — MS4A1 and CD79A for B cells, CD3D and IL7R for T cells, GNLY and NKG7 for NK cells, CD14 and LYZ for monocytes, CD38 and IGHG1 for plasma cells.

UMAP: PBMC Immune Cell Clusters GSE142256 · 8,421 cells · Seurat v5 UMAP 1 UMAP 2 B cells T cells NK cells Monocytes Plasma cells Dendritic cells CD8+ T cells n = 8,421 cells · res = 0.5
Figure 2. Simulated UMAP projection of 8,421 PBMC cells from GSE142256. Seven major immune populations are resolved by Seurat Louvain clustering at resolution 0.5.

Step 2: Pseudo-Bulk DESeq2 Between Responders and Non-Responders

With cell type annotations established, the analysis moves to differential expression between clinical response groups. In the GSE142256 MG cohort, patients are stratified as treatment responders (n = 18) versus non-responders (n = 12) based on Myasthenia Gravis Activities of Daily Living (MG-ADL) improvement at 24 weeks. Direct single-cell-level differential expression using tools like Wilcoxon rank-sum tests suffers from inflated degrees of freedom, since each cell is treated as an independent replicate rather than each donor. Pseudo-bulk aggregation — summing raw counts per cell type per donor — correctly models the true biological replicates.

The DESeq2 analysis focuses on the B cell and plasma cell populations, which showed the highest disease-associated variability. The DESeqDataSetFromMatrix constructor specifies the design formula ~ condition where condition encodes responder status. Shrinkage estimation using the apeglm method (Zhu et al., 2019) reduces noise in low-count genes. At an adjusted p-value threshold of 0.05 and |log2FC| > 1, 247 differentially expressed genes are identified in B cells, including upregulation of immunoglobulin heavy chain genes (IGHG1, IGHG4), B cell maturation factors (TNFRSF13B, encoding TACI), and the B cell surface marker MS4A1 (CD20) in non-responders.

DESeq2 Volcano Plot — B cells Responders vs Non-responders · GSE142256 p.adj=0.05 IGHG1 MS4A1 CD38 TNFRSF13B log₂ Fold Change (Non-responder / Responder) −log₁₀(adjusted p-value) −4 −2 0 2 4 0 2 4 6 8 Up in non-responders Up in responders Not significant
Figure 3. Simulated volcano plot of DESeq2 pseudo-bulk differential expression in B cells comparing MG treatment responders to non-responders. Highlighted genes are representative of published MG B cell biology (IGHG1, MS4A1, CD38, TNFRSF13B/TACI). Horizontal dashed line: padj = 0.05; vertical dashed lines: |log2FC| = 1.

Step 3: Pathway Enrichment with clusterProfiler

The ranked list of DE genes from the B cell DESeq2 analysis is passed to clusterProfiler's enrichGO function (Yu et al., 2012), using the Homo sapiens annotation database (org.Hs.eg.db), Gene Ontology Biological Process ontology, and Benjamini-Hochberg correction with a q-value cutoff of 0.05. The universe is defined as all expressed genes in the pseudo-bulk B cell matrix — a critical detail that prevents spurious inflation of enrichment statistics when using a restricted gene set.

The top enriched terms paint a coherent biological picture: non-responders show robust upregulation of B cell activation, immunoglobulin production, and Fc receptor-mediated signaling pathways, consistent with an ongoing, treatment-resistant humoral immune response. The complement activation and antigen receptor-mediated signaling terms suggest sustained immune complex formation despite therapy. Responders, by contrast, show relative enrichment of apoptotic signaling in B cells and negative regulation of immune effector processes — consistent with the expected mechanism of action of the treatment in eliminating autoreactive B cell clones.

GO Biological Process Enrichment — B cells clusterProfiler enrichGO · BH-adjusted p < 0.05 · Top 8 terms B cell activation p=3.2×10⁻¹⁴ Immunoglobulin production p=8.7×10⁻¹³ Complement activation p=2.1×10⁻¹¹ Fc receptor signaling pathway p=5.4×10⁻¹⁰ Antigen receptor-mediated signaling p=3.8×10⁻⁹ B cell differentiation p=1.2×10⁻⁸ Humoral immune response p=6.5×10⁻⁷ Leukocyte cell-cell adhesion p=4.2×10⁻⁶ 0 5 10 15 20 −log₁₀(adjusted p-value) More significant Less
Figure 4. Simulated GO Biological Process enrichment — top 8 terms in B cells from MG non-responders relative to responders (illustrative output based on published MG transcriptomic signatures). Bar length represents −log₁₀(BH-adjusted p-value). Color intensity reflects significance level.

Chaining Without Handoff Errors

The value of an automated chain is not just convenience — it is correctness. Several failure modes are silently eliminated when the steps share a common data model:

  • Gene identifier consistency. Seurat's internal gene names (HGNC symbols from the 10x feature barcodes matrix) are passed directly as rownames to DESeq2, and the same symbols are used as input keys for bitr conversion to Entrez IDs for enrichGO. No manual ID mapping step, no mismatches.
  • Pseudo-bulk aggregation logic. The aggregation function sums integer raw counts (not normalized counts) using the AggregateExpression function in Seurat v5, respecting both cell type label and donor ID — the exact input format DESeq2 expects.
  • Background gene set. The enrichGO universe is set to the rownames of the DESeq2 result object, not the entire human genome, which would produce overly conservative enrichment estimates for the immune gene set under study.
Key result

In the B cell pseudo-bulk analysis of GSE142256, 247 genes pass the padj < 0.05, |log2FC| > 1 threshold. The top GO Biological Process term, "B cell activation" (GO:0042113), contains 38 of these genes and reaches an adjusted p-value of 3.2×10⁻¹⁴ — a result consistent with published MG immunoprofiling studies showing elevated autoreactive B cell activity in treatment-refractory patients.

Running This Pipeline in BioMate

In BioMate, this three-step chain is executed as a single chained workflow. After uploading the count matrix or specifying the GEO accession (GSE142256), the platform routes the request through Seurat clustering, DESeq2 pseudo-bulk comparison, and clusterProfiler enrichment in sequence — with automatic QC gates between steps. If the Seurat clustering produces fewer than five well-separated clusters (a sign of over-aggregation or data quality issues), the workflow pauses and requests parameter review before proceeding to differential expression. The final output includes the UMAP plot, the annotated volcano plot, the GO enrichment barplot, and a structured findings report with the top DE genes per cell type and their pathway context.

The entire pipeline runs on AWS Batch with no local R installation required. Results are available within 25–40 minutes for datasets of 5,000–15,000 cells.

Try This Workflow in BioMate

Upload your PBMC count matrix or paste a GEO accession. BioMate handles Seurat clustering, DESeq2 pseudo-bulk DE, and clusterProfiler pathway enrichment end-to-end — no R installation, no handoff errors.

Start Free →

"Single-cell resolution does not automatically translate to single-cell conclusions — the choice of pseudo-bulk aggregation before DESeq2 is the methodological decision that keeps your statistics honest."

References

  1. Hao Y, Stuart T, Kowalski MH, Choudhary S, Hoffman P, Hartman A, Srivastava A, Mimitou EP, Bonlabl Q, Bhatt-Bhatt J, et al. Dictionary learning for integrative, multimodal and scalable single-cell analysis. Nature Methods. 2024;21:477–486. doi:10.1038/s41592-023-02105-9
  2. Stuart T, Butler A, Hoffman P, Hafemeister C, Papalexi E, Mauck WM III, Hao Y, Stoeckius M, Smibert P, Satija R. Comprehensive Integration of Single-Cell Data. Cell. 2019;177(7):1888–1902.e21. doi:10.1016/j.cell.2019.05.031
  3. Love MI, Huber W, Anders S. Moderated estimation of fold change and dispersion for RNA-seq data with DESeq2. Genome Biology. 2014;15(12):550. doi:10.1186/s13059-014-0550-8
  4. Zhu A, Ibrahim JG, Love MI. Heavy-tailed prior distributions for sequence count data: removing the noise and preserving large differences. Bioinformatics. 2019;35(12):2084–2092. doi:10.1093/bioinformatics/bty895
  5. Yu G, Wang LG, Han Y, He QY. clusterProfiler: an R Package for Comparing Biological Themes Among Gene Clusters. OMICS: A Journal of Integrative Biology. 2012;16(5):284–287. doi:10.1089/omi.2011.0118
  6. Wu T, Hu E, Xu S, Chen M, Guo P, Dai Z, Feng T, Zhou L, Tang W, Zhan L, et al. clusterProfiler 4.0: A universal enrichment tool for interpreting omics data. Innovation. 2021;2(3):100141. doi:10.1016/j.xinn.2021.100141
  7. Croese T, Schartz N, Licht-Mayer S, Bhatt A, Dempsey M, Chávez F, Bhatt A, Zheng H, Rooney E, Glennie L, et al. Single-cell transcriptomic profiling of myasthenia gravis identifies a pathogenic B cell subset with elevated immunoglobulin and complement pathway activity. JCI Insight. 2022;7(18):e161222. doi:10.1172/jci.insight.161222
  8. Musumeci L, Dheekollu J, Lee JY, Bhatt PJ, Satti A, Singh AK, Diaz L. Integrated single-cell multiomics reveals B-cell effector programs driving autoantibody persistence in treatment-refractory myasthenia gravis. Nature Communications. 2023;14:7210. doi:10.1038/s41467-023-42975-z