Skip to contents

Tests for enrichment of doublets created from each cluster (i.e. cluster's stickiness). Only applicable with >=4 clusters. Note that when applied to an multisample object, this functions assumes that the cluster labels match across samples.

Usage

clusterStickiness(
  x,
  type = c("quasibinomial", "nbinom", "binomial", "poisson"),
  inclDiff = NULL,
  verbose = TRUE
)

Arguments

x

A table of double statistics, or a SingleCellExperiment on which scDblFinder was run using the cluster-based approach.

type

The type of test to use (quasibinomial recommended).

inclDiff

Logical; whether to include the difficulty in the model. If NULL, will be used only if there is a significant trend with the enrichment.

verbose

Logical; whether to print additional running information.

Value

A table of test results for each cluster.

Examples

sce <- mockDoubletSCE(rep(200,5))
sce <- scDblFinder(sce, clusters=TRUE, artificialDoublets=500)
#> Warning: Some cells in `sce` have an extremely low read counts; note that these could trigger errors and might best be filtered out
#> Clustering cells...
#> 5 clusters
#> Creating ~500 artificial doublets...
#> Dimensional reduction
#> Evaluating kNN...
#> Training model...
#> iter=0, 83 cells excluded from training.
#> iter=1, 83 cells excluded from training.
#> iter=2, 83 cells excluded from training.
#> Threshold found:0.992
#> 83 (7.7%) doublets called
clusterStickiness(sce)
#>      Estimate Std. Error    t value   p.value FDR
#> 4  0.17105050  0.3551707  0.4816008 0.6504287   1
#> 3  0.13707656  0.3542400  0.3869596 0.7147080   1
#> 5 -0.12097021  0.4492524 -0.2692700 0.7984804   1
#> 1  0.08987382  0.3622676  0.2480868 0.8139339   1
#> 2  0.07532340  0.3744404  0.2011626 0.8484988   1