# Introduction to the scDblFinder package

# Introduction

The `scDblFinder` package gathers various methods for the detection and handling of doublets/multiplets in single-cell sequencing data (i.e. multiple cells captured within the same droplet or reaction volume). This vignette provides a brief overview of the different approaches (which are each covered in their own vignettes) for single-cell RNA sequencing. For doublet detection in genomic data, see the scATACseq vignette. For a more general introduction to the topic of doublets, refer to the OCSA book.

All methods require as an input either a matrix of counts or a SingleCellExperiment containing count data. With the exception of findDoubletClusters, which operates at the level of clusters (and consequently requires clustering information), all methods try to assign each cell a score indicating its likelihood (broadly understood) of being a doublet.

The approaches described here are complementary to doublets identified via cell hashes and SNPs in multiplexed samples: while hashing/genotypes can identify doublets formed by cells of the same type (homotypic doublets) from two samples, which are often nearly undistinguishable from real cells transcriptionally (and hence generally unidentifiable through the present package), it cannot identify doublets made by cells of the same sample, even if they are heterotypic (formed by different cell types). Instead, the methods presented here are primarily geared towards the identification of heterotypic doublets, which for most purposes are also the most critical ones.

## computeDoubletDensity

The `computeDoubletDensity` method (formerly `scran::doubletCells`) generates random artificial doublets from the real cells, and tries to identify cells whose neighborhood has a high local density of articial doublets. See computeDoubletDensity for more information.

## recoverDoublets

The `recoverDoublets` method is meant to be used when some doublets are already known, for instance through genotype-based calls or cell hashing in multiplexed experiments. The function then tries to identify intra-sample doublets that are neighbors to the known inter-sample doublets. See recoverDoublets for more information.

## scDblFinder

The `scDblFinder` method combines both known doublets (if available) and cluster-based artificial doublets to identify doublets. The approach builds and improves on a variety of earlier efforts, and is at present the most accurate approach included in this package. See scDblFinder for more information.

## directDblClassification

The `directDblClassification` method identifies doublets by training a classifier directly on gene expression. This follows the same procedure as `scDblFinder` for doublet generation and iterative training, but skips the k-nearest neighbor step and directly uses the matrix of real cells and artificial doublets. This is computationally more intensive and generally leads to worse predictions than `scDblFinder`, and it is included chiefly for comparative purposes. See `?directDblClassification` for more information.

## findDoubletClusters

The `findDoubletClusters` method identifies clusters that are likely to be composed of doublets by estimating whether their expression profile lies between two other clusters. See findDoubletClusters for more information.

# Installation

    if (!requireNamespace("BiocManager", quietly = TRUE))
        install.packages("BiocManager")
    BiocManager::install("scDblFinder")

    # or, to get that latest developments:
    BiocManager::install("plger/scDblFinder")

# Which method to choose?

A benchmark of the main methods available in the package is presented in the scDblFinder paper. While the different methods included here have their values, overall the `scDblFinder` method had the best performance (also superior to other methods not included in this package), and should be used by default.

