Current Best Practices in Single-Cell RNA-seq Analysis
An end-to-end tutorial through pre-processing and downstream analysis of scRNA-seq data
Introduction and the Challenge of Standardization
In recent years, single-cell RNA sequencing (scRNA-seq) has significantly advanced our knowledge of biological systems. It has enabled researchers to study the cellular heterogeneity of organisms such as zebrafish, frogs and planaria, and to discover previously obscured cellular populations. The great potential of this technology has motivated computational biologists to develop a range of analysis tools, but a barrier of entry for novices is the lack of standardization due to the relative immaturity of the field.
The challenges to standardization include the growing number of analysis methods (385 tools as of 7 March 2019) and exploding dataset sizes. Further challenges lie in technical aspects: analysis tools for scRNA-seq data are written in a variety of programming languages, most prominently R and Python. Although cross-environment support is growing, the choice of programming language is often also a choice between analysis tools. Popular platforms such as Seurat, Scater, and Scanpy provide integrated environments but out of necessity limit themselves to tools developed in their respective programming languages.
Considering these challenges, instead of targeting a standardized analysis pipeline, the authors outline current best practices and common tools independent of programming language. The tutorial guides the reader through the various steps of a scRNA-seq analysis pipeline, presents current best practices, and discusses analysis pitfalls and open questions. Where best practices cannot be determined due to novelty of the tools and lack of comparisons, popular available tools are listed. The outlined steps start from read or count matrices and lead to potential analysis endpoints. A documented case study integrating these best practices is available on the authors' GitHub, implemented in a Jupyter/IPython notebook that integrates R and Python tools via rpy2.
- As of 7 March 2019 there were 385 scRNA-seq analysis tools, complicating standardization.
- The paper outlines language-independent best practices rather than a single standardized pipeline.
- A reproducible case study is provided at github.com/theislab/single-cell-tutorial using rpy2 to combine R and Python tools.
- Analysis begins from read or count matrices; earlier read-processing steps are covered elsewhere (Lun et al, 2016b).
The Experimental Workflow and Raw Data Processing
Generating single-cell data from a biological sample requires multiple steps: single-cell dissociation (digesting the tissue to a single-cell suspension), single-cell isolation, library construction, and sequencing. Isolation is performed differently depending on protocol: plate-based techniques isolate cells into wells, while droplet-based methods capture each cell in its own microfluidic droplet. In both cases, errors can occur that lead to multiple cells being captured together (doublets or multiplets), non-viable cells being captured, or no cell being captured at all (empty droplets/wells). Empty droplets are especially common because droplet-based methods rely on a low concentration flow of input cells to control doublet rates.
During library construction, intracellular mRNA is captured, reverse-transcribed to cDNA, and amplified. Because cells undergo this process in isolation, the mRNA from each cell can be labelled with a well- or droplet-specific cellular barcode. Many protocols also label captured molecules with a unique molecular identifier (UMI), which allows distinguishing between amplified copies of the same mRNA molecule and reads from separate molecules transcribed from the same gene. Libraries are pooled (multiplexed) for sequencing, producing read data that undergo quality control, demultiplexing (grouping by barcode), and alignment.
Raw data generated by sequencing machines are processed to obtain matrices of molecular counts (count matrices) or read counts (read matrices), depending on whether UMIs were incorporated. Raw data processing pipelines such as Cell Ranger, indrops, SEQC, or zUMIs take care of read quality control, assigning reads to cellular barcodes and mRNA molecules of origin (demultiplexing), genome alignment, and quantification. The resulting matrices have dimension number of barcodes x number of transcripts. The term 'barcode' is used instead of 'cell' because all reads assigned to the same barcode may not correspond to reads from the same cell: a barcode may mistakenly tag multiple cells (doublet) or may not tag any cell (empty droplet/well). While read and count data differ in the level of measurement noise, the processing steps in a typical pipeline are the same, so the data are referred to as count matrices throughout.
- Typical experimental stages: single-cell dissociation, isolation, library construction, and sequencing.
- UMIs allow distinguishing PCR-amplified duplicates from distinct mRNA molecules of the same gene.
- A cellular barcode labels each well/droplet; 'barcode' is used rather than 'cell' because doublets and empty droplets exist.
- Read-processing pipelines (Cell Ranger, indrops, SEQC, zUMIs) handle demultiplexing, alignment, and quantification to produce a barcodes x transcripts matrix.
Quality Control
Before analysing the gene expression data, we must ensure that all cellular barcode data correspond to viable cells. Cell QC is commonly performed based on three QC covariates: the number of counts per barcode (count depth), the number of genes per barcode, and the fraction of counts from mitochondrial genes per barcode. The distributions of these covariates are examined for outlier peaks that are filtered out by thresholding. Outlier barcodes can correspond to dying cells, cells with broken membranes, or doublets. For example, barcodes with a low count depth, few detected genes, and a high fraction of mitochondrial counts are indicative of cells whose cytoplasmic mRNA has leaked out through a broken membrane, leaving mainly mitochondrial mRNA. Cells with unexpectedly high counts and many detected genes may represent doublets, so high-count thresholds are used to filter potential doublets. Three doublet detection tools offer more elegant solutions: DoubletDecon, Scrublet, and DoubletFinder.
Considering any single QC covariate in isolation can lead to misinterpretation of cellular signals. Cells with a high fraction of mitochondrial counts may be involved in respiratory processes; cells with low counts and/or genes may correspond to quiescent cell populations; and cells with high counts may simply be larger. Thus, QC covariates should be considered jointly when univariate thresholding decisions are made, and thresholds should be set as permissively as possible to avoid unintentionally filtering out viable cell populations. Datasets with heterogeneous cell-type mixtures may exhibit multiple QC covariate peaks. For high-count filtering, the proportion of cells removed should not exceed the expected doublet rate.
QC must also be performed at the level of transcripts. Raw count matrices often include over 20,000 genes, and this number can be reduced by filtering out genes not expressed in more than a few cells. A guideline is to use the minimum cell cluster size of interest while leaving leeway for dropout; for example, filtering out genes expressed in fewer than 20 cells may make it difficult to detect clusters with fewer than 20 cells. Further QC can be performed on the count data directly to address ambient gene expression: counts that do not originate from a barcoded cell but from other lysed cells whose mRNA contaminated the suspension. In droplet-based data, tools such as SoupX can model and correct ambient RNA using the many empty droplets available.
Because 'sufficient data quality' cannot be determined a priori, QC is judged based on downstream analysis performance (e.g., cluster annotation), and it may be necessary to revisit QC decisions multiple times. It is often beneficial to start with permissive thresholds and investigate their effects before performing more stringent QC. In this iterative optimization one should be aware of data peeking: QC thresholds should not be adapted to improve the outcome of a statistical test, but evaluated from the distribution of QC covariates in visualizations and clustering.
- Three core QC covariates: count depth, number of genes per barcode, and fraction of mitochondrial counts.
- Consider QC covariates jointly, not separately, and be as permissive as possible to preserve viable populations.
- Doublet detection tools include DoubletDecon, Scrublet, and DoubletFinder; ambient RNA can be corrected with SoupX.
- If QC covariate distributions differ between samples, set thresholds separately per sample.
- QC is iterative and judged by downstream performance; avoid data peeking.
Normalization
Each count represents the successful capture, reverse transcription and sequencing of a molecule of cellular mRNA. Count depths for identical cells can differ due to variability in each step, so any observed difference in gene expression may arise solely from sampling effects. Normalization addresses this by scaling count data to obtain correct relative gene expression abundances between cells. The most commonly used protocol is count depth scaling, also called counts per million (CPM) normalization, which uses a size factor proportional to the count depth per cell. CPM assumes all cells initially contained an equal number of mRNA molecules. A related protocol is downsampling, which randomly samples counts to leave all cells at a specified count depth or fewer; while it discards data, it can give a more realistic representation of expression profiles at similar count depths.
Because single-cell datasets consist of heterogeneous populations, more complex normalization is usually appropriate. Scran's pooling-based size factor estimation permits more cellular heterogeneity: size factors are estimated via linear regression over genes after cells are pooled to avoid technical dropout effects. This method assumes fewer than 50% of genes are differentially expressed between cells, and is consistently a top-performing normalization method in independent comparisons, performing well for batch correction and differential expression. CPM, high-count-filtering CPM, and scran all use linear global scaling. Non-linear normalization methods, which can account for more complex unwanted variation (often via parametric modelling of count data), also exist and have been shown to outperform global scaling especially with strong batch effects. This makes them particularly relevant for plate-based data, which tend to have batch effects between plates and larger count-depth variation.
No single normalization method is appropriate for all data types; the scone tool can help select an appropriate method for a specific dataset. scRNA-seq techniques divide into full-length and 3' enrichment methods; full-length data may benefit from methods that account for gene length (e.g., TPM normalization from bulk RNA-seq), while 3' enrichment data do not. Gene counts can also be scaled to zero mean and unit variance (z-scores) so all genes are weighted equally, but there is no consensus on whether to normalize over genes; the authors prefer not to scale over genes to retain biological information. After normalization, data matrices are typically log(x+1)-transformed. This has three effects: distances between log-transformed values represent log fold changes; it mitigates the mean-variance relationship; and it reduces skewness to approximate the normality assumption of many downstream tools. However, log transformation of normalized data can introduce spurious differential expression effects, particularly when size factor distributions differ strongly between tested groups.
- CPM/count-depth scaling assumes equal initial mRNA content per cell; downsampling is a related approach that discards data.
- Scran's pooling-based size factors handle heterogeneity and are a consistent top performer in comparisons (recommended for non-full-length data).
- Non-linear normalization helps with strong batch effects, especially for plate-based data; scone can select a method per dataset.
- Full-length protocols may need gene-length-aware normalization (e.g., TPM); 3' enrichment data do not.
- log(x+1) transformation yields log fold changes, mitigates the mean-variance relationship, and reduces skewness.
Data Correction: Biological and Technical Covariates
Normalized data may still contain unwanted variability. Data correction targets further technical and biological covariates such as batch, dropout, or cell cycle effects. Which covariates to correct depends on the intended downstream analysis, and the authors propose considering biological and technical corrections separately because they serve different purposes. Correcting for biological covariates singles out particular biological signals of interest; the most common example is removing cell cycle effects on the transcriptome, done by linear regression against a cell cycle score (as implemented in Scanpy and Seurat) or by specialized mixture models such as scLVM or f-scLVM. Marker gene lists for cell cycle scoring come from the literature. These regression methods can also remove other known biological effects such as mitochondrial gene expression (interpreted as cell stress).
Several caveats apply to biological correction. Removing cell cycle effects can improve inference of developmental trajectories, but cell cycle signals can also be biologically informative (e.g., identifying proliferating populations). Because biological processes are interdependent, correcting for one process may unintentionally mask another. It has also been argued that variation in cell size accounts for the transcriptomic effect generally attributed to the cell cycle, so correcting for cell size via normalization, or via tools such as cgCorrect, also partially corrects for cell cycle effects.
The same regression models can be applied to technical covariates, the most prominent of which are count depth and batch. A count depth effect often remains after normalization; regressing it out can improve trajectory inference algorithms that rely on finding transitions between cells. When correcting for multiple covariates (e.g., cell cycle and count depth), the regression should be performed over all covariates in a single step to account for dependence between them. An alternative to regression is a more rigorous normalization such as downsampling or non-linear methods, which is particularly relevant for plate-based datasets.
- Consider technical and biological corrections separately; they serve different purposes.
- Cell cycle effects are commonly regressed out via a cell cycle score (Scanpy/Seurat) or mixture models (scLVM/f-scLVM).
- Regress out biological covariates mainly for trajectory inference, and only if other signals of interest are not masked.
- Regress out multiple (technical + biological) covariates jointly in a single step, not serially.
- Cell-size variation may underlie much of the apparent cell cycle effect (cgCorrect).
Batch Effects and Data Integration
Batch effects can occur when cells are handled in distinct groups, such as cells on different chips, in different sequencing lanes, or harvested at different time points. The authors distinguish two scenarios: batch correction, the classical setting of correcting effects between samples or cells in the same experiment, and data integration, the integration of data from multiple experiments. Batch effects are typically corrected using linear methods, while non-linear approaches are used for data integration. A comparison of classical batch correction methods found that ComBat, a linear model that accounts for the batch contribution in both the mean and variance, performs well for single-cell experiments of low-to-medium complexity. Regardless of method, the best correction is to pre-empt the effect through clever experimental design, for example by pooling cells across conditions using cell tagging or genetic variation and then demultiplexing.
Data integration methods face the additional challenge of compositional differences between datasets: because ComBat uses all cells in a batch to fit batch parameters, it will confound the batch effect with biological differences not shared among datasets. Methods developed to overcome this include Canonical Correlation Analysis (CCA), Mutual Nearest Neighbours (MNN), Scanorama, RISC, scGen, LIGER, BBKNN, and Harmony. While data integration methods can also be applied to simple batch correction problems, users should be wary of over-correction given the increased degrees of freedom of non-linear approaches; MNN, for example, was shown to be outperformed by ComBat in the simpler batch correction setting.
A further type of technical data correction is expression recovery (also called denoising or imputation). Single-cell measurements contain various sources of noise, a particularly prominent aspect being dropout. Tools that infer dropout events and replace zeros with appropriate values include MAGIC, DCA, scVI, SAVER, and scImpute. Expression recovery has been shown to improve estimation of gene-gene correlations and can be integrated with normalization and batch correction (as in scVI). However, no method is perfect: any method may over- or under-correct noise, and false correlation signals have been reported as a result of imputation. Scalability to large datasets remains an issue, and there is no consensus on how denoised data should be used. A prudent approach is to use expression recovery only for visual display rather than for hypothesis generation, and thorough experimental validation is important.
- Distinguish batch correction (within one experiment, linear methods like ComBat) from data integration (across experiments, non-linear methods).
- ComBat performs well for low-to-medium complexity single-cell batch correction and models both mean and variance.
- Data integration tools (CCA, MNN, Scanorama, RISC, scGen, LIGER, BBKNN, Harmony) may over-correct simple batch effects.
- The best batch correction is good experimental design (pooling with cell tagging or genetic-variation demultiplexing).
- Expression recovery (MAGIC, DCA, scVI, SAVER, scImpute) can introduce false signals; prefer it for visualization, not hypothesis generation.
Feature Selection and Highly Variable Genes
A human scRNA-seq dataset can contain expression values for up to 25,000 genes, and even after filtering zero-count genes the feature space can exceed 15,000 dimensions. To ease the computational burden on downstream tools, reduce noise, and enable visualization, one can reduce dimensionality, and the first step is commonly feature selection: filtering the dataset to keep only genes that are informative of the variability in the data. Highly variable genes (HVGs) are often used for this purpose. Depending on the task and dataset complexity, typically between 1,000 and 5,000 HVGs are selected. Preliminary results suggest downstream analysis is robust to the exact number of HVGs (similar low-dimensional PCA representations were obtained across 200 to 2,400 HVGs), so the authors prefer to err on the side of higher numbers.
A simple and popular HVG method, implemented in both Scanpy and Seurat, bins genes by their mean expression and selects the genes with the highest variance-to-mean ratio within each bin. Different flavours of this algorithm expect either count data (Seurat) or log-transformed data (Cell Ranger). Optimally, HVGs should be selected after technical data correction to avoid selecting genes that are highly variable only due to, for example, batch effects. Other HVG selection methods are reviewed in Yip et al (2018).
- Select roughly 1,000 to 5,000 HVGs depending on dataset complexity; downstream results are fairly robust to the exact number.
- The common HVG method bins genes by mean expression and picks the highest variance-to-mean ratio per bin (Scanpy/Seurat).
- Select HVGs after technical correction to avoid picking batch-driven variability.
- Mean/variance-based selection is invalid when expression has been scaled to zero mean/unit variance or replaced by model residuals.
Dimensionality Reduction and Visualization
After feature selection, dedicated dimensionality reduction algorithms embed the expression matrix into a low-dimensional space that captures the underlying structure in as few dimensions as possible. This works because scRNA-seq data are inherently low-dimensional: the biological manifold on which expression profiles lie can be described by far fewer dimensions than the number of genes. There are two main objectives: visualization (optimally describing the dataset in two or three dimensions for a scatter plot) and summarization (reducing data to its essential components without prescribing the number of output components). A 2-D visualization output should not be used to summarize a dataset, but a summarization method can be used for visualization via its leading components.
Two popular summarization methods are principal component analysis (PCA) and diffusion maps. PCA is a linear approach that maximizes captured residual variance in each successive dimension and is the basis of many clustering and trajectory inference tools; it is commonly used as a pre-processing step for non-linear methods. The number of top principal components N can be chosen by 'elbow' heuristics or the permutation-test-based jackstraw method. Because PCA is linear, distances in reduced space have consistent interpretation everywhere, allowing components to be correlated with quantities of interest (e.g., projecting PCs onto technical covariates to assess QC). Diffusion maps are a non-linear summarization technique that emphasize transitions, so they are principally used when continuous processes such as differentiation are of interest, with each diffusion component highlighting the heterogeneity of a different cell population.
For visualization it is standard practice to use non-linear dimensionality reduction. The most common method is t-distributed stochastic neighbour embedding (t-SNE), which focuses on local similarity at the expense of global structure and can exaggerate differences between populations; its perplexity parameter strongly affects the apparent number of clusters. Common alternatives are the Uniform Manifold Approximation and Projection method (UMAP) and graph-based tools such as SPRING with its ForceAtlas2 force-directed layout, which arguably best approximate the underlying topology. UMAP stands out for its speed and ability to scale to large numbers of cells, so in the absence of particular biological questions the authors regard UMAP as best practice for exploratory visualization. An alternative to cell-level visualization is partition-based graph abstraction (PAGA), which coarse-grains the visualization using clusters and, combined with other methods, simplifies interpretation of large datasets.
- scRNA-seq data are inherently low-dimensional, lying on a biological manifold.
- Distinguish summarization methods (PCA, diffusion maps) from visualization methods (t-SNE, UMAP, ForceAtlas2).
- PCA is linear and interpretable; choose the number of PCs via an elbow heuristic or the jackstraw permutation test.
- UMAP is recommended for exploratory visualization due to speed and scalability; diffusion maps suit trajectory summarization.
- PAGA with UMAP is recommended for visualizing particularly complex datasets.
Stages of Pre-processed Data
Downstream analyses often prefer different levels of pre-processed data, so pre-processing should be adapted to the downstream application. The authors delineate five stages of data processing: (i) raw data, (ii) normalized data, (iii) corrected data, (iv) feature-selected data, and (v) dimensionality-reduced data. These are grouped into three pre-processing layers: measured data, corrected data, and reduced data. Cell and gene QC should always be performed and is omitted from this characterization. The order of layers represents the typical workflow, but it is possible to skip layers or slightly alter the order; for example, data correction may not be necessary for single-batch datasets.
Measured data comprises raw and processed data that retain the structure of zeros: global scaling normalization retains zero expression values even after log(x+1)-transformation, whereas correcting for unwanted variability replaces zeros. The corrected data layer is the 'cleanest' version, the closest approximation of the underlying biological signal. Reduced data emphasizes dominant aspects of the data using a reduced set of features. These characteristics determine suitability for downstream applications: reduced data are used for exploratory methods that require data summaries (visualization, neighbourhood graph inference, clustering) and for computationally complex tools (trajectory inference).
Gene expression profiles can only be compared in gene space, captured in measured and corrected data. The authors argue visual and statistical comparison should be performed on different layers. For visual inspection, corrected data are most appropriate (they facilitate interpretation), but technical and biological correction should be considered separately. Statistical comparison of gene expression is most appropriate on the measured data layer: because no perfect data correction method exists, correction inevitably over- or under-corrects and alters variance, and since correction tends to reduce background variation, over-corrected genes are more likely assessed as significantly differentially expressed. Certain methods like ComBat interpret signals not conforming to the experimental design as noise, which can lead to underestimation of noise and overestimation of effect size. Using measured data (with technical covariates in the model) is therefore a more conservative approach to differential testing.
- Five stages: raw, normalized, corrected, feature-selected, dimensionality-reduced; grouped into measured, corrected, and reduced layers.
- Measured data retain zeros; correction replaces zeros and produces the 'cleanest' approximation of biology.
- Use measured data for statistical testing, corrected data for visual comparison, and reduced data for manifold-based analysis.
- Data correction reduces background variance and can inflate differential-expression significance, so it is unsuitable for statistical testing.
Clustering
After pre-processing, downstream analysis extracts biological insights by fitting interpretable models. Cell-level analysis focuses on two structures: clusters and trajectories. Broadly, cluster analysis explains heterogeneity by categorizing cells into groups, whereas trajectory analysis regards the data as a snapshot of a dynamic process. Organizing cells into clusters is typically the first intermediate result and allows inference of the identity of member cells. Clusters are obtained by grouping cells based on similarity of gene expression profiles, determined via distance metrics that often take dimensionality-reduced representations as input (e.g., Euclidean distances on PC-reduced expression space).
Two approaches generate clusters from similarity scores: clustering algorithms and community detection methods. Clustering is a classical unsupervised problem based on a distance matrix; the popular k-means algorithm divides cells into k clusters by iteratively optimizing cluster centroids, but requires the number of clusters as input. Alternatives to Euclidean distance include cosine similarity, correlation-based distances, or the SIMLR method which learns a distance metric per dataset. Community detection methods are graph-partitioning algorithms that rely on a K-Nearest Neighbour (KNN) graph representation, where cells are nodes connected to their K most similar cells (K commonly between 5 and 100). Densely sampled regions of expression space become densely connected regions of the graph, which are detected as communities. Community detection is often faster than clustering because only neighbouring cell pairs are considered.
Following the pioneering PhenoGraph method, the standard approach has become multi-resolution modularity optimization as implemented in the Louvain algorithm on single-cell KNN graphs. This is the default clustering method in both Scanpy and Seurat and has been shown to outperform other methods for single-cell RNA-seq, flow, and mass cytometry data. The Louvain algorithm detects communities as groups of cells with more links between them than expected, and its modularity function includes a resolution parameter that controls the scale of the partition. By subsetting the KNN graph, one can subcluster particular clusters to identify cell states within cell-type clusters, though this may also produce patterns arising only from noise.
- Clustering groups cells by expression similarity, usually via Euclidean distance on PC-reduced space.
- Community detection on a KNN graph (K typically 5 to 100) is faster than distance-matrix clustering like k-means.
- Louvain community detection on a single-cell KNN graph is the recommended default (Scanpy and Seurat).
- A resolution parameter tunes cluster granularity; subclustering is a valid way to resolve finer substructure.
- Clustering need not be done at a single resolution.
Cluster Annotation and Marker Genes
On a gene level, clustered data are analysed by finding the marker genes that characterize each cluster and are used to annotate it with a meaningful biological label representing cell identity. Because any clustering algorithm produces a partition, the validity of identified clusters can only be determined by successful annotation of the represented biology. It is tempting to equate clusters with cell types, but there are several axes of variation determining cellular identity, and it is not always clear what constitutes a cell type (for example, 'T cells' versus CD4+ and CD8+ subtypes). Cells of the same type in different states may fall in separate clusters, so it is best to use the term 'cell identities' rather than 'cell types'. The user must decide which level of annotation detail, and thus which cluster resolution, is of interest.
Annotation relies on external information about expected expression profiles. Reference databases such as the mouse brain atlas and the Human Cell Atlas are increasingly available and greatly facilitate annotation. In their absence, cell identities can be annotated by comparing data-derived marker genes with literature markers, or by directly visualizing literature-derived marker expression (though the latter constrains the user to classical bulk-derived cell types). Marker gene sets are found by differential expression testing between cells in one cluster and all other cells, typically focusing on up-regulated genes ranked by simple tests such as the Wilcoxon rank-sum test or the t-test. Reference database information can be used via data-derived marker genes or full gene expression profiles, and clusters can be annotated by comparing marker gene sets via enrichment tests, the Jaccard index, or other overlap statistics.
Two aspects should be noted. First, the P-values obtained for marker genes assume the clusters represent the biological ground truth; because both clusters and marker genes are determined from the same data, the P-values are typically inflated (significant marker genes are even found when clustering random data generated by splatter). A permutation test can account for the clustering step. Importantly, although P-values are inflated, the ranking of genes is unaffected, so the top-ranked genes are still the best candidates. Second, marker genes differentiate a cluster from others and thus depend on the dataset composition, so they may differ between datasets for the same cell identity. Automated cluster annotation tools such as scmap or Garnett can transfer annotations from reference to dataset, performing annotation and cluster assignment simultaneously. For large datasets the current best practice combines automated coarse labelling with data-derived marker-gene-based manual annotation; for smaller datasets lacking reference atlases, manual annotation suffices.
- Marker genes are found by DE testing one cluster against all other cells, ranked by tests such as Wilcoxon rank-sum or t-test.
- Use 'cell identities' rather than 'cell types'; validity of clusters is confirmed by successful annotation.
- Marker gene P-values are inflated because clusters and markers come from the same data, but gene ranking remains valid.
- Marker genes depend on dataset composition and can differ between datasets for the same identity.
- Recommended: combine automated annotation (scmap, Garnett) with manual marker-gene annotation when reference atlases exist.
Compositional Analysis
At the cell level, clustered data can be analysed in terms of compositional structure: the proportions of cells falling into each cell-identity cluster. These proportions can change in response to disease; for example, salmonella infection has been shown to increase the proportion of enterocytes in the mouse intestinal epithelium. Investigating compositional changes requires sufficient cell numbers to robustly assess cluster proportions and sufficient sample numbers to evaluate expected background variation.
Because appropriate datasets have only recently become available, dedicated tools are yet to be developed. In one mouse study, cell-identity counts were modelled using a Poisson process including the condition as a covariate and the total number of cells as an offset, with a statistical test over the regression coefficient assessing whether a cell identity changed significantly in frequency. However, tests over different cell identities in the same dataset are not independent: if the proportion of one cluster changes, the proportions of all others must also change. In the absence of dedicated tools, visual comparison of compositional data can be informative, and future developments will likely borrow from the mass cytometry or microbiome literature, where compositional data analysis has received more attention.
- Compositional analysis studies the proportions of cells in each cell-identity cluster and how they change (e.g., with disease).
- Requires enough cells and enough samples to assess proportions and background variation.
- Tests over changes in different cluster proportions are statistically dependent on one another.
- Dedicated tools are still lacking; approaches borrow from mass cytometry and microbiome compositional analysis.
Trajectory Inference and Pseudotime
Cellular diversity cannot be fully described by discrete clustering because the biological processes driving heterogeneity are continuous. To capture transitions between cell identities, branching differentiation, or gradual unsynchronized changes in function, dynamic models of gene expression are required, a class of methods known as trajectory inference (TI). TI methods interpret single-cell data as a snapshot of a continuous process, reconstructing it by finding paths through cellular space that minimize transcriptional changes between neighbouring cells. The ordering of cells along these paths is described by a pseudotime variable, related to transcriptional distance from a root cell and often interpreted as a proxy for developmental time.
Since Monocle and Wanderlust established the field, the number of TI methods has exploded, differing in the complexity of paths modelled (linear, bifurcating, complex graphs, trees, or multifurcating). A comprehensive comparison concluded that no individual method performs optimally for all trajectory types, so methods should be selected based on the expected complexity: Slingshot outperformed others for simple linear to multifurcating trajectories, while PAGA was recommended for more complex trajectories. Any inferred trajectory should be confirmed with an alternative method to avoid method bias. TI methods are applied to reduced or corrected data, and because several top methods rely on clustered data, TI is typically performed after clustering. Clusters in inferred trajectories may represent stable or metastable states, and RNA velocities can be overlaid to add directionality.
Inferred trajectories do not have to represent biological processes; in the first instance they only denote transcriptional similarity, and few TI methods evaluate uncertainty in their model. Further validation is needed, which can come from perturbation experiments, inferred regulatory gene dynamics, and support from RNA velocity.
- Trajectory inference treats data as a snapshot of a continuous process; pseudotime orders cells by transcriptional distance from a root.
- No single TI method is best for all trajectory types; use the Saelens et al (2018) comparison as a guide.
- Slingshot is recommended for simple to multifurcating trajectories; PAGA for complex ones.
- TI is typically run after clustering; RNA velocity can add directionality.
- Inferred trajectories need not be biological; confirm with an alternative method and additional evidence.
Gene Expression Dynamics and Metastable States
One way to support that an inferred trajectory is not merely fitted noise is to analyse it at the gene level. Genes that vary smoothly across pseudotime characterize the trajectory and are expected to include genes regulating the modelled process, which help us understand how and why biological processes are triggered and represent potential drug targets. While early approaches used DE testing between clusters along a trajectory, genes that vary across a trajectory are now detected by regressing gene expression against pseudotime, with expression smoothed via a spline or local regression (e.g., loess). Potential regulatory genes are obtained by model selection for dependence on pseudotime. This DE test over pseudotime is confounded by the TI method in the same way DE between clusters is confounded by the clustering method, so the P-values should not be regarded as an evaluation of significance.
Few dedicated gene temporal dynamics tools exist. BEAM, integrated into the Monocle pipeline, allows detection of branch-specific gene dynamics; outside it, users can opt for LineagePulse (which considers dropout but is still in development) or write their own framework using the limma package or standard R libraries. A best practice cannot yet be determined; in future, Gaussian processes may provide a natural model, and testing for regulatory modules rather than individual genes would likely improve the signal-to-noise ratio.
Cell-level trajectory analysis investigates cellular densities across pseudotime. Assuming unbiased sampling, dense regions along a trajectory indicate preferred transcriptomic states; interpreting the trajectory as a temporal process, these dense regions may represent metastable states, for example in development. Metastable states can be found by plotting histograms of the pseudotime coordinate. Clustering and trajectory inference represent two distinct views that can be reconciled in coarse-grained graph representations: PAGA represents clusters as nodes and trajectories as edges, placing an edge between clusters whose cells are more similar than expected. PAGA was favourably compared to other TI methods and was the only reviewed method able to cope with disconnected topologies and complex graphs containing cycles.
- Trajectory-associated genes are found by regressing expression against pseudotime (smoothed via spline/loess), but their P-values are confounded by the TI method.
- Few gene-dynamics tools exist: BEAM (in Monocle), LineagePulse, or custom frameworks using limma.
- Metastable states appear as dense regions (peaks) in the histogram of pseudotime coordinates.
- PAGA unifies clustering and trajectory inference via a coarse-grained graph and handles disconnected/cyclic topologies.
Differential Expression Testing
A common question is whether any genes are differentially expressed between two experimental conditions. DE testing originates from bulk expression analysis, but in the single-cell setting we can account for cellular heterogeneity by performing tests within cell-identity clusters, revealing how individual cell identities react transcriptionally under particular conditions. Bulk and single-cell DE tools differ methodologically: bulk methods were developed to estimate gene variance from few samples, while single-cell data instead contain unique technical noise such as dropout and high cell-to-cell variability, taken into account by dedicated single-cell methods. A large-scale comparison suggested bulk DE packages perform comparably to the best single-cell tools, and when bulk tools are adapted with gene weights they may outperform single-cell counterparts: the top performers were DESeq2 and edgeR combined with weights estimated by ZINB-wave.
Improved performance of weighted bulk DE testing comes at a cost in computational efficiency, which matters given increasing cell numbers. The single-cell tool MAST is a potent alternative: it uses a hurdle model to account for dropout while modelling expression changes dependent on condition and technical covariates, and was the best-performing single-cell method in one study. MAST has a 10- to 100-fold faster runtime than weighted bulk methods, and a further 10-fold speedup can be achieved using limma-voom, which was shown to achieve comparable performance to MAST.
Because uncorrected measured data should be used for DE testing, accounting for confounding factors is crucial. Users must be vigilant about which variables are added to the model: in most set-ups the sample and condition covariates are confounded (it is rarely possible to obtain a single sample under multiple conditions), so when testing over condition one cannot include the sample covariate in the given form. It is helpful to test whether the model design matrix is full rank, because DE tools will often adapt a non-full-rank matrix and run without a warning, not delivering the intended results. When the condition covariate is set experimentally, a DE test over it (within the same cluster) is independent of the clustering procedure, so the resulting P-values represent expected measures of significance and must be corrected for multiple testing; transcripts not of interest can be excluded to reduce the testing burden.
- Perform DE tests within cell-identity clusters to capture how each identity responds to conditions.
- Recommended tools: MAST or limma; weighted bulk tools (DESeq2/edgeR with ZINB-wave weights) also perform well.
- DE testing should use measured data with technical covariates in the model, not corrected data.
- Ensure a full-rank design matrix and beware confounding of sample and condition covariates.
- DE over experimentally set conditions yields valid P-values (correct for multiple testing), unlike DE over clusters.
Gene Set Analysis and Gene Regulatory Networks
Gene-level analysis methods often produce long lists of candidate genes that are difficult to interpret. Interpretation is facilitated by grouping genes into sets based on shared characteristics and testing whether these characteristics are overrepresented in the candidate list. Gene set information is found in curated databases: biological process labels are stored in MSigDB, the Gene Ontology (GO), and pathway databases such as KEGG and Reactome. Enrichment of annotations can be tested using a vast array of tools reviewed and compared in the literature. A recent development is the use of paired gene labels for ligand-receptor analysis, where interaction between cell clusters is inferred from expression of receptors and their cognate ligands; ligand-receptor pair labels can be obtained from CellPhoneDB.
Genes do not function independently: the expression level of a gene is determined by a complex interplay of regulatory interactions with other genes and small molecules. Uncovering these interactions is the goal of gene regulatory network (GRN) inference, performed based on measurements of gene co-expression such as correlation, mutual information, or regression models. If two genes show a co-expression signal even when all other genes are taken into account as potential confounders, they are said to have a causal regulatory relationship. GRN inference is related to detecting trajectory-associated regulatory genes, and several single-cell GRN methods use trajectories with mechanistic differential equation models.
While GRN inference methods developed specifically for scRNA-seq exist (SCODE, PIDC, SCENIC), a recent comparison showed both bulk and single-cell methods perform poorly on these data. GRN methods may still offer valuable insights to identify causal regulators, but the authors recommend using them with care: users should be wary of uncertainty in inferred relationships, and modules of genes enriched for regulatory relationships will be more reliable than individual edges.
- Group candidate genes into sets and test overrepresentation using databases such as GO, KEGG, Reactome, and MSigDB.
- Ligand-receptor analysis (e.g., CellPhoneDB) infers interactions between cell clusters from receptor/ligand expression.
- GRN inference uses co-expression (correlation, mutual information, regression); tools include SCODE, PIDC, and SCENIC.
- GRN methods perform poorly in comparisons; trust enriched modules over individual regulatory edges and use with care.
Analysis Platforms and Outlook
Single-cell analysis workflows are collations of independently developed tools, so single-cell platforms have been developed around consistent data formats to facilitate moving data between tools. Command-line platforms exist in R and Python, alongside local applications and Web servers with graphical user interfaces (GUIs). Among command-line platforms, Scater and Seurat easily interface with the large variety of tools available via the R Bioconductor project. Scater has particular strength in QC and pre-processing, while Seurat is arguably the most popular and comprehensive platform, with a large array of tools and tutorials. A recent addition is Scanpy, a growing Python-based platform that exhibits improved scaling to larger numbers of cells and leverages the many tools written in Python, which is popular for machine learning.
Graphical user interface platforms enable non-expert users to build workflows through prescribed steps that facilitate analysis but limit flexibility, making them especially useful for exploratory analysis. Web-based platforms such as Granatum and ASAP are readily available but limited by computational infrastructure in scaling to large datasets (ASAP was tested on only 92 cells). Alternatives that run on a local server and scale with local computational power include FASTGenomics, iSEE, IS-CellR, and locally-run Granatum. Ongoing development of Human Cell Atlas portals will lead to more powerful visual data exploration tools that scale to large cell numbers.
Two avenues of development are of particular interest for their disruptive potential: deep learning workflows and single-cell omic integration. Deep learning has begun to impact genomics, with first scRNA-seq applications from dimensionality reduction to denoising (scVis, scGen, DCA); scVI even produces an embedded workflow that can fit the data, denoise it, and perform downstream analysis such as clustering and differential expression within one model, allowing noise and batch effect estimates to be included in statistical tests. As single-cell omic technologies improve, the need for integrated omic pipelines will grow to handle data such as DNA methylation, chromatin accessibility, or protein abundance. Platforms are already adapting to multi-modal structures for RNA velocity (from unspliced and spliced read data), and multi-omic integration can occur via consensus clustering, multi-omic factor analysis, or multi-omic GRN inference. The authors envisage such multi-omic workflows building upon the foundation laid for scRNA-seq.
- Command-line platforms: Scater (strong QC), Seurat (most comprehensive), and Scanpy (Python, scales to large datasets); Scater and Seurat interface with Bioconductor.
- GUI/Web platforms (Granatum, ASAP) ease exploration but scale poorly; local-server tools (FASTGenomics, iSEE, IS-CellR) scale better.
- Deep learning (scVI, scGen, DCA, scVis) can integrate denoising, batch correction, and downstream analysis in one model.
- Future direction: single-cell multi-omic integration (methylation, chromatin, protein, RNA velocity) via consensus clustering, MOFA, or multi-omic GRNs.
Figures
7 figures extracted from the source PDF — click any to enlarge.
⤢
⤢
⤢
⤢
⤢
⤢
⤢Test yourself
11 questions on this chapter.