Skip to content

Commit

Permalink
[fix] Adapt colSums to the matrix type
Browse files Browse the repository at this point in the history
  • Loading branch information
AndiMunteanu committed Oct 21, 2024
1 parent 431fdd8 commit ac408e2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion R/shiny-app.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit ac408e2

Please sign in to comment.