scFastDE

Overview

scFastDE provides fast, donor-weighted pseudo-bulk differential expression for multi-donor single-cell RNA-seq experiments.

Standard pseudo-bulk DE tools (DESeq2, edgeR, muscat) have three common problems that scFastDE addresses:

Current tools vs scFastDE — the solution

Key features

Installation

# From Bioconductor (once accepted)
BiocManager::install("scFastDE")

# Development version from GitHub
BiocManager::install("SubhadipJana1409/scFastDE")

Quick start

Unpaired design

Each donor belongs to exactly one condition (e.g. healthy vs disease).

library(scFastDE)

# Step 1: remove donors with too few cells per cell type
sce <- filterSparseDonors(sce, donor = "donor",
                           cell_type = "cell_type", min_cells = 10)

# Step 2: run DE — auto-detects unpaired, uses ~ 0 + condition
result <- fastDE(sce,
                  donor       = "donor",
                  cell_type   = "cell_type",
                  condition   = "disease",
                  target_type = "CD4_Tcell")

# Step 3: inspect
head(deTable(result))

# Step 4: visualise
plotDEResults(result)

Paired design

Same donors contribute cells under multiple conditions (e.g. ctrl + stim). scFastDE detects this automatically — no extra arguments needed.

# fastDE sees that donors appear in both conditions and switches to:
# - pseudo-bulk per donor × condition (16 samples for 8 donors × 2 conditions)
# - design: ~ 0 + condition + donor  (blocks on donor)
result <- fastDE(sce,
                  donor       = "donor",
                  cell_type   = "cell_type",
                  condition   = "stim",
                  target_type = "CD14_Monocyte")

result
# FDEResult
#   Genes tested : 10821
#   Samples      : 16         ← 8 donors × 2 conditions
#   Significant  : 5550 (adj.P.Val < 0.05)
#   Design       : paired     ← auto-detected

Key functions

Function Description
filterSparseDonors() Remove donors below minimum cell count per cell type
fastPseudobulk() Vectorised pseudo-bulk aggregation — per donor or per donor × condition
fastDE() Fast limma-voom DE with auto-detected paired/unpaired model and cell-count weights
plotDEResults() Volcano plot with FDR + logFC significance colouring

Why paired design matters

On the Kang et al. 2018 IFN-β PBMC dataset (8 donors × 2 conditions):

Approach Known IFN-β genes detected Total DE genes
Naive aggregation by donor 0 / 10 0
scFastDE paired model 10 / 10 5,550+

The difference is caused by mixing ctrl and stim cells into a single pseudo-bulk per donor — the treatment signal is washed out before the model even runs. scFastDE aggregates per donor × condition pair, preserving the within-donor contrast.

FDEResult S4 class

Results are returned as a FDEResult object with accessor methods:

deTable(result)       # DataFrame: logFC, P.Value, adj.P.Val, t, B per gene
pseudobulk(result)    # matrix: aggregated counts (genes x samples)
donorWeights(result)  # numeric: sqrt(n_cells) weight per sample

Citation

Jana S (2026). scFastDE: Fast Donor-Weighted Pseudo-Bulk Differential Expression for Single-Cell RNA-seq. R package version 0.99.0. https://github.com/SubhadipJana1409/scFastDE

License

MIT © Subhadip Jana