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.
Examples
sce <- mockDoubletSCE(rep(200,5), dbl.rate=0.2)
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, 40 cells excluded from training.
#> iter=1, 41 cells excluded from training.
#> iter=2, 37 cells excluded from training.
#> Threshold found:0.618
#> 47 (4%) doublets called
clusterStickiness(sce)
#> Estimate Std. Error t value p.value FDR
#> 4 0.44502070 0.1776299 2.5053260 0.05413636 0.2706818
#> 1 0.38092041 0.1775950 2.1448829 0.08479195 0.3391678
#> 5 -0.62182785 0.3284316 -1.8933253 0.11686013 0.3505804
#> 3 -0.27224554 0.2282615 -1.1926914 0.28649854 0.5729971
#> 2 0.02637134 0.2118960 0.1244542 0.90580434 0.9058043