From ac408e2a27935c016717db65e9bab48ccc2755f1 Mon Sep 17 00:00:00 2001 From: AndiMunteanu Date: Mon, 21 Oct 2024 12:22:40 +0300 Subject: [PATCH] [fix] Adapt colSums to the matrix type --- R/shiny-app.R | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/R/shiny-app.R b/R/shiny-app.R index 69d827b..98a8031 100644 --- a/R/shiny-app.R +++ b/R/shiny-app.R @@ -523,7 +523,12 @@ write_shiny_app.default <- function(object, height_ratio = 0.6, qualpalr_colorspace = "pretty") { # nFeature <- DelayedMatrixStats::colSums2(object > 0) - nFeature <- colSums(object > 0) + if (inherits(object, "dgCMatrix")) { + nFeature <- Matrix::colSums(object > 0) + } else { + nFeature <- matrixStats::colSums2(object > 0) + } + warning_message <- "" shiny_app_title <- paste("ClustAssess ShinyApp -", shiny_app_title)