From 14848e83a9fd4e032a825fa513ebc4355b7077f7 Mon Sep 17 00:00:00 2001 From: stemangiola Date: Fri, 8 Sep 2023 19:46:38 +1000 Subject: [PATCH 1/2] use Matrix library for sparse counts --- NAMESPACE | 1 + R/methods_SE.R | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NAMESPACE b/NAMESPACE index 58ce8456..8354d234 100755 --- a/NAMESPACE +++ b/NAMESPACE @@ -83,6 +83,7 @@ import(preprocessCore) import(readr) import(tibble) importFrom(GenomicRanges,makeGRangesListFromDataFrame) +importFrom(Matrix,colSums) importFrom(S4Vectors,metadata) importFrom(SummarizedExperiment,SummarizedExperiment) importFrom(SummarizedExperiment,assays) diff --git a/R/methods_SE.R b/R/methods_SE.R index 7c86345d..3d152a7b 100755 --- a/R/methods_SE.R +++ b/R/methods_SE.R @@ -1584,6 +1584,7 @@ setMethod("keep_variable", #' #' @importFrom purrr map_chr #' @importFrom tidyr unite +#' @importFrom Matrix colSums #' #' @docType methods #' @rdname keep_variable-methods @@ -1711,7 +1712,7 @@ setMethod("keep_variable", min.count = minimum_counts, group = string_factor_of_interest, min.prop = minimum_proportion, - lib.size = colSums(., na.rm=TRUE) + lib.size = Matrix::colSums(., na.rm=TRUE) ) %>% not() %>% which %>% From 6386415be5aad4e936900022d1857bb49b6f4eb2 Mon Sep 17 00:00:00 2001 From: Stefano Mangiola Date: Thu, 14 Sep 2023 12:24:33 +1000 Subject: [PATCH 2/2] Update DESCRIPTION --- DESCRIPTION | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 1c97a1ae..74c089da 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -35,7 +35,8 @@ Imports: GenomicRanges, methods, S4Vectors, - crayon + crayon, + Matrix Suggests: BiocStyle, testthat,