From dc053983dac8c25b743332b40bf4ee0250b176f5 Mon Sep 17 00:00:00 2001 From: plger Date: Wed, 8 Jan 2025 09:55:34 +0100 Subject: [PATCH] increased example dbr --- R/enrichment.R | 3 ++- man/clusterStickiness.Rd | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/R/enrichment.R b/R/enrichment.R index ff2cf63..6d2caac 100644 --- a/R/enrichment.R +++ b/R/enrichment.R @@ -19,7 +19,7 @@ #' @export #' #' @examples -#' sce <- mockDoubletSCE(rep(200,5)) +#' sce <- mockDoubletSCE(rep(200,5), dbl.rate=0.2) #' sce <- scDblFinder(sce, clusters=TRUE, artificialDoublets=500) #' clusterStickiness(sce) clusterStickiness <- function(x, type=c("quasibinomial","nbinom","binomial","poisson"), @@ -31,6 +31,7 @@ clusterStickiness <- function(x, type=c("quasibinomial","nbinom","binomial","poi "with the cluster-based approach?") } stopifnot(all(c("combination","observed","expected") %in% colnames(x))) + if(sum(x$observed)<5) stop("Insufficient number of doublets") if(is.null(inclDiff)) inclDiff <- length(unique(x$combination))>15 diff --git a/man/clusterStickiness.Rd b/man/clusterStickiness.Rd index 2261437..59ae73a 100644 --- a/man/clusterStickiness.Rd +++ b/man/clusterStickiness.Rd @@ -32,7 +32,7 @@ Note that when applied to an multisample object, this functions assumes that the cluster labels match across samples. } \examples{ -sce <- mockDoubletSCE(rep(200,5)) +sce <- mockDoubletSCE(rep(200,5), dbl.rate=0.2) sce <- scDblFinder(sce, clusters=TRUE, artificialDoublets=500) clusterStickiness(sce) }