From 02c8fca39a69b0a63c4ed9e25acb9cf5eb243b7e Mon Sep 17 00:00:00 2001 From: Enid Lam Date: Mon, 9 Sep 2024 11:19:58 +1000 Subject: [PATCH] fix output when single dominant barcode exceeds percentile --- R/calcPercentileBarcodes.R | 1 + 1 file changed, 1 insertion(+) diff --git a/R/calcPercentileBarcodes.R b/R/calcPercentileBarcodes.R index 1b3d03a..99aa626 100644 --- a/R/calcPercentileBarcodes.R +++ b/R/calcPercentileBarcodes.R @@ -41,6 +41,7 @@ calcPercentileBarcodes <- function(dgeObject, percentile = 0.95) { # find number of barcodes that make up Nth percentile len <- length(which(cumsum <= percentile.cutoff)) + len <- max(1,len) # fill Nth percentile data frame for plotting below d <- data.frame(Sample = factor(samples[i]), NumBarcodes = len)