# Session information

    sessionInfo()

    ## R version 4.6.1 (2026-06-24)
    ## Platform: x86_64-pc-linux-gnu
    ## Running under: Ubuntu 26.04 LTS
    ##
    ## Matrix products: default
    ## BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
    ## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.32.so;  LAPACK version 3.12.0
    ##
    ## locale:
    ##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
    ##  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
    ##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
    ##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
    ##  [9] LC_ADDRESS=C               LC_TELEPHONE=C
    ## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
    ##
    ## time zone: Etc/UTC
    ## tzcode source: system (glibc)
    ##
    ## attached base packages:
    ## [1] stats4    stats     graphics  grDevices utils     datasets  methods
    ## [8] base
    ##
    ## other attached packages:
    ##  [1] scater_1.40.1               ggplot2_4.0.3
    ##  [3] scuttle_1.22.0              scDblFinder_1.26.7
    ##  [5] scrapper_1.6.3              ensembldb_2.36.1
    ##  [7] AnnotationFilter_1.36.0     GenomicFeatures_1.64.0
    ##  [9] AnnotationDbi_1.74.0        scRNAseq_2.26.0
    ## [11] SingleCellExperiment_1.34.0 SummarizedExperiment_1.42.0
    ## [13] Biobase_2.72.0              GenomicRanges_1.64.0
    ## [15] Seqinfo_1.2.0               IRanges_2.46.0
    ## [17] S4Vectors_0.50.1            BiocGenerics_0.58.1
    ## [19] generics_0.1.4              MatrixGenerics_1.24.0
    ## [21] matrixStats_1.5.0           BiocStyle_2.40.0
    ##
    ## loaded via a namespace (and not attached):
    ##   [1] RColorBrewer_1.1-3       sys_3.4.3                jsonlite_2.0.0
    ##   [4] magrittr_2.0.5           ggbeeswarm_0.7.3         gypsum_1.8.0
    ##   [7] farver_2.1.2             rmarkdown_2.31           BiocIO_1.22.0
    ##  [10] vctrs_0.7.3              memoise_2.0.1            Rsamtools_2.28.0
    ##  [13] RCurl_1.98-1.19          htmltools_0.5.9          S4Arrays_1.12.0
    ##  [16] AnnotationHub_4.2.1      curl_7.1.0               BiocNeighbors_2.6.0
    ##  [19] xgboost_3.2.1.1          Rhdf5lib_2.0.0           SparseArray_1.12.2
    ##  [22] rhdf5_2.56.0             sass_0.4.10              alabaster.base_1.12.0
    ##  [25] bslib_0.11.0             alabaster.sce_1.12.0     httr2_1.2.3
    ##  [28] cachem_1.1.0             buildtools_1.0.0         GenomicAlignments_1.48.0
    ##  [31] igraph_2.3.2             lifecycle_1.0.5          pkgconfig_2.0.3
    ##  [34] rsvd_1.0.5               Matrix_1.7-5             R6_2.6.1
    ##  [37] fastmap_1.2.0            digest_0.6.39            dqrng_0.4.1
    ##  [40] irlba_2.3.7              ExperimentHub_3.2.1      RSQLite_3.53.2
    ##  [43] beachmat_2.28.0          labeling_0.4.3           filelock_1.0.3
    ##  [46] httr_1.4.8               abind_1.4-8              compiler_4.6.1
    ##  [49] bit64_4.8.2              withr_3.0.3              S7_0.2.2
    ##  [52] BiocParallel_1.46.0      viridis_0.6.5            DBI_1.3.0
    ##  [55] HDF5Array_1.40.0         alabaster.ranges_1.12.0  alabaster.schemas_1.12.0
    ##  [58] MASS_7.3-65              rappdirs_0.3.4           DelayedArray_0.38.2
    ##  [61] rjson_0.2.23             bluster_1.22.0           tools_4.6.1
    ##  [64] vipor_0.4.7              otel_0.2.0               beeswarm_0.4.0
    ##  [67] glue_1.8.1               h5mread_1.4.0            restfulr_0.0.17
    ##  [70] rhdf5filters_1.24.0      grid_4.6.1               cluster_2.1.8.2
    ##  [73] gtable_0.3.6             data.table_1.18.4        metapod_1.20.0
    ##  [76] BiocSingular_1.28.0      ScaledMatrix_1.20.0      XVector_0.52.0
    ##  [79] ggrepel_0.9.8            BiocVersion_3.23.1       pillar_1.11.1
    ##  [82] limma_3.68.4             dplyr_1.2.1              BiocFileCache_3.2.0
    ##  [85] lattice_0.22-9           rtracklayer_1.72.0       bit_4.6.0
    ##  [88] tidyselect_1.2.1         locfit_1.5-9.12          maketools_1.3.2
    ##  [91] Biostrings_2.80.1        knitr_1.51               gridExtra_2.3.1
    ##  [94] ProtGenerics_1.44.0      edgeR_4.10.1             xfun_0.59
    ##  [97] statmod_1.5.2            UCSC.utils_1.8.0         lazyeval_0.2.3
    ## [100] yaml_2.3.12              evaluate_1.0.5           codetools_0.2-20
    ## [103] cigarillo_1.2.0          tibble_3.3.1             alabaster.matrix_1.12.0
    ## [106] BiocManager_1.30.27      cli_3.6.6                jquerylib_0.1.4
    ## [109] Rcpp_1.1.1-1.1           GenomeInfoDb_1.48.0      dbplyr_2.6.0
    ## [112] png_0.1-9                XML_3.99-0.23            parallel_4.6.1
    ## [115] blob_1.3.0               scran_1.40.0             bitops_1.0-9
    ## [118] viridisLite_0.4.3        alabaster.se_1.12.0      scales_1.4.0
    ## [121] purrr_1.2.2              crayon_1.5.3             rlang_1.2.0
    ## [124] KEGGREST_1.52.2