In single-cell RNA sequencing (scRNA-seq) data, dropout events often mask lowly expressed genes, making them indistinguishable from true zero expression and obscuring subtle differences between cell types. This hinders accurate downstream analysis. ccImpute is an innovative imputation algorithm designed to address this issue. It leverages consensus clustering to identify similar cells and imputes the most probable dropout events. The rigorous evaluation demonstrates that ccImpute outperforms existing methods while minimizing the introduction of noise, as evidenced by clustering performance on datasets with known cell identities. Please see the manuscript for more details.
You can install the release version of ccImpute from BioConductor:
if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("ccImpute")Alternatively, you can install the development version of the package from GitHub with:
if (!require("devtools", quietly = TRUE))
install.packages("devtools")
devtools::install_github("khazum/ccImpute")Here's a simple example that loads scRNA-seq data and imputes dropout events, creating a new assay named 'imputed' within the 'SingleCellExperiment' object. Please refer to the package manual for detailed instructions and strategies to optimize the performance. package manual.
library(scRNAseq)
library(scater)
library(BiocParallel)
# Load Usoskin brain cells dataset:
sce <- UsoskinBrainData()
X <- cpm(sce)
labels <- colData(sce)$"Level 1"
# Do pre-processing of the data:
#Filter bad cells
filt <- !grepl("Empty well", labels) &
!grepl("NF outlier", labels) &
!grepl("TH outlier", labels) &
!grepl("NoN outlier", labels) &
!grepl("NoN", labels) &
!grepl("Central, unsolved", labels) &
!grepl(">1 cell", labels) &
!grepl("Medium", labels)
labels <-labels[filt]
X <- as.matrix(X[,filt])
#Remove genes that are not expressed in any cells:
X <- X[rowSums(X)>0,]
#Recreate the SingleCellExperiment and add log-transformed data:
ann <- data.frame(cell_id = labels)
sce <- SingleCellExperiment(assays = list(normcounts = as.matrix(X)),
colData = ann)
logcounts(sce) <- log(normcounts(sce) + 1)
cores <- 2
BPPARAM = MulticoreParam(cores)
sce <- ccImpute(sce, BPPARAM=BPPARAM)
summary(assay(sce, "imputed"))- Performance Optimizations:
- Significantly enhanced calculation speed for Pearson and Spearman correlation matrices, including weighted versions.
- Leveraged the Irlba package for efficient truncated Singular Value Decomposition (SVD) computation.
- Optimized imputation by limiting the number of singular components while maintaining the accuracy of downstream analysis, with adjustable maximum limits based on dataset size.
- Optimized the identification of dropout events.
- Introduced a fast dropout calculation method based on non-zero expression value means, preserving imputation performance and greatly improving runtime speed.
- Replaced SIMLR with Tracy-Widom Bound for estimating k when not provided, resulting in faster calculations and improved empirical performance.
- Expanded Functionality:
- Added support for sparse matrices in dgCmatrix format, allowing increased memory efficiency.
- Documentation Enhancements:
- Expanded the package manual with detailed guidance and practical examples for maximizing the package's value and computational speed.
- Included comparative benchmarking against previous release in the package manual, demonstrating the performance improvements.
- Overall Impact:
- The ccImpute package is now substantially faster and more efficient.
- Users can expect a smoother experience with improved documentation and expanded functionality.
- The initial version was submitted to Bioconductor.
Please use this page to report bugs, comments and suggestions.
