Overview
SCEVAN implements a variational segmentation algorithm combined with a hierarchical hidden Markov model to infer copy number alterations from single-cell RNA sequencing data. This document provides a comprehensive description of the methodology.
Algorithmic Framework
1. Data Preprocessing Pipeline
The preprocessing pipeline consists of several key steps:
Pipeline Steps:
- Raw Count Matrix → Quality Filtering (cells >200 genes)
- Gene Annotation (Genomic coordinates)
- Cell Cycle Removal
- Freeman-Tukey Transformation
- Confident Normal Cell Detection
- Baseline Subtraction
- VegaMC Segmentation
- EM-based CN Calling
- Subclone Detection
1.1 Quality Control
Cells are filtered based on:
- Minimum 200 expressed genes per cell
- Genes expressed in at least 1% of cells
- Minimum genes per chromosome (default: 5)
Filtering criteria:
1.2 Variance Stabilization
The Freeman-Tukey transformation is applied to stabilize variance:
$$y_{gc} = \\log\\left(\\sqrt{x_{gc}} + \\sqrt{x_{gc} + 1}\\right)$$
where is the raw count for gene in cell .
This transformation:
- Approximates a variance-stabilizing transformation for Poisson data
- Handles zero counts gracefully
- Produces approximately homoscedastic data
2. Confident Normal Cell Detection
SCEVAN automatically identifies normal (non-malignant) cells using gene set enrichment analysis.
2.1 Single-Sample Gene Set Testing
The Mann-Whitney-Wilcoxon Gene Set Test (MWW-GST) evaluates enrichment of cell-type specific signatures:
$$\\text{NES}_s = \\frac{\\bar{R}_s - \\mu_0}{\\sigma_0}$$
where:
- $\\bar{R}_s$ is the mean rank of signature genes
- $\\mu_0 = (n+1)/2$ is the expected mean under null
- $\\sigma_0$ is the standard deviation under null
3. VegaMC Segmentation Algorithm
The core segmentation uses VegaMC (Variational Estimator of Genomic Alterations using Multichannel), a greedy algorithm optimizing the objective:
$$\\mathcal{L}(\\mathbf{s}) = \\sum_{i=1}^{K} \\sum_{c=1}^{C} \\left( y_{ic} - \\mu_{s_i,c} \\right)^2 + \\beta K$$
where:
- $\\mathbf{s}$ is the segmentation
- is the number of segments
- $\\beta$ controls segmentation granularity
- $\\mu_{s_i,c}$ is the mean expression in segment for cell
3.1 Greedy Optimization
The algorithm uses a priority queue to efficiently merge adjacent segments:
Algorithm: VegaMC Segmentation
Input: Expression matrix Y, parameter β
Output: Segmentation S
1. Initialize: Each probe is a segment
2. Build priority queue Q with merge costs
3. While min(Q) < β:
a. Pop minimum cost merge (i, j)
b. Merge segments i and j
c. Update affected merge costs in Q
4. Return final segmentation S
4. Copy Number State Calling
An Expectation-Maximization (EM) algorithm assigns copy number states.
4.1 Gaussian Mixture Model
Segment means are modeled as a mixture of 5 Gaussian components:
$$p(x) = \\sum_{k=0}^{4} \\pi_k \\mathcal{N}(x | \\mu_k, \\sigma_k^2)$$
| State | CN | Description |
|---|---|---|
| 0 | Homozygous deletion | Deep loss |
| 1 | Hemizygous deletion | Single copy loss |
| 2 | Diploid | Normal |
| 3 | Single copy gain | Amplification |
| 4 | High amplification | Multi-copy gain |
4.2 EM Algorithm
E-step: Compute posterior probabilities
$$\\gamma_{ik} = \\frac{\\pi_k \\mathcal{N}(x_i | \\mu_k, \\sigma_k^2)}{\\sum_{j=0}^{4} \\pi_j \\mathcal{N}(x_i | \\mu_j, \\sigma_j^2)}$$
M-step: Update parameters
$$\\mu_k^{new} = \\frac{\\sum_i \\gamma_{ik} x_i}{\\sum_i \\gamma_{ik}}$$
$$\\sigma_k^{2,new} = \\frac{\\sum_i \\gamma_{ik} (x_i - \\mu_k^{new})^2}{\\sum_i \\gamma_{ik}}$$
5. Subclone Detection
Performance Characteristics
Parameter Guidelines
| Parameter | Default | Description | Tuning Advice |
|---|---|---|---|
beta_vega |
0.5 | Segmentation granularity | Increase for noisy data |
par_cores |
20 | Parallel cores | Set to available CPUs |
ngenes_chr |
5 | Min genes per chromosome | Lower for sparse data |
perc_genes |
0.1 | Gene expression threshold | Lower for low-coverage |
References
De Falco, A., et al. (2023). A variational algorithm to detect the clonal copy number substructure of tumors from scRNA-seq data. Nature Communications, 14, 1074.
Mardis, E.R., & Wilson, R.K. (2009). Cancer genome sequencing: a review. Human Molecular Genetics, 18(R2), R163-R168.
Blondel, V.D., et al. (2008). Fast unfolding of communities in large networks. Journal of Statistical Mechanics, P10008.
Session Info
sessionInfo()
#> R version 4.4.0 (2024-04-24)
#> Platform: aarch64-apple-darwin20
#> Running under: macOS 15.6.1
#>
#> Matrix products: default
#> BLAS: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRblas.0.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.12.0
#>
#> locale:
#> [1] C
#>
#> time zone: Asia/Shanghai
#> tzcode source: internal
#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> loaded via a namespace (and not attached):
#> [1] digest_0.6.39 desc_1.4.3 R6_2.6.1 fastmap_1.2.0
#> [5] xfun_0.56 cachem_1.1.0 knitr_1.51 htmltools_0.5.9
#> [9] rmarkdown_2.30 lifecycle_1.0.5 cli_3.6.5 sass_0.4.10
#> [13] pkgdown_2.1.3 textshaping_1.0.4 jquerylib_0.1.4 systemfonts_1.3.1
#> [17] compiler_4.4.0 tools_4.4.0 ragg_1.5.0 bslib_0.9.0
#> [21] evaluate_1.0.5 yaml_2.3.12 otel_0.2.0 jsonlite_2.0.0
#> [25] rlang_1.1.7 fs_1.6.6 htmlwidgets_1.6.4