Overview
Nebulosa is an R package that visualizes single-cell data using kernel density estimation (KDE). Standard scatter plots of gene expression can be misleading in single-cell data due to dropout — genes that are expressed but recorded as zero. Nebulosa recovers this signal by incorporating cell-to-cell similarity in its density estimates, producing smooth, interpretable expression maps. Key advantages over rawFeaturePlot():
- Recovers signal from dropped-out features by pooling information from similar cells
- Removes spurious “random” expression in areas not supported by many cells
- Enables joint density visualization to identify co-expressing cell populations
Citation: Jose Alquicira-Hernandez and Joseph E. Powell. Nebulosa recovers single cell gene expression signals by kernel density estimation. doi: 10.18129/B9.bioc.NebulosaSource: powellgenomicslab/Nebulosa
Installation
Key function
plot_density() is the main function from the Nebulosa package. Its interface resembles Seurat’s FeaturePlot(), making it easy to drop into existing Seurat workflows.
Complete workflow
1
Load libraries
2
Load and preprocess data
This example uses a 3k PBMC dataset from 10x Genomics:
3
Filter low-quality cells
4
Normalize and reduce dimensions
Nebulosa works on any 2D embedding. Here, use SCTransform followed by PCA and UMAP:
5
Cluster
6
Visualize with Nebulosa
Plot the kernel density estimate for a single gene:Compare with Seurat’s standard feature plot:Nebulosa removes the “random” scattered expression of CD4 in areas where it is not biologically supported, while still highlighting CD4+ T cells and myeloid cells.
Multi-feature visualization
Nebulosa supports plotting multiple features simultaneously and computing joint densities to identify co-expressing populations.Individual densities for multiple genes
Joint density
Usejoint = TRUE to multiply the per-gene densities into a single joint density plot. This highlights cells that co-express all queried genes:
Accessing individual plots
Setcombine = FALSE to get a list of ggplot objects. The last element is always the joint density:
Identifying cell populations with joint density
When to use Nebulosa
Nebulosa is most valuable for:- Dropped-out genes — genes with high dropout rates where raw expression plots are sparse and hard to interpret
- Co-expression analysis — identifying populations that express multiple markers simultaneously
- Communication in presentations — smoother density maps are often clearer for figures and talks
FeaturePlot() may be equally informative. Use Nebulosa alongside core Seurat visualization methods to draw more informed conclusions.