Skip to contents

Run doublet-calling with DoubletDetection

Usage

RunDoubletDetection(
  object,
  assay = "RNA",
  db_rate = ncol(srt)/1000 * 0.01,
  cores = 1,
  data_type = NULL,
  ...,
  verbose = TRUE,
  srt = NULL
)

Arguments

object

A Seurat object.

assay

Assay used for doublet calling.

db_rate

Expected doublet rate.

cores

The number of CPU cores to use for doubletdetection.

data_type

Optional CheckDataType result, used internally to avoid rescanning the count matrix.

...

Additional arguments to be passed to doubletdetection.BoostClassifier.

verbose

Whether to print messages.

srt

Deprecated alias for object; supply exactly one of the two. It will be removed in scop 1.0.0.

Examples

data(pancreas_sub)
pancreas_sub <- RunStandardWorkflow(pancreas_sub)
#> ℹ [2026-10-11 23:16:07] Start standard processing workflow...
#> ℹ [2026-10-11 23:16:07] Checking a list of <Seurat>...
#> ! [2026-10-11 23:16:07] Data 1/1 of the `srt_list` is "unknown"
#> ℹ [2026-10-11 23:16:07] Perform `NormalizeData()` with `normalization.method = 'LogNormalize'` on 1/1 of `srt_list`...
#> ℹ [2026-10-11 23:16:07] Perform `FindVariableFeatures()` on 1/1 of `srt_list`...
#> ℹ [2026-10-11 23:16:07] Use the separate HVF from `srt_list`
#> ℹ [2026-10-11 23:16:08] Number of available HVF: 2000
#> ℹ [2026-10-11 23:16:08] Finished check
#> ℹ [2026-10-11 23:16:08] Perform `ScaleData()`
#> ℹ [2026-10-11 23:16:08] Perform pca linear dimension reduction
#> ℹ [2026-10-11 23:16:08] Use stored estimated dimensions 1:23 for Standardpca
#> ℹ [2026-10-11 23:16:09] Perform `Seurat::FindClusters()` with `cluster_algorithm = 'louvain'` and `cluster_resolution = 0.6`
#> ℹ [2026-10-11 23:16:09] Reorder clusters...
#> ℹ [2026-10-11 23:16:09] Skip `log1p()` because `layer = data` is not "counts"
#> ℹ [2026-10-11 23:16:09] Perform umap nonlinear dimension reduction
#> ✔ [2026-10-11 23:16:16] Standard processing workflow completed
pancreas_sub <- RunDoubletDetection(pancreas_sub)
#> ℹ [2026-10-11 23:16:16] Running DoubletDetection
#> Error in if (existing_minor %in% c("3.10", "3.11", "3.12")) {    version <- paste0(existing_minor, "-1")}: argument is of length zero
CellDimPlot(
  pancreas_sub,
  reduction = "umap",
  group.by = "db.DoubletDetection_class"
)
#> Error in CellDimPlot(pancreas_sub, reduction = "umap", group.by = "db.DoubletDetection_class"): "db.DoubletDetection_class" is not in the meta.data of srt object

FeatureDimPlot(
  pancreas_sub,
  reduction = "umap",
  features = "db.DoubletDetection_score"
)
#> ! [2026-10-11 23:16:39] "db.DoubletDetection_score" are not in the features of <Seurat>
#> Error in FeatureDimPlot(pancreas_sub, reduction = "umap", features = "db.DoubletDetection_score"): There are no valid features present.