From e5ee9bf2c9c46aba444eecb6cf2c18e391c1f721 Mon Sep 17 00:00:00 2001 From: theHumanBorch Date: Mon, 25 Mar 2024 06:27:57 -0500 Subject: [PATCH 01/28] silence some tests --- DESCRIPTION | 2 +- tests/testthat/test-runEscape.R | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index cf2e2b9..3ed5659 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: escape Title: Easy single cell analysis platform for enrichment -Version: 1.99.0 +Version: 1.99.1 Date: 2024-02-29 Authors@R: c( person(given = "Nick", family = "Borcherding", role = c("aut", "cre"), email = "ncborch@gmail.com"), diff --git a/tests/testthat/test-runEscape.R b/tests/testthat/test-runEscape.R index 2861ece..3ad9d9f 100644 --- a/tests/testthat/test-runEscape.R +++ b/tests/testthat/test-runEscape.R @@ -20,10 +20,10 @@ test_that("runEscape works", { # gene.sets = GS, # min.size = NULL) - trial.UCell <- escape.matrix(pbmc_small, - method = "UCell", - gene.sets = GS, - min.size = NULL) + #trial.UCell <- escape.matrix(pbmc_small, + # method = "UCell", + # gene.sets = GS, + # min.size = NULL) set.seed(123) trial.AUCell <- escape.matrix(pbmc_small, @@ -35,8 +35,8 @@ test_that("runEscape works", { getdata("runEscape", "escape.matrix_ssGSEA")) #expect_equal(trial.GSVA, # getdata("runEscape", "escape.matrix_GSVA")) - expect_equal(trial.UCell, - getdata("runEscape", "escape.matrix_UCell")) + #expect_equal(trial.UCell, + # getdata("runEscape", "escape.matrix_UCell")) expect_equal(trial.AUCell, getdata("runEscape", "escape.matrix_AUCell"), tolerance=1e-4) From 9c631ec0e344ea52ff7bf66aef98a1400c89167a Mon Sep 17 00:00:00 2001 From: theHumanBorch Date: Thu, 4 Apr 2024 05:42:47 -0500 Subject: [PATCH 02/28] update hex sticker location --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 36d886e..bd94d0f 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [![Documentation](https://img.shields.io/badge/docs-stable-blue.svg)](https://ncborcherding.github.io/vignettes/escape_vignette.html) - + ### Introduction Single-cell sequencing (SCS) is a fundamental technology in investigating a diverse array of biological fields. Part of the struggle with the high-resolution approach of SCS, is distilling the data down to meaningful scientific hypotheses. *escape* was created to bridge SCS results, either from raw counts or from popular R-based single-cell pipelines, like [Seurat](https://satijalab.org/seurat/) or [SingleCellExperiment](https://bioconductor.org/books/release/OSCA/book-contents.html#basics), with gene set enrichment analyses (GSEA). The *escape* package allows users to easily incorporate multiple methods of GSEA and offers several visualization and analysis methods. The package accesses the entire [Molecular Signature Database v7.0](https://www.gsea-msigdb.org/gsea/msigdb/search.jsp) and enables users to select single, multiple gene sets, and even libraries to perform enrichment analysis on. From d8b75d1921e3768eee6104c11e390cfc7b380f81 Mon Sep 17 00:00:00 2001 From: theHumanBorch Date: Thu, 4 Apr 2024 07:21:14 -0500 Subject: [PATCH 03/28] update r-cmd-check after PR From c067057d980c9a5a27e03fe41280f034d050ce1b Mon Sep 17 00:00:00 2001 From: theHumanBorch Date: Thu, 4 Apr 2024 07:22:12 -0500 Subject: [PATCH 04/28] Update test-coverage.yaml From d5baeaebc9d7932e6cac4d58137b2272dd52f395 Mon Sep 17 00:00:00 2001 From: theHumanBorch Date: Thu, 4 Apr 2024 08:39:54 -0500 Subject: [PATCH 05/28] fix break caused by GSVA version --- .github/workflows/R-CMD-check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 5dde127..cf3d42f 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -46,7 +46,7 @@ jobs: needs: check - name: Add GSVA repo - run: Rscript -e 'remotes::install_github("rcastelo/GSVA")' + run: Rscript -e 'remotes::install_github("rcastelo/GSVA@27d70c068f12f922e5ca2f363626089310dc2a2b")' - uses: r-lib/actions/check-r-package@v2 with: From ed8df641a0ba11b4ceaf39c91fc445124daf122c Mon Sep 17 00:00:00 2001 From: theHumanBorch Date: Thu, 4 Apr 2024 08:40:27 -0500 Subject: [PATCH 06/28] Update test-coverage.yaml --- .github/workflows/test-coverage.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 58778d3..f77e95e 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -30,7 +30,7 @@ jobs: run: Rscript -e 'install.packages("remotes")' - name: Add GSVA repo - run: Rscript -e 'remotes::install_github("rcastelo/GSVA")' + run: Rscript -e 'remotes::install_github("rcastelo/GSVA@27d70c068f12f922e5ca2f363626089310dc2a2b")' - name: Test coverage run: | From 7fbb45829160dc4564c7d122866d01fbec0b40a9 Mon Sep 17 00:00:00 2001 From: theHumanBorch Date: Thu, 25 Apr 2024 10:33:52 -0500 Subject: [PATCH 07/28] Update test-coverage.yaml --- .github/workflows/test-coverage.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index f77e95e..5c38970 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -37,6 +37,7 @@ jobs: covr::codecov( quiet = FALSE, clean = FALSE, + exclusions = "R/global.R", install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") ) shell: Rscript {0} From f825958373c2e818717c95e91cbca0570ad8e286 Mon Sep 17 00:00:00 2001 From: theHumanBorch Date: Thu, 25 Apr 2024 13:25:38 -0500 Subject: [PATCH 08/28] Update R-CMD-check.yaml --- .github/workflows/R-CMD-check.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index cf3d42f..7c2ea1b 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -18,8 +18,6 @@ jobs: fail-fast: false matrix: config: - - {os: macos-latest, r: 'release'} - - {os: windows-latest, r: 'release'} - {os: ubuntu-latest, r: 'release'} env: From 42b4c201699d3a67ff71295e37d3d9e6bb02552b Mon Sep 17 00:00:00 2001 From: theHumanBorch Date: Wed, 1 May 2024 08:14:26 -0500 Subject: [PATCH 09/28] update testthat --- .../denistyenrichment-default-plot.svg | 24 +- .../denistyenrichment-group-by-plot.svg | 20 +- .../pcaEnrichment/pcaenrichment-hex-plot.svg | 137 +- .../ridgeenrichment-default-plot.svg | 24 +- .../ridgeenrichment-facet-plot.svg | 20 +- .../ridgeenrichment-gradient-facet-plot.svg | 4296 ++++++++--------- .../ridgeenrichment-gradient-plot.svg | 2838 +++++------ .../ridgeenrichment-gradient-reorder-plot.svg | 2628 +++++----- .../ridgeenrichment-order-plot.svg | 16 +- .../ridgeenrichment-rugadded-plot.svg | 190 +- 10 files changed, 5037 insertions(+), 5156 deletions(-) diff --git a/tests/testthat/_snaps/densityEnrichment/denistyenrichment-default-plot.svg b/tests/testthat/_snaps/densityEnrichment/denistyenrichment-default-plot.svg index 48d5007..e45a31f 100644 --- a/tests/testthat/_snaps/densityEnrichment/denistyenrichment-default-plot.svg +++ b/tests/testthat/_snaps/densityEnrichment/denistyenrichment-default-plot.svg @@ -46,23 +46,23 @@ - - - - - - + + + + + + 0.000 -0.003 -0.006 -0.009 +0.003 +0.006 +0.009 - - - + + + Rank Density diff --git a/tests/testthat/_snaps/densityEnrichment/denistyenrichment-group-by-plot.svg b/tests/testthat/_snaps/densityEnrichment/denistyenrichment-group-by-plot.svg index 7748699..27f7638 100644 --- a/tests/testthat/_snaps/densityEnrichment/denistyenrichment-group-by-plot.svg +++ b/tests/testthat/_snaps/densityEnrichment/denistyenrichment-group-by-plot.svg @@ -46,21 +46,21 @@ - - - - + + + + 0.0 -0.1 -0.2 -0.3 +0.1 +0.2 +0.3 - - - + + + Rank Density diff --git a/tests/testthat/_snaps/pcaEnrichment/pcaenrichment-hex-plot.svg b/tests/testthat/_snaps/pcaEnrichment/pcaenrichment-hex-plot.svg index 51edd38..b98f387 100644 --- a/tests/testthat/_snaps/pcaEnrichment/pcaenrichment-hex-plot.svg +++ b/tests/testthat/_snaps/pcaEnrichment/pcaenrichment-hex-plot.svg @@ -21,137 +21,18 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - --2 --1 -0 -1 -2 -3 - - - - - - - - - - - - --6 --4 --2 -0 -2 -PC1 - (35.5%) -PC2 - (12.5%) - -count - - - - - - - - - - - -1.00 -1.25 -1.50 -1.75 -2.00 -pcaEnrichment_hex_plot +PC1 + (35.5%) +PC2 + (12.5%) +pcaEnrichment_hex_plot diff --git a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-default-plot.svg b/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-default-plot.svg index 041c007..5cf8122 100644 --- a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-default-plot.svg +++ b/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-default-plot.svg @@ -27,21 +27,21 @@ - - - - - - + + + + + + -0 -1 -2 - - - +0 +1 +2 + + + diff --git a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-facet-plot.svg b/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-facet-plot.svg index daf1e9e..2103843 100644 --- a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-facet-plot.svg +++ b/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-facet-plot.svg @@ -27,12 +27,12 @@ - + - + - - + + @@ -43,12 +43,12 @@ - - - - - - + + + + + + diff --git a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-facet-plot.svg b/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-facet-plot.svg index 41ff30e..1486e18 100644 --- a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-facet-plot.svg +++ b/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-facet-plot.svg @@ -27,473 +27,473 @@ - - - + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - + + + - - + + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - + @@ -508,10 +508,10 @@ - - - - + + + + @@ -519,331 +519,331 @@ - - - - - + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + - - - - + + + + @@ -855,17 +855,17 @@ - - - - + + + + - - + + @@ -960,7 +960,7 @@ - + @@ -978,371 +978,371 @@ - - + + - - + + - - + + - - - + + + - - - - - - - + + + + + + + - - - - + + + + - - + + - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + @@ -1351,8 +1351,8 @@ - - + + @@ -1426,8 +1426,8 @@ - - + + @@ -1528,8 +1528,8 @@ - - + + @@ -1537,379 +1537,379 @@ - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1918,381 +1918,381 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - + + @@ -2378,8 +2378,8 @@ - - + + @@ -2442,8 +2442,8 @@ - - + + @@ -2452,16 +2452,16 @@ - - - - + + + + - - + + - - + + @@ -2470,310 +2470,310 @@ - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - - - - - - - - + + + + + + + + + + + @@ -2788,8 +2788,8 @@ - - + + @@ -2849,8 +2849,8 @@ - - + + diff --git a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-plot.svg b/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-plot.svg index 202c942..5de6dd7 100644 --- a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-plot.svg +++ b/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-plot.svg @@ -27,1428 +27,1428 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -0 -1 -2 - - - +0 +1 +2 + + + diff --git a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-reorder-plot.svg b/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-reorder-plot.svg index 23d2453..1930ebb 100644 --- a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-reorder-plot.svg +++ b/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-reorder-plot.svg @@ -27,694 +27,694 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - + + + + + + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -722,228 +722,228 @@ - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - + + + - - + + - - - - - + + + + + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + @@ -967,8 +967,8 @@ - - + + @@ -976,479 +976,479 @@ - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2 -0 +0 1 - + diff --git a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-order-plot.svg b/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-order-plot.svg index 0d1f762..041018a 100644 --- a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-order-plot.svg +++ b/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-order-plot.svg @@ -27,21 +27,21 @@ - - - - - - + + + + + + 2 -0 +0 1 - + diff --git a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-rugadded-plot.svg b/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-rugadded-plot.svg index 0ea7fee..0558a09 100644 --- a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-rugadded-plot.svg +++ b/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-rugadded-plot.svg @@ -27,104 +27,104 @@ - - - -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| - - - -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| - - - -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| + + + +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| + + + +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| + + + +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| -0 -1 -2 - - - +0 +1 +2 + + + From 30c551efb7e02d95b0afa3366d208386551f9ed5 Mon Sep 17 00:00:00 2001 From: theHumanBorch Date: Wed, 1 May 2024 08:48:02 -0500 Subject: [PATCH 10/28] modulate testthat --- .../pcaEnrichment/pcaenrichment-hex-plot.svg | 137 ++++++++++++++++-- .../splitenrichment-default-plot.svg | 12 +- .../splitenrichment-facet-plot.svg | 12 +- .../splitenrichment-mean-plot.svg | 12 +- 4 files changed, 146 insertions(+), 27 deletions(-) diff --git a/tests/testthat/_snaps/pcaEnrichment/pcaenrichment-hex-plot.svg b/tests/testthat/_snaps/pcaEnrichment/pcaenrichment-hex-plot.svg index b98f387..51edd38 100644 --- a/tests/testthat/_snaps/pcaEnrichment/pcaenrichment-hex-plot.svg +++ b/tests/testthat/_snaps/pcaEnrichment/pcaenrichment-hex-plot.svg @@ -21,18 +21,137 @@ - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -PC1 - (35.5%) -PC2 - (12.5%) -pcaEnrichment_hex_plot + +-2 +-1 +0 +1 +2 +3 + + + + + + + + + + + + +-6 +-4 +-2 +0 +2 +PC1 + (35.5%) +PC2 + (12.5%) + +count + + + + + + + + + + + +1.00 +1.25 +1.50 +1.75 +2.00 +pcaEnrichment_hex_plot diff --git a/tests/testthat/_snaps/splitEnrichment/splitenrichment-default-plot.svg b/tests/testthat/_snaps/splitEnrichment/splitenrichment-default-plot.svg index b4882eb..1a134fd 100644 --- a/tests/testthat/_snaps/splitEnrichment/splitenrichment-default-plot.svg +++ b/tests/testthat/_snaps/splitEnrichment/splitenrichment-default-plot.svg @@ -27,12 +27,12 @@ - - - - - - + + + + + + diff --git a/tests/testthat/_snaps/splitEnrichment/splitenrichment-facet-plot.svg b/tests/testthat/_snaps/splitEnrichment/splitenrichment-facet-plot.svg index 5e7c559..88dfef8 100644 --- a/tests/testthat/_snaps/splitEnrichment/splitenrichment-facet-plot.svg +++ b/tests/testthat/_snaps/splitEnrichment/splitenrichment-facet-plot.svg @@ -27,10 +27,10 @@ - - - - + + + + @@ -57,8 +57,8 @@ - - + + diff --git a/tests/testthat/_snaps/splitEnrichment/splitenrichment-mean-plot.svg b/tests/testthat/_snaps/splitEnrichment/splitenrichment-mean-plot.svg index 1793e03..e28401c 100644 --- a/tests/testthat/_snaps/splitEnrichment/splitenrichment-mean-plot.svg +++ b/tests/testthat/_snaps/splitEnrichment/splitenrichment-mean-plot.svg @@ -27,12 +27,12 @@ - - - - - - + + + + + + From 4b75c160ed185913ac6e4b3389c29ce5870387d6 Mon Sep 17 00:00:00 2001 From: theHumanBorch Date: Fri, 3 May 2024 07:26:40 -0500 Subject: [PATCH 11/28] 3.19 release readme update --- README.md | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index bd94d0f..76e8d45 100644 --- a/README.md +++ b/README.md @@ -24,14 +24,6 @@ More information on each method is available in the *escape* manual for ```escap ### Installation -#### GSVA requirement - -*escape* requires GSVA v1.51.5 (not on Bioconductor 3.18). The easiest way to install is: - -```r -devtools::install_github("rcastelo/GSVA") -``` - #### Install Via GitHub ```r @@ -40,10 +32,12 @@ devtools::install_github("ncborcherding/escape") #### Install via Bioconductor -For now, the newest version of escape is available in the Bioconductor dev version (3.19). +[escape v2](https://www.bioconductor.org/packages/release/bioc/html/escape.html) is available for Bioconductor users. It can be installed with the following: ```r -BiocManager::install(version='devel') +if (!require("BiocManager", quietly = TRUE)) + install.packages("BiocManager") + BiocManager::install("escape") ``` From d4ecb0b75db0454ada611bd1c5e64cd3996b63c9 Mon Sep 17 00:00:00 2001 From: theHumanBorch Date: Sun, 12 May 2024 13:53:50 -0500 Subject: [PATCH 12/28] Update README.md --- README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 76e8d45..7eb880e 100644 --- a/README.md +++ b/README.md @@ -83,5 +83,14 @@ A more comprehensive vignette including the visualizations, principal component ### Citation If using escape, please cite the [article](https://www.nature.com/articles/s42003-020-01625-6): Borcherding, N., Vishwakarma, A., Voigt, A.P. et al. Mapping the immune environment in clear cell renal carcinoma by single-cell genomics. Commun Biol 4, 122 (2021). -### Contact -Questions, comments, suggestions, please feel free to contact Nick Borcherding via this repository, [email](mailto:ncborch@gmail.com), or using [twitter](https://twitter.com/theHumanBorch). +### Bug Reports/New Features + +#### If you run into any issues or bugs please submit a [GitHub issue](https://github.com/ncborcherding/escape/issues) with details of the issue. + +- If possible please include a [reproducible example](https://reprex.tidyverse.org/). +Alternatively, an example with the internal **scRep_example** and **contig_list** would +be extremely helpful. + +#### Any requests for new features or enhancements can also be submitted as [GitHub issues](https://github.com/ncborcherding/escape/issues). + +#### [Pull Requests](https://github.com/ncborcherding/escape/pulls) are welcome for bug fixes, new features, or enhancements. From bc244dadeedf8db3587fb9cdaf9fb586deea0dab Mon Sep 17 00:00:00 2001 From: theHumanBorch Date: Sun, 12 May 2024 13:54:28 -0500 Subject: [PATCH 13/28] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7eb880e..a049637 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ If using escape, please cite the [article](https://www.nature.com/articles/s4200 #### If you run into any issues or bugs please submit a [GitHub issue](https://github.com/ncborcherding/escape/issues) with details of the issue. - If possible please include a [reproducible example](https://reprex.tidyverse.org/). -Alternatively, an example with the internal **scRep_example** and **contig_list** would +Alternatively, an example with the the Seurat pbmc_small object would be extremely helpful. #### Any requests for new features or enhancements can also be submitted as [GitHub issues](https://github.com/ncborcherding/escape/issues). From 1487b1ce72a08db168efa1ce5f497dd14d56c9d2 Mon Sep 17 00:00:00 2001 From: theHumanBorch Date: Sun, 12 May 2024 14:01:03 -0500 Subject: [PATCH 14/28] Update README.md --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a049637..50eaa9e 100644 --- a/README.md +++ b/README.md @@ -80,10 +80,8 @@ pbmc_small <- runEscape(pbmc_small, A more comprehensive vignette including the visualizations, principal component analysis and differential testing is available [here](https://www.borch.dev/uploads/screpertoire/articles/Running_Escape.html). -### Citation -If using escape, please cite the [article](https://www.nature.com/articles/s42003-020-01625-6): Borcherding, N., Vishwakarma, A., Voigt, A.P. et al. Mapping the immune environment in clear cell renal carcinoma by single-cell genomics. Commun Biol 4, 122 (2021). -### Bug Reports/New Features +## Bug Reports/New Features #### If you run into any issues or bugs please submit a [GitHub issue](https://github.com/ncborcherding/escape/issues) with details of the issue. @@ -94,3 +92,6 @@ be extremely helpful. #### Any requests for new features or enhancements can also be submitted as [GitHub issues](https://github.com/ncborcherding/escape/issues). #### [Pull Requests](https://github.com/ncborcherding/escape/pulls) are welcome for bug fixes, new features, or enhancements. + +## Citation +If using escape, please cite the [article](https://www.nature.com/articles/s42003-020-01625-6): Borcherding, N., Vishwakarma, A., Voigt, A.P. et al. Mapping the immune environment in clear cell renal carcinoma by single-cell genomics. Commun Biol 4, 122 (2021). From 774905b64a68ec735a1810cd6f3a9c947f45bb05 Mon Sep 17 00:00:00 2001 From: theHumanBorch Date: Fri, 26 Jul 2024 08:23:05 -0500 Subject: [PATCH 15/28] Pass parallel to runEscape #105 Issue fix --- R/runEscape.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/runEscape.R b/R/runEscape.R index b71e4ce..db88688 100644 --- a/R/runEscape.R +++ b/R/runEscape.R @@ -175,7 +175,8 @@ runEscape <- function(input.data, gene.sets = gene.sets, method = method, groups = groups, - min.size = min.size) + min.size = min.size, + BPPARAM = BPPARAM) input.data <- .adding.Enrich(input.data, enrichment, new.assay.name) return(input.data) From c301476431efcd2d8d017c12e247ff20e97d3374 Mon Sep 17 00:00:00 2001 From: theHumanBorch Date: Fri, 26 Jul 2024 08:25:25 -0500 Subject: [PATCH 16/28] News and Version update --- DESCRIPTION | 4 ++-- NEWS.md | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 3ed5659..e285b87 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: escape Title: Easy single cell analysis platform for enrichment -Version: 1.99.1 -Date: 2024-02-29 +Version: 2.0.1 +Date: 2024-07-26 Authors@R: c( person(given = "Nick", family = "Borcherding", role = c("aut", "cre"), email = "ncborch@gmail.com"), person(given = "Jared", family = "Andrews", role = c("aut"), email = "jared.andrews07@gmail.com")) diff --git a/NEWS.md b/NEWS.md index ec9eb18..ce84844 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,9 @@ +# escape VERSION 2.0.1 (2024-07-26) + +## UNDERLYING CHANGES + +* passing parallel processing properly to ```runEscape()``` function. + # escape VERSION 1.99.1 (2024-02-29) ## UNDERLYING CHANGES From 7e4b065a8f0381abef6c60d00f30d6b1d795892e Mon Sep 17 00:00:00 2001 From: theHumanBorch Date: Wed, 31 Jul 2024 09:36:13 -0500 Subject: [PATCH 17/28] Normalization fix #107 Normalization error when only using a input matrix - split input.data into sc.data and enrichment.data --- NAMESPACE | 1 + NEWS.md | 7 ++++++ R/performNormalization.R | 47 ++++++++++++++++++++++++++----------- R/runEscape.R | 14 ++++------- man/performNormalization.Rd | 16 ++++++++----- vignettes/vignette.Rmd | 4 ++-- 6 files changed, 57 insertions(+), 32 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index a750e4c..a8b2d84 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -27,6 +27,7 @@ importFrom(GSVA,gsvaParam) importFrom(GSVA,ssgseaParam) importFrom(MatrixGenerics,rowSds) importFrom(MatrixGenerics,rowSums2) +importFrom(SeuratObject,Assays) importFrom(SeuratObject,CreateAssayObject) importFrom(SeuratObject,CreateDimReducObject) importFrom(SeuratObject,Idents) diff --git a/NEWS.md b/NEWS.md index ec9eb18..01da0da 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,10 @@ +# escape VERSION 2.0.1 (2024-07-26) + +## UNDERLYING CHANGES + +* fixed ```performNormalziation()``` errors when input.data was a matrix, now requires single-cell object and enrichment data +* passing parallel processing properly to ```runEscape()``` function. + # escape VERSION 1.99.1 (2024-02-29) ## UNDERLYING CHANGES diff --git a/R/performNormalization.R b/R/performNormalization.R index 6ebd4cd..0945d54 100644 --- a/R/performNormalization.R +++ b/R/performNormalization.R @@ -7,15 +7,21 @@ #' evaluation for log2-fold change, but will alter the original #' enrichment values. #' -#' @param input.data Enrichment output from \code{\link{escape.matrix}} or -#' \code{\link{runEscape}}. -#' @param assay Name of the assay to plot if data is a single-cell object. +#' @param sc.data Single-cell object or matrix used in the gene set enrichment calculation in +#' \code{\link{escape.matrix}} or \code{\link{runEscape}}. +#' @param enrichment.data The enrichment results from \code{\link{escape.matrix}} +#' or \code{\link{runEscape}} (optional) +#' @param assay Name of the assay to normalize if using a single-cell object #' @param gene.sets The gene set library to use to extract -#' the individual gene set information from. +#' the individual gene set information from #' @param scale.factor A vector to use for normalizing enrichment scores per cell. #' @param make.positive Shift enrichment values to a positive range \strong{TRUE} #' for downstream analysis or not \strong{TRUE} (default). #' +#' @importFrom stringr str_replace_all +#' @importFrom SeuratObject Assays +#' @importFrom SummarizedExperiment assays +#' #' @examples #' GS <- list(Bcells = c("MS4A1", "CD79B", "CD79A", "IGH1", "IGH2"), #' Tcells = c("CD3E", "CD3D", "CD3G", "CD7","CD8A")) @@ -32,20 +38,30 @@ #' #' @return Single-cell object or matrix of normalized enrichment scores -performNormalization <- function(input.data, - assay = NULL, +performNormalization <- function(sc.data, + enrichment.data = NULL, + assay = "escape", gene.sets = NULL, make.positive = FALSE, scale.factor = NULL) { + if(!is.null(assay)) { + if(is_seurat_object(sc.data)) { + assay.present <- assay %in% Assays(sc.data) + } else if (is_se_object(sc.data)) { + assay.present <- assay %in% assays(sc.data) + } + } else { + assay.present <- FALSE + } - if(is_seurat_or_se_object(input.data)) { - enriched <- .pull.Enrich(input.data, assay) + if(is_seurat_or_se_object(sc.data) & !is.null(assay) & assay.present) { + enriched <- .pull.Enrich(sc.data, assay) } else { - enriched <- input.data + enriched <- enrichment.data } - if(!is.null(scale.factor) & length(scale.factor) != dim(input.data)[2]) { + if(!is.null(scale.factor) & length(scale.factor) != dim(sc.data)[2]) { stop("If using a vector as a scale factor, please ensure the length matches the number of cells.") } @@ -55,7 +71,7 @@ performNormalization <- function(input.data, egc <- egc[names(egc) %in% colnames(enriched)] #Isolating the number of genes per cell expressed - cnts <- .cntEval(input.data, assay = "RNA", type = "counts") + cnts <- .cntEval(sc.data, assay = "RNA", type = "counts") if(is.null(scale.factor)) { print("Calculating features per cell...") @@ -98,9 +114,12 @@ performNormalization <- function(input.data, normalized.enriched <- do.call(cbind, normalized.values) colnames(normalized.enriched) <- colnames(enriched) - if(is_seurat_or_se_object(input.data)) { - input.data <- .adding.Enrich(input.data, normalized.enriched, paste0(assay, "_normalized")) - return(input.data) + if(is_seurat_or_se_object(sc.data)) { + if(is.null(assay)) { + assay <- "escape" + } + sc.data <- .adding.Enrich(sc.data, normalized.enriched, paste0(assay, "_normalized")) + return(sc.data) } else { return(normalized.enriched) } diff --git a/R/runEscape.R b/R/runEscape.R index b71e4ce..a081e4e 100644 --- a/R/runEscape.R +++ b/R/runEscape.R @@ -100,14 +100,6 @@ escape.matrix <- function(input.data, aucMaxRank = ceiling(0.2 * nrow(split.data[[i]])), verbose = FALSE, ...)) - - # a <- t(assay(suppressWarnings( - # AUCell_run(exprMat = split.data[[i]], - # geneSets = egc, - # normAUC = TRUE, - # BPPARAM = BPPARAM, - # aucMaxRank = ceiling(0.2 * nrow(split.data[[i]])), - # ...)))) } scores[[i]] <- a @@ -117,7 +109,8 @@ escape.matrix <- function(input.data, #Normalize based on dropout if(normalize) { - output <- performNormalization(output, + output <- performNormalization(sc.data = input.data, + enrichment.data = output, assay = NULL, gene.sets = gene.sets, make.positive = make.positive) @@ -175,7 +168,8 @@ runEscape <- function(input.data, gene.sets = gene.sets, method = method, groups = groups, - min.size = min.size) + min.size = min.size, + BPPARAM = BPPARAM) input.data <- .adding.Enrich(input.data, enrichment, new.assay.name) return(input.data) diff --git a/man/performNormalization.Rd b/man/performNormalization.Rd index 97645fe..850ec8e 100644 --- a/man/performNormalization.Rd +++ b/man/performNormalization.Rd @@ -5,21 +5,25 @@ \title{Perform Normalization on Enrichment Data} \usage{ performNormalization( - input.data, - assay = NULL, + sc.data, + enrichment.data = NULL, + assay = "escape", gene.sets = NULL, make.positive = FALSE, scale.factor = NULL ) } \arguments{ -\item{input.data}{Enrichment output from \code{\link{escape.matrix}} or -\code{\link{runEscape}}.} +\item{sc.data}{Single-cell object or matrix used in the gene set enrichment calculation in +\code{\link{escape.matrix}} or \code{\link{runEscape}}.} -\item{assay}{Name of the assay to plot if data is a single-cell object.} +\item{enrichment.data}{The enrichment results from \code{\link{escape.matrix}} +or \code{\link{runEscape}} (optional)} + +\item{assay}{Name of the assay to normalize if using a single-cell object} \item{gene.sets}{The gene set library to use to extract -the individual gene set information from.} +the individual gene set information from} \item{make.positive}{Shift enrichment values to a positive range \strong{TRUE} for downstream analysis or not \strong{TRUE} (default).} diff --git a/vignettes/vignette.Rmd b/vignettes/vignette.Rmd index 0a17a92..ab93c54 100644 --- a/vignettes/vignette.Rmd +++ b/vignettes/vignette.Rmd @@ -212,7 +212,7 @@ There can be inherent bias in enrichment values due to drop out in single-cell e ```{r} -pbmc_small <- performNormalization(pbmc_small, +pbmc_small <- performNormalization(sc.data = pbmc_small, assay = "escape.ssGSEA", gene.sets = GS.hallmark) ``` @@ -220,7 +220,7 @@ pbmc_small <- performNormalization(pbmc_small, An alternative for scaling by expressed gene sets would be to use a scaling factor previously calculated during normal single-cell data processing and quality control. This can be done using the **scale.factor** argument and providing a vector. ```{r} -pbmc_small <- performNormalization(pbmc_small, +pbmc_small <- performNormalization(sc.data = pbmc_small, assay = "escape.ssGSEA", gene.sets = GS.hallmark, scale.factor = pbmc_small$nFeature_RNA) From 600bee8af5a2694c196263fc17535d3afc18d18d Mon Sep 17 00:00:00 2001 From: theHumanBorch Date: Fri, 2 Aug 2024 07:54:54 -0500 Subject: [PATCH 18/28] pushing updated testthat --- R/utils.R | 2 +- .../denistyenrichment-default-plot.svg | 24 +- .../denistyenrichment-group-by-plot.svg | 20 +- .../ridgeenrichment-default-plot.svg | 24 +- .../ridgeenrichment-facet-plot.svg | 20 +- .../ridgeenrichment-gradient-facet-plot.svg | 4296 ++++++++--------- .../ridgeenrichment-gradient-plot.svg | 2838 +++++------ .../ridgeenrichment-gradient-reorder-plot.svg | 2628 +++++----- .../ridgeenrichment-order-plot.svg | 16 +- .../ridgeenrichment-rugadded-plot.svg | 190 +- .../splitenrichment-default-plot.svg | 12 +- .../splitenrichment-facet-plot.svg | 12 +- .../splitenrichment-mean-plot.svg | 12 +- .../runEscape/escape.matrix_UCell.rds | Bin 1586 -> 1529 bytes 14 files changed, 5047 insertions(+), 5047 deletions(-) diff --git a/R/utils.R b/R/utils.R index 3037c11..c57496b 100644 --- a/R/utils.R +++ b/R/utils.R @@ -183,7 +183,7 @@ is_seurat_or_se_object <- function(obj) { new.assay <- suppressWarnings(CreateAssayObject( data = as.matrix(t(enrichment)))) - sc[[enrichment.name]] <- new.assay + suppressWarnings(sc[[enrichment.name]] <- new.assay) } else if (inherits(sc, "SingleCellExperiment")) { altExp(sc, enrichment.name) <- SummarizedExperiment(assays = t(enrichment)) names(assays(altExp(sc, enrichment.name))) <- enrichment.name diff --git a/tests/testthat/_snaps/densityEnrichment/denistyenrichment-default-plot.svg b/tests/testthat/_snaps/densityEnrichment/denistyenrichment-default-plot.svg index 48d5007..e45a31f 100644 --- a/tests/testthat/_snaps/densityEnrichment/denistyenrichment-default-plot.svg +++ b/tests/testthat/_snaps/densityEnrichment/denistyenrichment-default-plot.svg @@ -46,23 +46,23 @@ - - - - - - + + + + + + 0.000 -0.003 -0.006 -0.009 +0.003 +0.006 +0.009 - - - + + + Rank Density diff --git a/tests/testthat/_snaps/densityEnrichment/denistyenrichment-group-by-plot.svg b/tests/testthat/_snaps/densityEnrichment/denistyenrichment-group-by-plot.svg index 7748699..27f7638 100644 --- a/tests/testthat/_snaps/densityEnrichment/denistyenrichment-group-by-plot.svg +++ b/tests/testthat/_snaps/densityEnrichment/denistyenrichment-group-by-plot.svg @@ -46,21 +46,21 @@ - - - - + + + + 0.0 -0.1 -0.2 -0.3 +0.1 +0.2 +0.3 - - - + + + Rank Density diff --git a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-default-plot.svg b/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-default-plot.svg index 041c007..5cf8122 100644 --- a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-default-plot.svg +++ b/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-default-plot.svg @@ -27,21 +27,21 @@ - - - - - - + + + + + + -0 -1 -2 - - - +0 +1 +2 + + + diff --git a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-facet-plot.svg b/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-facet-plot.svg index daf1e9e..2103843 100644 --- a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-facet-plot.svg +++ b/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-facet-plot.svg @@ -27,12 +27,12 @@ - + - + - - + + @@ -43,12 +43,12 @@ - - - - - - + + + + + + diff --git a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-facet-plot.svg b/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-facet-plot.svg index 41ff30e..1486e18 100644 --- a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-facet-plot.svg +++ b/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-facet-plot.svg @@ -27,473 +27,473 @@ - - - + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - + + + - - + + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - + @@ -508,10 +508,10 @@ - - - - + + + + @@ -519,331 +519,331 @@ - - - - - + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + - - - - + + + + @@ -855,17 +855,17 @@ - - - - + + + + - - + + @@ -960,7 +960,7 @@ - + @@ -978,371 +978,371 @@ - - + + - - + + - - + + - - - + + + - - - - - - - + + + + + + + - - - - + + + + - - + + - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + @@ -1351,8 +1351,8 @@ - - + + @@ -1426,8 +1426,8 @@ - - + + @@ -1528,8 +1528,8 @@ - - + + @@ -1537,379 +1537,379 @@ - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1918,381 +1918,381 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - + + @@ -2378,8 +2378,8 @@ - - + + @@ -2442,8 +2442,8 @@ - - + + @@ -2452,16 +2452,16 @@ - - - - + + + + - - + + - - + + @@ -2470,310 +2470,310 @@ - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - - - - - - - - + + + + + + + + + + + @@ -2788,8 +2788,8 @@ - - + + @@ -2849,8 +2849,8 @@ - - + + diff --git a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-plot.svg b/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-plot.svg index 202c942..5de6dd7 100644 --- a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-plot.svg +++ b/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-plot.svg @@ -27,1428 +27,1428 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -0 -1 -2 - - - +0 +1 +2 + + + diff --git a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-reorder-plot.svg b/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-reorder-plot.svg index 23d2453..1930ebb 100644 --- a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-reorder-plot.svg +++ b/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-reorder-plot.svg @@ -27,694 +27,694 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - + + + + + + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -722,228 +722,228 @@ - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - + + + - - + + - - - - - + + + + + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + @@ -967,8 +967,8 @@ - - + + @@ -976,479 +976,479 @@ - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2 -0 +0 1 - + diff --git a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-order-plot.svg b/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-order-plot.svg index 0d1f762..041018a 100644 --- a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-order-plot.svg +++ b/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-order-plot.svg @@ -27,21 +27,21 @@ - - - - - - + + + + + + 2 -0 +0 1 - + diff --git a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-rugadded-plot.svg b/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-rugadded-plot.svg index 0ea7fee..0558a09 100644 --- a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-rugadded-plot.svg +++ b/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-rugadded-plot.svg @@ -27,104 +27,104 @@ - - - -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| - - - -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| - - - -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| + + + +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| + + + +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| + + + +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| +| -0 -1 -2 - - - +0 +1 +2 + + + diff --git a/tests/testthat/_snaps/splitEnrichment/splitenrichment-default-plot.svg b/tests/testthat/_snaps/splitEnrichment/splitenrichment-default-plot.svg index b4882eb..1a134fd 100644 --- a/tests/testthat/_snaps/splitEnrichment/splitenrichment-default-plot.svg +++ b/tests/testthat/_snaps/splitEnrichment/splitenrichment-default-plot.svg @@ -27,12 +27,12 @@ - - - - - - + + + + + + diff --git a/tests/testthat/_snaps/splitEnrichment/splitenrichment-facet-plot.svg b/tests/testthat/_snaps/splitEnrichment/splitenrichment-facet-plot.svg index 5e7c559..88dfef8 100644 --- a/tests/testthat/_snaps/splitEnrichment/splitenrichment-facet-plot.svg +++ b/tests/testthat/_snaps/splitEnrichment/splitenrichment-facet-plot.svg @@ -27,10 +27,10 @@ - - - - + + + + @@ -57,8 +57,8 @@ - - + + diff --git a/tests/testthat/_snaps/splitEnrichment/splitenrichment-mean-plot.svg b/tests/testthat/_snaps/splitEnrichment/splitenrichment-mean-plot.svg index 1793e03..e28401c 100644 --- a/tests/testthat/_snaps/splitEnrichment/splitenrichment-mean-plot.svg +++ b/tests/testthat/_snaps/splitEnrichment/splitenrichment-mean-plot.svg @@ -27,12 +27,12 @@ - - - - - - + + + + + + diff --git a/tests/testthat/testdata/runEscape/escape.matrix_UCell.rds b/tests/testthat/testdata/runEscape/escape.matrix_UCell.rds index a752a2a0e9cb406e9ed5b4cd9baf1b588a420a6f..4d3ca05a22e1ea3215f135cfa952b47852b3f555 100644 GIT binary patch literal 1529 zcmVuglj-ZB~y@R zTiWsp<&lCs@&=li~M_x09>VKg^99{k?|Z;ci?*6@B=hLO@1AIcyc%KzhwBTe9M z)4j0oJDb2iX7Y-L2eyE3*{;lE^WOtsY|YqnLpFl{Bf3flJSE3>&nQ#R zkt;FBNpg1EsK#4G+RUmf*9>{!F9jaQ$7*w4)$t)5Z|-q|qN+L{O9mAnxA3n{P- zf@v+r9qiu)0&_=Q`Tm7+s4c&F;p3{M5biT_FSZ8W1KB;dr%!^wjLcDsDi=WA&Q%#V zW(B~H-MxEiGlaR^RH!|*`P!{6%T%9!EOzt4Cs4!X=7F#M+0;EdS1UdoT(!SHeH$rL z>jO`4A_S|JBBGQ2ClEYyrbY1s6KMM{ga=43c;g~lrDe22Lyk5>G{fLW5LVxXRAKzhF$JA^X-8uUfq%bL(Lv;9BL5! z;sJBuBC3u%DBM-g(bXTSx8@$Myfi}956)%56rKQmjob$zR3rEB2?#R${Se&CMuGqn z@U`kYL^PHBsPdg>2XAzoIdII`#c;K>&4-h3)IqFYaQWXEX%O4t9Xd8wLhSRRc1s@4 zgUgl8avDdaLiE=`O%)x!f#{;wmaLzU5AjK*$XFRfz8eruKLZfNW_D%%0Cj6qb_Yt+ zAi(WaKxh{W?(*#Dl)xSSD^hS|{b|K>gyr!-XdfF}`A_-dKm6y+k<+KQH#-Hw8EJ@o z12p8ng%hy`>R;YOPKS$$y5YrNPV?pUfynd`ybN=S(%b37>Cd}qKO%DT{_Ve-X?&@;zk@L5-#&4l|Eei{ z;&3>BjRm{Ue>K#0_d=-YMuR*RqVt|XYiIs%|3zq88`?Q|4a1Xy$5S)IW3-}!vT$ZG zex>7w!rAtBQc6oqnUh~!RD$;%6M5}8*M8qtSkg3w6vC9kw4A7kVT@Z6-wG9_ER5kh zx^bcwEtD9wOv@CiuC%DENd?@f#mg~ZVr9#%AT5Ef1eO(2?S}UzEwHGvivd#wSJ03N zL1~hfCt;u`4AW+&8x`CF!Idg134@^hC|l=&y1?DALxq<%Hz^rOQ&AiLeVk!baxM|1 zDsan02Es74-ArN!x00s58^v);0_ax2y@XxB?E+WRVw*_eGD!$X3|ggfxqpfyLYGM{ zOs2pa*AKXtttD;evQ9lQ1mQ*r77;_QG?&wR7%Vg4HBAdz&Q2xiwT^95v-w;md5#&Mkh;$Z29vHSPxcbF5?WoEa07YOokD4` zqbw^4uVlKV&8S-e%kcydWbJ&AHtSO30n>PndAy|NUm+92p?MMu*zQfrrE`nx5*3<% zdE8hHjUCdB5L0#SgrOH?HEd6xc^)=8Jai@n3&#hKhBx7Bp|Q?x;KNTOX<;!D$()hH z`Q#+0xE-4|TH6$QZx(A|Y8^Xs!9(cgau=kXDU(hD`;;|_2(7Mt*3t%=^0uqVulo7G z!y;{GyVJr4mp$^Xe_2KPBsq!|W{qVM4}9A5pR1;%!L$o&T}W=hvVUQ;xsdF2T4E-C f=TZ`HQ->B5&7NK2JX!XWVKn^%mah`*atr_fo|o@= literal 1586 zcmV-22F>{&iwFP!000001Ep1aP*i0UUlBDaNi&lOidqve)rq_ zqdyu4x%b@jo$q&kzu!5eMA&S$wzlxL_4G z*`Fkzc_$HS&(>`z|I7|GtrriUx-|f5r;gimT5k_^QGKre_TxBk9P9d1{k4ry_u*Dw zWv9OK-M#pcX-#vZ!P|0Z{?nfx1z(@UPG25B1per;3tl{T1N&4*6XX3%hG^K%q+bx%UJ99hi^)4SG^Mmg}yxs+cNfB?hK+{h9 z-a#j0z?ay(`O1m{@S$3xGGoDa?8fPc(sa1kkg>aINDX+K6J}%#nF`(wNtaW4c)*|e z^K)|=GQoX$)z~W~P2imA>e!fe8|rUuOG)mP501!TAE8E2Pw20_A$gWM1#r9j4ZKvI zyhifu{(uiceOyu6i0nJke^S5y@LzC_f_+x)>;BNLFN(pnoB(^EF*~aA!1Zz9nN_iV zSNs5IDC>+jE&*4gYu@Cg6TqEcbpGt7N#J37-2_+qn2C4ue}@YJUF%8Z-kZRaoAvyi z>+#?zDU2x_b`&l%o{7?bO&&_4_ejkUx~>UL(}kuR!KjX5j2i;KYBEY$ z7{hP$5R4jhP+-*14PBFUg+XO?DquwoK8^t$D;rh?VQBbC!?K!?x8bu+2MnrgVZc<4 zD=5e`jnV`i55Yih7^cf~E2?n|1XswYAPgGaN7*V5)CJy#9ZI}(xlYMQnv9zG@8Jxi zf^&%=S%F(7G7yHY+@=#dc$LuA+bE7#5GPR`ZEY_(fhM-wdfR&+xs0X4gB@iUA$SGTElftO3RsROfFLXTL71!yg$GRIIp*;aihnf`7!JjgSip2|NG|Oy zu1i!X{^fCFH57J8H$qI+l?_85$ZFW0I`ceiv^-QMH5QH+kAgSgYfWLD-N4IF3(>-0 zB0@PMhx6tnr&t~9CR)=JYHtQ>p(`B+=YogO%H=LdJ6(iq0&~miM1)e;+_iLpqP*#9 z@~gTZcvyt#Y-?J0ahW4;`Il9spAbi}!mP0f;eoe3|FhH-G?->#r3=9=80KFXWiAAJ kosQ^%zjI-MukBx&I5{;nJ@{srZ#G-&KRbpA6mkpz0RDsuDgXcg From 77ffb9cdeaba4b78c8318e583e475271a9758eb0 Mon Sep 17 00:00:00 2001 From: Alexei Martsinkovskiy Date: Tue, 13 Aug 2024 14:00:51 -0700 Subject: [PATCH 19/28] Update performNormalization.R added parallelization to normalize function. This might be memory intensive, but still would offer a speed benefit over a strictly single threaded approach. Under the hood, bpvec splits the vector into the number of workers and then executes the function on them, before joining it back together. I tested it against the equivalent single thread method and got an identical result. --- R/performNormalization.R | 44 ++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/R/performNormalization.R b/R/performNormalization.R index 0945d54..68750d7 100644 --- a/R/performNormalization.R +++ b/R/performNormalization.R @@ -17,10 +17,12 @@ #' @param scale.factor A vector to use for normalizing enrichment scores per cell. #' @param make.positive Shift enrichment values to a positive range \strong{TRUE} #' for downstream analysis or not \strong{TRUE} (default). -#' +#' @param BPPARAM A BiocParallel::bpparam() object that for parallelization. +#' #' @importFrom stringr str_replace_all #' @importFrom SeuratObject Assays #' @importFrom SummarizedExperiment assays +#' @importFrom BiocParallel SerialParam MulticoreParam BatchtoolsParam SerialParam #' #' @examples #' GS <- list(Bcells = c("MS4A1", "CD79B", "CD79A", "IGH1", "IGH2"), @@ -38,12 +40,17 @@ #' #' @return Single-cell object or matrix of normalized enrichment scores + + + + performNormalization <- function(sc.data, enrichment.data = NULL, assay = "escape", gene.sets = NULL, make.positive = FALSE, - scale.factor = NULL) { + scale.factor = NULL, + BPPARAM = SerialParam()) { if(!is.null(assay)) { if(is_seurat_object(sc.data)) { assay.present <- assay %in% Assays(sc.data) @@ -95,22 +102,23 @@ performNormalization <- function(sc.data, print("Normalizing enrichment scores per cell...") #Dividing the enrichment score by number of genes expressed - lapply(seq_len(ncol(enriched)), function(x) { - if (!is.null(scale.factor)) { - enriched[,x] <- enriched[,x]/scale.factor - } else { - gene.set <- unlist(egc.size[colnames(enriched)[x]]) - if(any(gene.set == 0)) { - gene.set[which(gene.set == 0)] <- 1 - } - enriched[,x] <- enriched[,x]/gene.set - } - if(any(enriched[,x] < 0) & make.positive) { - enriched[,x] <- enriched[,x] + abs(min(enriched[,x])) - } - enriched[,x] - }) -> normalized.values - + bpvec(seq_len(ncol(enriched)), FUN=function(x){lapply(x, function(x) { + if (!is.null(scale.factor)) { + enriched[, x] <- enriched[, x]/scale.factor + } + else { + gene.set <- unlist(egc.size[colnames(enriched)[x]]) + if (any(gene.set == 0)) { + gene.set[which(gene.set == 0)] <- 1 + } + enriched[, x] <- enriched[, x]/gene.set + } + if (any(enriched[, x] < 0) & make.positive) { + enriched[, x] <- enriched[, x] + abs(min(enriched[, + x])) + } + enriched[, x] + })}, BPPARAM=BPPARAM) -> normalized.values normalized.enriched <- do.call(cbind, normalized.values) colnames(normalized.enriched) <- colnames(enriched) From 685a12c64a77fc7cd09e2fc62f94b675e1c98300 Mon Sep 17 00:00:00 2001 From: Alexei Martsinkovskiy Date: Tue, 13 Aug 2024 16:09:12 -0700 Subject: [PATCH 20/28] Update performNormalization.R improved efficiency in the case of a provided scale factor, fixed for cases where scale factor is not provided --- R/performNormalization.R | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/R/performNormalization.R b/R/performNormalization.R index 68750d7..93cf6ed 100644 --- a/R/performNormalization.R +++ b/R/performNormalization.R @@ -102,22 +102,22 @@ performNormalization <- function(sc.data, print("Normalizing enrichment scores per cell...") #Dividing the enrichment score by number of genes expressed - bpvec(seq_len(ncol(enriched)), FUN=function(x){lapply(x, function(x) { + enriched <- asplit(enriched, 2) #split into list of columns so we don't use too much memory in bpvec + bpvec(seq_along(enriched), FUN=function(x){lapply(x, function(x) { if (!is.null(scale.factor)) { - enriched[, x] <- enriched[, x]/scale.factor + enriched[[x]] <- enriched[[x]]/scale.factor } else { - gene.set <- unlist(egc.size[colnames(enriched)[x]]) + gene.set <- unlist(egc.size[names(enriched)[[x]]]) if (any(gene.set == 0)) { gene.set[which(gene.set == 0)] <- 1 } - enriched[, x] <- enriched[, x]/gene.set + enriched[[x]] <- enriched[[x]]/gene.set } - if (any(enriched[, x] < 0) & make.positive) { - enriched[, x] <- enriched[, x] + abs(min(enriched[, - x])) + if (any(enriched[[x]] < 0) & make.positive) { + enriched[[x]] <- enriched[[x]] + abs(min(enriched[[x]])) } - enriched[, x] + enriched[[x]] })}, BPPARAM=BPPARAM) -> normalized.values normalized.enriched <- do.call(cbind, normalized.values) colnames(normalized.enriched) <- colnames(enriched) From 41d079897b7d9e34f199789d22efaefe355b8a2d Mon Sep 17 00:00:00 2001 From: theHumanBorch Date: Wed, 14 Aug 2024 09:06:31 -0500 Subject: [PATCH 21/28] Update performNormalization.R Adding bpvec to importfrom --- R/performNormalization.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/performNormalization.R b/R/performNormalization.R index 93cf6ed..54cad8d 100644 --- a/R/performNormalization.R +++ b/R/performNormalization.R @@ -22,7 +22,7 @@ #' @importFrom stringr str_replace_all #' @importFrom SeuratObject Assays #' @importFrom SummarizedExperiment assays -#' @importFrom BiocParallel SerialParam MulticoreParam BatchtoolsParam SerialParam +#' @importFrom BiocParallel SerialParam MulticoreParam BatchtoolsParam SerialParam bpvec #' #' @examples #' GS <- list(Bcells = c("MS4A1", "CD79B", "CD79A", "IGH1", "IGH2"), From 26e935ced2fe121b2a7ebee812812269af11edac Mon Sep 17 00:00:00 2001 From: Alexei Martsinkovskiy Date: Thu, 15 Aug 2024 16:13:34 -0700 Subject: [PATCH 22/28] Update performNormalization.R significantly speed up calculating scale factors --- R/performNormalization.R | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/R/performNormalization.R b/R/performNormalization.R index 54cad8d..ad1373e 100644 --- a/R/performNormalization.R +++ b/R/performNormalization.R @@ -80,23 +80,10 @@ performNormalization <- function(sc.data, #Isolating the number of genes per cell expressed cnts <- .cntEval(sc.data, assay = "RNA", type = "counts") - if(is.null(scale.factor)) { + if (is.null(scale.factor)) { print("Calculating features per cell...") - - # Pre-compute which genes are non-zero in each sample - non_zero_indices <- lapply(seq_len(ncol(cnts)), function(y) { - which(cnts[, y] != 0) - }) - - # Convert gene sets to a list of indices - egc_indices <- lapply(egc, function(x) { - which(rownames(cnts) %in% x) - }) - - egc.size <- lapply(egc_indices, function(gene_set_indices) { - sapply(non_zero_indices, function(sample_indices) { - length(intersect(sample_indices, gene_set_indices)) - }) + egc.sizes <- lapply(egc, function(x){ + unname(colSums(cnts[which(rownames(cnts) %in% x),]!=0)) }) } From c4d3996471e4927f720c05099825b6f03da077a0 Mon Sep 17 00:00:00 2001 From: Alexei Martsinkovskiy Date: Fri, 16 Aug 2024 17:16:20 -0700 Subject: [PATCH 23/28] rewrote normalize to be vectorized. --- R/performNormalization.R | 75 +- R/utils.R | 21 + escape.Rproj | 17 + .../denistyenrichment-default-plot.svg | 137 - .../denistyenrichment-group-by-plot.svg | 127 - .../geyserenrichment-default-plot.svg | 166 - .../geyserenrichment-facet-plot.svg | 229 -- .../geyserenrichment-gradient-facet-plot.svg | 236 -- .../geyserenrichment-gradient-plot.svg | 173 - ...geyserenrichment-gradient-reorder-plot.svg | 173 - .../geyserenrichment-order-plot.svg | 166 - .../geyserenrichment-scale-plot.svg | 168 - .../heatmapenrichment-clustercolumns-plot.svg | 71 - .../heatmapenrichment-clusterrows-plot.svg | 71 - .../heatmapenrichment-default-plot.svg | 71 - .../heatmapenrichment-facet-plot.svg | 113 - .../heatmapenrichment-scale-plot.svg | 71 - .../pcaenrichment-addfactors-plot.svg | 209 -- .../pcaenrichment-facetby-addfactors-plot.svg | 247 -- .../pcaenrichment-facetby-plot.svg | 205 -- .../pcaEnrichment/pcaenrichment-hex-plot.svg | 157 - .../pcaEnrichment/pcaenrichment-plot.svg | 157 - .../ridgeenrichment-default-plot.svg | 57 - .../ridgeenrichment-facet-plot.svg | 106 - .../ridgeenrichment-gradient-facet-plot.svg | 2908 ----------------- .../ridgeenrichment-gradient-plot.svg | 1464 --------- .../ridgeenrichment-gradient-reorder-plot.svg | 1464 --------- .../ridgeenrichment-order-plot.svg | 57 - .../ridgeenrichment-rugadded-plot.svg | 140 - .../scatterenrichment-default-plot.svg | 150 - .../scatterenrichment-facet-plot.svg | 189 -- .../scatterenrichment-hex-plot.svg | 140 - .../scatterenrichment-scale-plot.svg | 150 - .../splitenrichment-default-plot.svg | 84 - .../splitenrichment-facet-plot.svg | 134 - .../splitenrichment-mean-plot.svg | 84 - tests/testthat/test-performNormalization.R | 12 +- 37 files changed, 89 insertions(+), 10110 deletions(-) create mode 100644 escape.Rproj delete mode 100644 tests/testthat/_snaps/densityEnrichment/denistyenrichment-default-plot.svg delete mode 100644 tests/testthat/_snaps/densityEnrichment/denistyenrichment-group-by-plot.svg delete mode 100644 tests/testthat/_snaps/geyserEnrichment/geyserenrichment-default-plot.svg delete mode 100644 tests/testthat/_snaps/geyserEnrichment/geyserenrichment-facet-plot.svg delete mode 100644 tests/testthat/_snaps/geyserEnrichment/geyserenrichment-gradient-facet-plot.svg delete mode 100644 tests/testthat/_snaps/geyserEnrichment/geyserenrichment-gradient-plot.svg delete mode 100644 tests/testthat/_snaps/geyserEnrichment/geyserenrichment-gradient-reorder-plot.svg delete mode 100644 tests/testthat/_snaps/geyserEnrichment/geyserenrichment-order-plot.svg delete mode 100644 tests/testthat/_snaps/geyserEnrichment/geyserenrichment-scale-plot.svg delete mode 100644 tests/testthat/_snaps/heatmapEnrichment/heatmapenrichment-clustercolumns-plot.svg delete mode 100644 tests/testthat/_snaps/heatmapEnrichment/heatmapenrichment-clusterrows-plot.svg delete mode 100644 tests/testthat/_snaps/heatmapEnrichment/heatmapenrichment-default-plot.svg delete mode 100644 tests/testthat/_snaps/heatmapEnrichment/heatmapenrichment-facet-plot.svg delete mode 100644 tests/testthat/_snaps/heatmapEnrichment/heatmapenrichment-scale-plot.svg delete mode 100644 tests/testthat/_snaps/pcaEnrichment/pcaenrichment-addfactors-plot.svg delete mode 100644 tests/testthat/_snaps/pcaEnrichment/pcaenrichment-facetby-addfactors-plot.svg delete mode 100644 tests/testthat/_snaps/pcaEnrichment/pcaenrichment-facetby-plot.svg delete mode 100644 tests/testthat/_snaps/pcaEnrichment/pcaenrichment-hex-plot.svg delete mode 100644 tests/testthat/_snaps/pcaEnrichment/pcaenrichment-plot.svg delete mode 100644 tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-default-plot.svg delete mode 100644 tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-facet-plot.svg delete mode 100644 tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-facet-plot.svg delete mode 100644 tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-plot.svg delete mode 100644 tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-reorder-plot.svg delete mode 100644 tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-order-plot.svg delete mode 100644 tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-rugadded-plot.svg delete mode 100644 tests/testthat/_snaps/scatterEnrichment/scatterenrichment-default-plot.svg delete mode 100644 tests/testthat/_snaps/scatterEnrichment/scatterenrichment-facet-plot.svg delete mode 100644 tests/testthat/_snaps/scatterEnrichment/scatterenrichment-hex-plot.svg delete mode 100644 tests/testthat/_snaps/scatterEnrichment/scatterenrichment-scale-plot.svg delete mode 100644 tests/testthat/_snaps/splitEnrichment/splitenrichment-default-plot.svg delete mode 100644 tests/testthat/_snaps/splitEnrichment/splitenrichment-facet-plot.svg delete mode 100644 tests/testthat/_snaps/splitEnrichment/splitenrichment-mean-plot.svg diff --git a/R/performNormalization.R b/R/performNormalization.R index ad1373e..59948a0 100644 --- a/R/performNormalization.R +++ b/R/performNormalization.R @@ -18,12 +18,11 @@ #' @param make.positive Shift enrichment values to a positive range \strong{TRUE} #' for downstream analysis or not \strong{TRUE} (default). #' @param BPPARAM A BiocParallel::bpparam() object that for parallelization. -#' +#' @importFrom UCell split_data.matrix #' @importFrom stringr str_replace_all #' @importFrom SeuratObject Assays #' @importFrom SummarizedExperiment assays -#' @importFrom BiocParallel SerialParam MulticoreParam BatchtoolsParam SerialParam bpvec -#' + #' @examples #' GS <- list(Bcells = c("MS4A1", "CD79B", "CD79A", "IGH1", "IGH2"), #' Tcells = c("CD3E", "CD3D", "CD3G", "CD7","CD8A")) @@ -45,12 +44,12 @@ performNormalization <- function(sc.data, - enrichment.data = NULL, - assay = "escape", - gene.sets = NULL, - make.positive = FALSE, - scale.factor = NULL, - BPPARAM = SerialParam()) { + enrichment.data = NULL, + assay = "escape", + gene.sets = NULL, + make.positive = FALSE, + scale.factor = NULL, + groups = NULL) { if(!is.null(assay)) { if(is_seurat_object(sc.data)) { assay.present <- assay %in% Assays(sc.data) @@ -78,45 +77,51 @@ performNormalization <- function(sc.data, egc <- egc[names(egc) %in% colnames(enriched)] #Isolating the number of genes per cell expressed - cnts <- .cntEval(sc.data, assay = "RNA", type = "counts") + if(is.null(groups)){ + chunks <- dim(enriched)[[1]] + } + else{ + chunks <- groups + } if (is.null(scale.factor)) { + cnts <- .cntEval(sc.data, assay = "RNA", type = "counts") print("Calculating features per cell...") egc.sizes <- lapply(egc, function(x){ - unname(colSums(cnts[which(rownames(cnts) %in% x),]!=0)) + scales<-unname(Matrix::colSums(cnts[which(rownames(cnts) %in% x),]!=0)) + scales[scales==0] <- 1 + scales }) + egc.sizes <- split_rows(do.call(cbind,egc.sizes), chunk.size=chunks) + rm(cnts) + } + else{ + egc.sizes <- split_rows(scale.factor, chunk.size=chunks) } + enriched <- split_rows(enriched, chunk.size=chunks) print("Normalizing enrichment scores per cell...") #Dividing the enrichment score by number of genes expressed - enriched <- asplit(enriched, 2) #split into list of columns so we don't use too much memory in bpvec - bpvec(seq_along(enriched), FUN=function(x){lapply(x, function(x) { - if (!is.null(scale.factor)) { - enriched[[x]] <- enriched[[x]]/scale.factor - } - else { - gene.set <- unlist(egc.size[names(enriched)[[x]]]) - if (any(gene.set == 0)) { - gene.set[which(gene.set == 0)] <- 1 - } - enriched[[x]] <- enriched[[x]]/gene.set - } - if (any(enriched[[x]] < 0) & make.positive) { - enriched[[x]] <- enriched[[x]] + abs(min(enriched[[x]])) - } - enriched[[x]] - })}, BPPARAM=BPPARAM) -> normalized.values - normalized.enriched <- do.call(cbind, normalized.values) - colnames(normalized.enriched) <- colnames(enriched) - + + enriched<-mapply(function(scores, scales){ + scores/scales + }, enriched, egc.sizes, SIMPLIFY = FALSE) + enriched <- do.call(rbind, enriched) + if(!is.null(groups)){ + + } + if(make.positive){ + enriched <- apply(enriched, 2, function(x){ + x+max(0, -min(x)) + }) + } if(is_seurat_or_se_object(sc.data)) { if(is.null(assay)) { assay <- "escape" } - sc.data <- .adding.Enrich(sc.data, normalized.enriched, paste0(assay, "_normalized")) + sc.data <- .adding.Enrich(sc.data, enriched, paste0(assay, "_normalized")) return(sc.data) } else { - return(normalized.enriched) + return(enriched) } - -} +} \ No newline at end of file diff --git a/R/utils.R b/R/utils.R index c57496b..d6a57e1 100644 --- a/R/utils.R +++ b/R/utils.R @@ -253,5 +253,26 @@ is_seurat_or_se_object <- function(obj) { } return(values) } +#function to split matrices by row +#adopted from ucells split_data.matrix +split_rows <- function (matrix, chunk.size = 1000) +{ + nrows <- dim(matrix)[1] + nchunks <- (nrows - 1)%/%chunk.size + 1 + split.data <- list() + min <- 1 + for (i in seq_len(nchunks)) { + if (i == nchunks - 1) { + left <- nrows - (i - 1) * chunk.size + max <- min + round(left/2) - 1 + } + else { + max <- min(i * chunk.size, nrows) + } + split.data[[i]] <- matrix[min:max,] + min <- max + 1 + } + return(split.data) +} diff --git a/escape.Rproj b/escape.Rproj new file mode 100644 index 0000000..21a4da0 --- /dev/null +++ b/escape.Rproj @@ -0,0 +1,17 @@ +Version: 1.0 + +RestoreWorkspace: Default +SaveWorkspace: Default +AlwaysSaveHistory: Default + +EnableCodeIndexing: Yes +UseSpacesForTab: Yes +NumSpacesForTab: 2 +Encoding: UTF-8 + +RnwWeave: Sweave +LaTeX: pdfLaTeX + +BuildType: Package +PackageUseDevtools: Yes +PackageInstallArgs: --no-multiarch --with-keep.source diff --git a/tests/testthat/_snaps/densityEnrichment/denistyenrichment-default-plot.svg b/tests/testthat/_snaps/densityEnrichment/denistyenrichment-default-plot.svg deleted file mode 100644 index e45a31f..0000000 --- a/tests/testthat/_snaps/densityEnrichment/denistyenrichment-default-plot.svg +++ /dev/null @@ -1,137 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -0.000 -0.003 -0.006 -0.009 - - - - - -Rank Density - -Group - - - - - - -ident.0 -ident.2 -ident.1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -0 -30 -60 -90 -Mean Rank Order -denistyEnrichment_default_plot - - diff --git a/tests/testthat/_snaps/densityEnrichment/denistyenrichment-group-by-plot.svg b/tests/testthat/_snaps/densityEnrichment/denistyenrichment-group-by-plot.svg deleted file mode 100644 index 27f7638..0000000 --- a/tests/testthat/_snaps/densityEnrichment/denistyenrichment-group-by-plot.svg +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -0.0 -0.1 -0.2 -0.3 - - - - - -Rank Density - -Group - - - - -groups.g2 -groups.g1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -89 -90 -91 -92 -Mean Rank Order -denistyEnrichment_group.by_plot - - diff --git a/tests/testthat/_snaps/geyserEnrichment/geyserenrichment-default-plot.svg b/tests/testthat/_snaps/geyserEnrichment/geyserenrichment-default-plot.svg deleted file mode 100644 index 76935d0..0000000 --- a/tests/testthat/_snaps/geyserEnrichment/geyserenrichment-default-plot.svg +++ /dev/null @@ -1,166 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -0 -40 -80 - - - - - - - -0 -1 -2 -ident -Tcells - Enrichment Score - -ident - - - - - - -0 -1 -2 -geyserEnrichment_default_plot - - diff --git a/tests/testthat/_snaps/geyserEnrichment/geyserenrichment-facet-plot.svg b/tests/testthat/_snaps/geyserEnrichment/geyserenrichment-facet-plot.svg deleted file mode 100644 index 0219285..0000000 --- a/tests/testthat/_snaps/geyserEnrichment/geyserenrichment-facet-plot.svg +++ /dev/null @@ -1,229 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -g1 - - - - - - - - - - -g2 - - - - - - -0 -1 -2 - - - - -0 -1 -2 - -0 -40 -80 - - - -ident -Tcells - Enrichment Score - -ident - - - - - - -0 -1 -2 -geyserEnrichment_facet_plot - - diff --git a/tests/testthat/_snaps/geyserEnrichment/geyserenrichment-gradient-facet-plot.svg b/tests/testthat/_snaps/geyserEnrichment/geyserenrichment-gradient-facet-plot.svg deleted file mode 100644 index f12e023..0000000 --- a/tests/testthat/_snaps/geyserEnrichment/geyserenrichment-gradient-facet-plot.svg +++ /dev/null @@ -1,236 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -g1 - - - - - - - - - - -g2 - - - - - - -0 -1 -2 - - - - -0 -1 -2 - -0 -40 -80 - - - -ident -Tcells - Enrichment Score - -Tcells - - - - - - - - - - - -0 -25 -50 -75 -100 -geyserEnrichment_gradient_facet_plot - - diff --git a/tests/testthat/_snaps/geyserEnrichment/geyserenrichment-gradient-plot.svg b/tests/testthat/_snaps/geyserEnrichment/geyserenrichment-gradient-plot.svg deleted file mode 100644 index b511c62..0000000 --- a/tests/testthat/_snaps/geyserEnrichment/geyserenrichment-gradient-plot.svg +++ /dev/null @@ -1,173 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -0 -40 -80 - - - - - - - -0 -1 -2 -ident -Tcells - Enrichment Score - -Tcells - - - - - - - - - - - -0 -25 -50 -75 -100 -geyserEnrichment_gradient_plot - - diff --git a/tests/testthat/_snaps/geyserEnrichment/geyserenrichment-gradient-reorder-plot.svg b/tests/testthat/_snaps/geyserEnrichment/geyserenrichment-gradient-reorder-plot.svg deleted file mode 100644 index 22baf97..0000000 --- a/tests/testthat/_snaps/geyserEnrichment/geyserenrichment-gradient-reorder-plot.svg +++ /dev/null @@ -1,173 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -0 -40 -80 - - - - - - - -0 -2 -1 -ident -Tcells - Enrichment Score - -Tcells - - - - - - - - - - - -0 -25 -50 -75 -100 -geyserEnrichment_gradient_reorder_plot - - diff --git a/tests/testthat/_snaps/geyserEnrichment/geyserenrichment-order-plot.svg b/tests/testthat/_snaps/geyserEnrichment/geyserenrichment-order-plot.svg deleted file mode 100644 index a339b51..0000000 --- a/tests/testthat/_snaps/geyserEnrichment/geyserenrichment-order-plot.svg +++ /dev/null @@ -1,166 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -0 -40 -80 - - - - - - - -0 -2 -1 -ident -Tcells - Enrichment Score - -ident - - - - - - -0 -2 -1 -geyserEnrichment_order_plot - - diff --git a/tests/testthat/_snaps/geyserEnrichment/geyserenrichment-scale-plot.svg b/tests/testthat/_snaps/geyserEnrichment/geyserenrichment-scale-plot.svg deleted file mode 100644 index ed589e5..0000000 --- a/tests/testthat/_snaps/geyserEnrichment/geyserenrichment-scale-plot.svg +++ /dev/null @@ -1,168 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --1 -0 -1 -2 - - - - - - - - -0 -1 -2 -ident -Tcells - Enrichment Score - -ident - - - - - - -0 -1 -2 -geyserEnrichment_scale_plot - - diff --git a/tests/testthat/_snaps/heatmapEnrichment/heatmapenrichment-clustercolumns-plot.svg b/tests/testthat/_snaps/heatmapEnrichment/heatmapenrichment-clustercolumns-plot.svg deleted file mode 100644 index 506ee7f..0000000 --- a/tests/testthat/_snaps/heatmapEnrichment/heatmapenrichment-clustercolumns-plot.svg +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Bcells -Tcells - -1 -0 -2 - -Enrichment Score - - - - - - - - - -20 -40 -60 -80 -heatmapEnrichment_clusterColumns_plot - - diff --git a/tests/testthat/_snaps/heatmapEnrichment/heatmapenrichment-clusterrows-plot.svg b/tests/testthat/_snaps/heatmapEnrichment/heatmapenrichment-clusterrows-plot.svg deleted file mode 100644 index cf69ccd..0000000 --- a/tests/testthat/_snaps/heatmapEnrichment/heatmapenrichment-clusterrows-plot.svg +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Bcells -Tcells - -0 -1 -2 - -Enrichment Score - - - - - - - - - -20 -40 -60 -80 -heatmapEnrichment_clusterRows_plot - - diff --git a/tests/testthat/_snaps/heatmapEnrichment/heatmapenrichment-default-plot.svg b/tests/testthat/_snaps/heatmapEnrichment/heatmapenrichment-default-plot.svg deleted file mode 100644 index 9cf46b9..0000000 --- a/tests/testthat/_snaps/heatmapEnrichment/heatmapenrichment-default-plot.svg +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Bcells -Tcells - -0 -1 -2 - -Enrichment Score - - - - - - - - - -20 -40 -60 -80 -heatmapEnrichment_default_plot - - diff --git a/tests/testthat/_snaps/heatmapEnrichment/heatmapenrichment-facet-plot.svg b/tests/testthat/_snaps/heatmapEnrichment/heatmapenrichment-facet-plot.svg deleted file mode 100644 index d517ae6..0000000 --- a/tests/testthat/_snaps/heatmapEnrichment/heatmapenrichment-facet-plot.svg +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -g1 - - - - - - - - - - -g2 - - - -0 -1 -2 - -0 -1 -2 - -Bcells -Tcells - -Enrichment Score - - - - - - - - - -0 -25 -50 -75 -heatmapEnrichment_facet_plot - - diff --git a/tests/testthat/_snaps/heatmapEnrichment/heatmapenrichment-scale-plot.svg b/tests/testthat/_snaps/heatmapEnrichment/heatmapenrichment-scale-plot.svg deleted file mode 100644 index 88af95c..0000000 --- a/tests/testthat/_snaps/heatmapEnrichment/heatmapenrichment-scale-plot.svg +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Bcells -Tcells - -0 -1 -2 - -Enrichment Score - - - - - - - - - --1.0 --0.5 -0.0 -0.5 -heatmapEnrichment_scale_plot - - diff --git a/tests/testthat/_snaps/pcaEnrichment/pcaenrichment-addfactors-plot.svg b/tests/testthat/_snaps/pcaEnrichment/pcaenrichment-addfactors-plot.svg deleted file mode 100644 index 5ccc234..0000000 --- a/tests/testthat/_snaps/pcaEnrichment/pcaenrichment-addfactors-plot.svg +++ /dev/null @@ -1,209 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -HALLMARK-ALLOGRAFT-REJECTION - -HALLMARK-APOPTOSIS - -HALLMARK-ESTROGEN-RESPONSE-LATE - -HALLMARK-HEME-METABOLISM - -HALLMARK-IL2-STAT5-SIGNALING - -HALLMARK-INFLAMMATORY-RESPONSE - -HALLMARK-INTERFERON-GAMMA-RESPONSE - -HALLMARK-MTORC1-SIGNALING - -HALLMARK-P53-PATHWAY - -HALLMARK-TNFA-SIGNALING-VIA-NFKB - - - --3 --2 --1 -0 -1 -2 -3 - - - - - - - - - - - - - - --2 --1 -0 -1 -2 -3 -PC2 - (12.5%) -PC3 - (9.7%) - -Relative Density - - - - - - - - - - - - - -1 -2 -3 -4 -5 -6 -pcaEnrichment_addFactors_plot - - diff --git a/tests/testthat/_snaps/pcaEnrichment/pcaenrichment-facetby-addfactors-plot.svg b/tests/testthat/_snaps/pcaEnrichment/pcaenrichment-facetby-addfactors-plot.svg deleted file mode 100644 index 27fc43b..0000000 --- a/tests/testthat/_snaps/pcaEnrichment/pcaenrichment-facetby-addfactors-plot.svg +++ /dev/null @@ -1,247 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -HALLMARK-ALLOGRAFT-REJECTION - -HALLMARK-APOPTOSIS - -HALLMARK-COAGULATION - -HALLMARK-EPITHELIAL-MESENCHYMAL-TRANSITION - -HALLMARK-HEME-METABOLISM - -HALLMARK-IL2-STAT5-SIGNALING - -HALLMARK-IL6-JAK-STAT3-SIGNALING - -HALLMARK-INTERFERON-GAMMA-RESPONSE - -HALLMARK-MYOGENESIS - -HALLMARK-P53-PATHWAY - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -g1 - - - - - - - - - - -g2 - - - - - - - - --6 --4 --2 -0 -2 - - - - - - --6 --4 --2 -0 -2 - --2 --1 -0 -1 -2 -3 - - - - - - -PC1 - (35.5%) -PC2 - (12.5%) - -Relative Density - - - - - - - - - - - -1 -2 -3 -4 -5 -pcaEnrichment_facetby_addFactors_plot - - diff --git a/tests/testthat/_snaps/pcaEnrichment/pcaenrichment-facetby-plot.svg b/tests/testthat/_snaps/pcaEnrichment/pcaenrichment-facetby-plot.svg deleted file mode 100644 index 913154d..0000000 --- a/tests/testthat/_snaps/pcaEnrichment/pcaenrichment-facetby-plot.svg +++ /dev/null @@ -1,205 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -g1 - - - - - - - - - - -g2 - - - - - - - - - --2 --1 -0 -1 -2 -3 - - - - - - - --2 --1 -0 -1 -2 -3 - --6 --4 --2 -0 -2 - - - - - -PC2 - (12.5%) -PC1 - (35.5%) - -Relative Density - - - - - - - - - - - -1 -2 -3 -4 -5 -pcaEnrichment_facetby_plot - - diff --git a/tests/testthat/_snaps/pcaEnrichment/pcaenrichment-hex-plot.svg b/tests/testthat/_snaps/pcaEnrichment/pcaenrichment-hex-plot.svg deleted file mode 100644 index 51edd38..0000000 --- a/tests/testthat/_snaps/pcaEnrichment/pcaenrichment-hex-plot.svg +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --2 --1 -0 -1 -2 -3 - - - - - - - - - - - - --6 --4 --2 -0 -2 -PC1 - (35.5%) -PC2 - (12.5%) - -count - - - - - - - - - - - -1.00 -1.25 -1.50 -1.75 -2.00 -pcaEnrichment_hex_plot - - diff --git a/tests/testthat/_snaps/pcaEnrichment/pcaenrichment-plot.svg b/tests/testthat/_snaps/pcaEnrichment/pcaenrichment-plot.svg deleted file mode 100644 index 72dc283..0000000 --- a/tests/testthat/_snaps/pcaEnrichment/pcaenrichment-plot.svg +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --2 --1 -0 -1 -2 -3 - - - - - - - - - - - - --6 --4 --2 -0 -2 -PC1 - (35.5%) -PC2 - (12.5%) - -Relative Density - - - - - - - - - -2 -4 -6 -8 -pcaEnrichment_plot - - diff --git a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-default-plot.svg b/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-default-plot.svg deleted file mode 100644 index 5cf8122..0000000 --- a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-default-plot.svg +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -0 -1 -2 - - - - - - - -0 -50 -100 -Bcells - Enrichment Score -ident -ridgeEnrichment_default_plot - - diff --git a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-facet-plot.svg b/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-facet-plot.svg deleted file mode 100644 index 2103843..0000000 --- a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-facet-plot.svg +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -g1 - - - - - - - - - - -g2 - - - - - - - -0 -50 -100 -150 - - - - - -0 -50 -100 -150 - -0 -1 -2 - - - -Bcells - Enrichment Score -ident -ridgeEnrichment_facet_plot - - diff --git a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-facet-plot.svg b/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-facet-plot.svg deleted file mode 100644 index 1486e18..0000000 --- a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-facet-plot.svg +++ /dev/null @@ -1,2908 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -g1 - - - - - - - - - - -g2 - - - - - - - -0 -50 -100 -150 - - - - - -0 -50 -100 -150 - -0 -1 -2 - - - -Bcells - Enrichment Score -ident -ridgeEnrichment_gradient_facet_plot - - diff --git a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-plot.svg b/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-plot.svg deleted file mode 100644 index 5de6dd7..0000000 --- a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-plot.svg +++ /dev/null @@ -1,1464 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -0 -1 -2 - - - - - - - -0 -50 -100 -Bcells - Enrichment Score -ident -ridgeEnrichment_gradient_plot - - diff --git a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-reorder-plot.svg b/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-reorder-plot.svg deleted file mode 100644 index 1930ebb..0000000 --- a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-gradient-reorder-plot.svg +++ /dev/null @@ -1,1464 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -2 -0 -1 - - - - - - - -0 -50 -100 -Bcells - Enrichment Score -ident -ridgeEnrichment_gradient_reorder_plot - - diff --git a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-order-plot.svg b/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-order-plot.svg deleted file mode 100644 index 041018a..0000000 --- a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-order-plot.svg +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -2 -0 -1 - - - - - - - -0 -50 -100 -Bcells - Enrichment Score -ident -ridgeEnrichment_order_plot - - diff --git a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-rugadded-plot.svg b/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-rugadded-plot.svg deleted file mode 100644 index 0558a09..0000000 --- a/tests/testthat/_snaps/ridgeEnrichment/ridgeenrichment-rugadded-plot.svg +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| - - - -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| - - - -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| -| - - - -0 -1 -2 - - - - - - - -0 -50 -100 -Bcells - Enrichment Score -ident -ridgeEnrichment_rugadded_plot - - diff --git a/tests/testthat/_snaps/scatterEnrichment/scatterenrichment-default-plot.svg b/tests/testthat/_snaps/scatterEnrichment/scatterenrichment-default-plot.svg deleted file mode 100644 index 36546c4..0000000 --- a/tests/testthat/_snaps/scatterEnrichment/scatterenrichment-default-plot.svg +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -30 -60 -90 - - - - - - - -0 -40 -80 -Tcells - Enrichment Score -Bcells - Enrichment Score - -Relative Density - - - - - - - - - - - -1.0 -1.5 -2.0 -2.5 -3.0 -scatterEnrichment_default_plot - - diff --git a/tests/testthat/_snaps/scatterEnrichment/scatterenrichment-facet-plot.svg b/tests/testthat/_snaps/scatterEnrichment/scatterenrichment-facet-plot.svg deleted file mode 100644 index f09aac6..0000000 --- a/tests/testthat/_snaps/scatterEnrichment/scatterenrichment-facet-plot.svg +++ /dev/null @@ -1,189 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -g1 - - - - - - - - - - -g2 - - - - - - -0 -40 -80 - - - - -0 -40 -80 - -30 -60 -90 - - - -Tcells - Enrichment Score -Bcells - Enrichment Score - -Relative Density - - - - - - - - - - - -1.00 -1.25 -1.50 -1.75 -2.00 -scatterEnrichment_facet_plot - - diff --git a/tests/testthat/_snaps/scatterEnrichment/scatterenrichment-hex-plot.svg b/tests/testthat/_snaps/scatterEnrichment/scatterenrichment-hex-plot.svg deleted file mode 100644 index c0aad8b..0000000 --- a/tests/testthat/_snaps/scatterEnrichment/scatterenrichment-hex-plot.svg +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -20 -40 -60 -80 -100 - - - - - - - - - -0 -40 -80 -Tcells - Enrichment Score -Bcells - Enrichment Score - -count - - - - - - - - - - - -1.0 -1.5 -2.0 -2.5 -3.0 -scatterEnrichment_hex_plot - - diff --git a/tests/testthat/_snaps/scatterEnrichment/scatterenrichment-scale-plot.svg b/tests/testthat/_snaps/scatterEnrichment/scatterenrichment-scale-plot.svg deleted file mode 100644 index 36a3812..0000000 --- a/tests/testthat/_snaps/scatterEnrichment/scatterenrichment-scale-plot.svg +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --2 --1 -0 -1 -2 - - - - - - - - - - --1 -0 -1 -2 -Tcells - Enrichment Score -Bcells - Enrichment Score - -Relative Density - - - - - - - -2.5 -5.0 -7.5 -scatterEnrichment_scale_plot - - diff --git a/tests/testthat/_snaps/splitEnrichment/splitenrichment-default-plot.svg b/tests/testthat/_snaps/splitEnrichment/splitenrichment-default-plot.svg deleted file mode 100644 index 1a134fd..0000000 --- a/tests/testthat/_snaps/splitEnrichment/splitenrichment-default-plot.svg +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --1 -0 -1 -2 - - - - - - - - -0 -1 -2 -ident -Tcells - Enrichment Score - -groups - - - - -g1 -g2 -splitEnrichment_default_plot - - diff --git a/tests/testthat/_snaps/splitEnrichment/splitenrichment-facet-plot.svg b/tests/testthat/_snaps/splitEnrichment/splitenrichment-facet-plot.svg deleted file mode 100644 index 88dfef8..0000000 --- a/tests/testthat/_snaps/splitEnrichment/splitenrichment-facet-plot.svg +++ /dev/null @@ -1,134 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -A - - - - - - - - - - -B - - - - - - -0 -1 -2 - - - - -0 -1 -2 - --1 -0 -1 -2 - - - - -ident -Tcells - Enrichment Score - -groups - - - - -g1 -g2 -splitEnrichment_facet_plot - - diff --git a/tests/testthat/_snaps/splitEnrichment/splitenrichment-mean-plot.svg b/tests/testthat/_snaps/splitEnrichment/splitenrichment-mean-plot.svg deleted file mode 100644 index e28401c..0000000 --- a/tests/testthat/_snaps/splitEnrichment/splitenrichment-mean-plot.svg +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --1 -0 -1 -2 - - - - - - - - -0 -2 -1 -ident -Tcells - Enrichment Score - -groups - - - - -g1 -g2 -splitEnrichment_mean_plot - - diff --git a/tests/testthat/test-performNormalization.R b/tests/testthat/test-performNormalization.R index dbb0075..68f69d2 100644 --- a/tests/testthat/test-performNormalization.R +++ b/tests/testthat/test-performNormalization.R @@ -10,16 +10,26 @@ test_that("performNormalization works", { assay = "escape.ssGSEA", gene.sets = GS.hallmark, make.positive = TRUE) + seuratObj.pg <- performNormalization(seuratObj, + assay = "escape.ssGSEA", + gene.sets = GS.hallmark, + make.positive = TRUE, groups=20) expect_equal(seuratObj.p@assays$escape.ssGSEA, - getdata("performNormalization", "performNormalization_positve")) + seuratObj.pg@assays$escape.ssGSEA) seuratObj.n <- performNormalization(seuratObj, assay = "escape.ssGSEA", gene.sets = GS.hallmark, make.positive = FALSE) + seuratObj.ng <- performNormalization(seuratObj, + assay = "escape.ssGSEA", + gene.sets = GS.hallmark, + make.positive = FALSE, groups=20) expect_equal(seuratObj.n@assays$escape.ssGSEA, getdata("performNormalization", "performNormalization_nonpositive")) + expect_equal(seuratObj.n@assays$escape.ssGSEA, + seuratObj.ng@assays$escape.ssGSEA) }) From 1245b1d51fac235e62185fe40f91a4d6556f85db Mon Sep 17 00:00:00 2001 From: Alexei Martsinkovskiy Date: Fri, 16 Aug 2024 17:25:43 -0700 Subject: [PATCH 24/28] added contributor name --- DESCRIPTION | 4 +++- R/performNormalization.R | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index e285b87..2b48e1d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -4,7 +4,9 @@ Version: 2.0.1 Date: 2024-07-26 Authors@R: c( person(given = "Nick", family = "Borcherding", role = c("aut", "cre"), email = "ncborch@gmail.com"), - person(given = "Jared", family = "Andrews", role = c("aut"), email = "jared.andrews07@gmail.com")) + person(given = "Jared", family = "Andrews", role = c("aut"), email = "jared.andrews07@gmail.com") + person(given = "Alexei", family = "Martsinkovskiy", role = c("ctb"), email = "alexei.martsinkovskiy@gmail.com") + ) Description: A bridging R package to facilitate gene set enrichment analysis (GSEA) in the context of single-cell RNA sequencing. Using raw count information, Seurat objects, or SingleCellExperiment format, users can perform and visualize ssGSEA, GSVA, AUCell, and UCell-based enrichment calculations across individual cells. License: MIT + file LICENSE Encoding: UTF-8 diff --git a/R/performNormalization.R b/R/performNormalization.R index 59948a0..d575604 100644 --- a/R/performNormalization.R +++ b/R/performNormalization.R @@ -36,7 +36,6 @@ #' gene.sets = GS) #' #' @export -#' #' @return Single-cell object or matrix of normalized enrichment scores From 44e7faffc32956d28cc4d505fd31a222a385bad8 Mon Sep 17 00:00:00 2001 From: Alexei Martsinkovskiy Date: Mon, 19 Aug 2024 14:59:50 -0700 Subject: [PATCH 25/28] updated to pass chunking, fixing bug with scale factors --- .Rbuildignore | 2 ++ .gitignore | 5 ++++- DESCRIPTION | 2 +- R/performNormalization.R | 4 ++-- R/runEscape.R | 3 ++- R/utils.R | 25 +++++++++++++++++++++++++ 6 files changed, 36 insertions(+), 5 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index 0c6b19e..c067f7a 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,3 +1,5 @@ ^\.github$ ^www$ ^codecov\.yml$ +^.*\.Rproj$ +^\.Rproj\.user$ diff --git a/.gitignore b/.gitignore index 9bea433..1f785b7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ - +.Rbuildignore .DS_Store +.RHistory +escape.Rproj +.Rproj* diff --git a/DESCRIPTION b/DESCRIPTION index 2b48e1d..8b9772b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -4,7 +4,7 @@ Version: 2.0.1 Date: 2024-07-26 Authors@R: c( person(given = "Nick", family = "Borcherding", role = c("aut", "cre"), email = "ncborch@gmail.com"), - person(given = "Jared", family = "Andrews", role = c("aut"), email = "jared.andrews07@gmail.com") + person(given = "Jared", family = "Andrews", role = c("aut"), email = "jared.andrews07@gmail.com"), person(given = "Alexei", family = "Martsinkovskiy", role = c("ctb"), email = "alexei.martsinkovskiy@gmail.com") ) Description: A bridging R package to facilitate gene set enrichment analysis (GSEA) in the context of single-cell RNA sequencing. Using raw count information, Seurat objects, or SingleCellExperiment format, users can perform and visualize ssGSEA, GSVA, AUCell, and UCell-based enrichment calculations across individual cells. diff --git a/R/performNormalization.R b/R/performNormalization.R index d575604..bb9fba9 100644 --- a/R/performNormalization.R +++ b/R/performNormalization.R @@ -80,7 +80,7 @@ performNormalization <- function(sc.data, chunks <- dim(enriched)[[1]] } else{ - chunks <- groups + chunks <- min(groups, dim(enriched)[[1]]) } if (is.null(scale.factor)) { @@ -95,7 +95,7 @@ performNormalization <- function(sc.data, rm(cnts) } else{ - egc.sizes <- split_rows(scale.factor, chunk.size=chunks) + egc.sizes <- split_vector(scale.factor, chunk.size=chunks) } enriched <- split_rows(enriched, chunk.size=chunks) diff --git a/R/runEscape.R b/R/runEscape.R index a081e4e..608a6c2 100644 --- a/R/runEscape.R +++ b/R/runEscape.R @@ -113,7 +113,8 @@ escape.matrix <- function(input.data, enrichment.data = output, assay = NULL, gene.sets = gene.sets, - make.positive = make.positive) + make.positive = make.positive, + groups = groups) } return(output) } diff --git a/R/utils.R b/R/utils.R index d6a57e1..dbafd3f 100644 --- a/R/utils.R +++ b/R/utils.R @@ -258,6 +258,9 @@ is_seurat_or_se_object <- function(obj) { split_rows <- function (matrix, chunk.size = 1000) { nrows <- dim(matrix)[1] + if(is.vector(matrix)){ + nrows <- length(matrix) + } nchunks <- (nrows - 1)%/%chunk.size + 1 split.data <- list() min <- 1 @@ -274,5 +277,27 @@ split_rows <- function (matrix, chunk.size = 1000) } return(split.data) } +#function to split vector +#adopted from ucells split_data.matrix +split_vector <- function (vector, chunk.size = 1000) +{ + + nrows <- length(vector) + nchunks <- (nrows - 1)%/%chunk.size + 1 + split.data <- list() + min <- 1 + for (i in seq_len(nchunks)) { + if (i == nchunks - 1) { + left <- nrows - (i - 1) * chunk.size + max <- min + round(left/2) - 1 + } + else { + max <- min(i * chunk.size, nrows) + } + split.data[[i]] <- vector[min:max] + min <- max + 1 + } + return(split.data) +} From 46541f252d196f2e8106a8742993cd405f81a719 Mon Sep 17 00:00:00 2001 From: Alexei Martsinkovskiy Date: Tue, 20 Aug 2024 13:42:21 -0700 Subject: [PATCH 26/28] documentation. minor code cleanup added documentation for groups. added ucell split data matrix since it is an internal function and can't be imported. minor code cleanup. --- .gitignore | 1 + DESCRIPTION | 2 +- R/performNormalization.R | 7 ++----- R/utils.R | 22 ++++++++++++++++++++++ man/performNormalization.Rd | 6 +++++- 5 files changed, 31 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 1f785b7..c99070b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ .RHistory escape.Rproj .Rproj* +.RData \ No newline at end of file diff --git a/DESCRIPTION b/DESCRIPTION index 8b9772b..a7aaa38 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -11,7 +11,7 @@ Description: A bridging R package to facilitate gene set enrichment analysis (GS License: MIT + file LICENSE Encoding: UTF-8 LazyData: false -RoxygenNote: 7.3.1 +RoxygenNote: 7.3.2 biocViews: Software, SingleCell, Classification, Annotation, GeneSetEnrichment, Sequencing, GeneSignaling, Pathways Depends: R (>= 4.1) Imports: diff --git a/R/performNormalization.R b/R/performNormalization.R index bb9fba9..56ee9ab 100644 --- a/R/performNormalization.R +++ b/R/performNormalization.R @@ -17,8 +17,8 @@ #' @param scale.factor A vector to use for normalizing enrichment scores per cell. #' @param make.positive Shift enrichment values to a positive range \strong{TRUE} #' for downstream analysis or not \strong{TRUE} (default). -#' @param BPPARAM A BiocParallel::bpparam() object that for parallelization. -#' @importFrom UCell split_data.matrix +#' @param groups the number of cells to calculate normalization on at once. +#' chunks matrix into groups sized chunks. Useful in case of memory issues. #' @importFrom stringr str_replace_all #' @importFrom SeuratObject Assays #' @importFrom SummarizedExperiment assays @@ -106,9 +106,6 @@ performNormalization <- function(sc.data, scores/scales }, enriched, egc.sizes, SIMPLIFY = FALSE) enriched <- do.call(rbind, enriched) - if(!is.null(groups)){ - - } if(make.positive){ enriched <- apply(enriched, 2, function(x){ x+max(0, -min(x)) diff --git a/R/utils.R b/R/utils.R index dbafd3f..c5c3d84 100644 --- a/R/utils.R +++ b/R/utils.R @@ -253,6 +253,28 @@ is_seurat_or_se_object <- function(obj) { } return(values) } +#function to split matrices by column +#Directly from Ucell as an internal funciton. Copied here to be usable within +#the code +split_data.matrix<-function (matrix, chunk.size = 1000) +{ + ncols <- dim(matrix)[2] + nchunks <- (ncols - 1)%/%chunk.size + 1 + split.data <- list() + min <- 1 + for (i in seq_len(nchunks)) { + if (i == nchunks - 1) { + left <- ncols - (i - 1) * chunk.size + max <- min + round(left/2) - 1 + } + else { + max <- min(i * chunk.size, ncols) + } + split.data[[i]] <- matrix[, min:max, drop = FALSE] + min <- max + 1 + } + return(split.data) +} #function to split matrices by row #adopted from ucells split_data.matrix split_rows <- function (matrix, chunk.size = 1000) diff --git a/man/performNormalization.Rd b/man/performNormalization.Rd index 850ec8e..3fb7e7f 100644 --- a/man/performNormalization.Rd +++ b/man/performNormalization.Rd @@ -10,7 +10,8 @@ performNormalization( assay = "escape", gene.sets = NULL, make.positive = FALSE, - scale.factor = NULL + scale.factor = NULL, + groups = NULL ) } \arguments{ @@ -29,6 +30,9 @@ the individual gene set information from} for downstream analysis or not \strong{TRUE} (default).} \item{scale.factor}{A vector to use for normalizing enrichment scores per cell.} + +\item{groups}{the number of cells to calculate normalization on at once. +chunks matrix into groups sized chunks. Useful in case of memory issues.} } \value{ Single-cell object or matrix of normalized enrichment scores From cb97c24067302b0d793f3d546d790f72b0fd35df Mon Sep 17 00:00:00 2001 From: Alexei Martsinkovskiy Date: Tue, 20 Aug 2024 15:54:59 -0700 Subject: [PATCH 27/28] minor refactor removed redundant split matrix function (already present). added matrix dependency to imports. --- DESCRIPTION | 3 ++- R/densityEnrichment.R | 4 ++-- R/performNormalization.R | 1 + R/utils.R | 23 +---------------------- vignettes/vignette.Rmd | 2 +- 5 files changed, 7 insertions(+), 26 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index a7aaa38..6a97b83 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -36,7 +36,8 @@ Imports: UCell, stringr, methods, - SeuratObject + SeuratObject, + Matrix Suggests: Seurat, hexbin, diff --git a/R/densityEnrichment.R b/R/densityEnrichment.R index fb10fa4..b9ceeb9 100644 --- a/R/densityEnrichment.R +++ b/R/densityEnrichment.R @@ -48,7 +48,7 @@ densityEnrichment <- function(input.data, group.by <- "ident" } - compute.gene.density<-utils::getFromNamespace("compute.gene.density", "GSVA") + compute.gene.cdf<-utils::getFromNamespace("compute.gene.cdf", "GSVA") gene.sets <- .GS.check(gene.sets) gene.set <- gene.sets[[gene.set.use]] @@ -62,7 +62,7 @@ densityEnrichment <- function(input.data, lapply(seq_len(length(groups)), function(x) { tmp <- cnts.filter[,which(grouping == groups[x])] - density <- suppressWarnings(compute.gene.density(tmp, seq_len(ncol(tmp)), TRUE, FALSE)) + density <- suppressWarnings(compute.gene.cdf(tmp, seq_len(ncol(tmp)), TRUE, FALSE)) rank.scores <- rep(0, nrow(tmp)) sort.sgn.idxs <- apply(density, 2, order, decreasing=TRUE) gsva_rnk2 <- apply(sort.sgn.idxs, 2, compute_rank_score.mod, nrow(cnts)) diff --git a/R/performNormalization.R b/R/performNormalization.R index 56ee9ab..c9836fc 100644 --- a/R/performNormalization.R +++ b/R/performNormalization.R @@ -22,6 +22,7 @@ #' @importFrom stringr str_replace_all #' @importFrom SeuratObject Assays #' @importFrom SummarizedExperiment assays +#' @importFrom Matrix colSums #' @examples #' GS <- list(Bcells = c("MS4A1", "CD79B", "CD79A", "IGH1", "IGH2"), diff --git a/R/utils.R b/R/utils.R index c5c3d84..552c3c1 100644 --- a/R/utils.R +++ b/R/utils.R @@ -253,28 +253,7 @@ is_seurat_or_se_object <- function(obj) { } return(values) } -#function to split matrices by column -#Directly from Ucell as an internal funciton. Copied here to be usable within -#the code -split_data.matrix<-function (matrix, chunk.size = 1000) -{ - ncols <- dim(matrix)[2] - nchunks <- (ncols - 1)%/%chunk.size + 1 - split.data <- list() - min <- 1 - for (i in seq_len(nchunks)) { - if (i == nchunks - 1) { - left <- ncols - (i - 1) * chunk.size - max <- min + round(left/2) - 1 - } - else { - max <- min(i * chunk.size, ncols) - } - split.data[[i]] <- matrix[, min:max, drop = FALSE] - min <- max + 1 - } - return(split.data) -} + #function to split matrices by row #adopted from ucells split_data.matrix split_rows <- function (matrix, chunk.size = 1000) diff --git a/vignettes/vignette.Rmd b/vignettes/vignette.Rmd index ab93c54..2a9cd6a 100644 --- a/vignettes/vignette.Rmd +++ b/vignettes/vignette.Rmd @@ -369,7 +369,7 @@ splitEnrichment(pbmc_small, * The gene set library from either of the 3 options in the first section of the vignette. -```{r} +```{r tidy=FALSE, eval=FALSE} densityEnrichment(pbmc_small, gene.set.use = "HALLMARK-IL6-JAK-STAT3-SIGNALING", gene.sets = GS.hallmark) From a3116ff5fdab4b4c03ceae9fb412fdd7b8ce6382 Mon Sep 17 00:00:00 2001 From: Alexei Martsinkovskiy Date: Wed, 21 Aug 2024 17:23:10 -0700 Subject: [PATCH 28/28] Update densityEnrichment.R rolled back function renaming --- R/densityEnrichment.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/densityEnrichment.R b/R/densityEnrichment.R index b9ceeb9..fb10fa4 100644 --- a/R/densityEnrichment.R +++ b/R/densityEnrichment.R @@ -48,7 +48,7 @@ densityEnrichment <- function(input.data, group.by <- "ident" } - compute.gene.cdf<-utils::getFromNamespace("compute.gene.cdf", "GSVA") + compute.gene.density<-utils::getFromNamespace("compute.gene.density", "GSVA") gene.sets <- .GS.check(gene.sets) gene.set <- gene.sets[[gene.set.use]] @@ -62,7 +62,7 @@ densityEnrichment <- function(input.data, lapply(seq_len(length(groups)), function(x) { tmp <- cnts.filter[,which(grouping == groups[x])] - density <- suppressWarnings(compute.gene.cdf(tmp, seq_len(ncol(tmp)), TRUE, FALSE)) + density <- suppressWarnings(compute.gene.density(tmp, seq_len(ncol(tmp)), TRUE, FALSE)) rank.scores <- rep(0, nrow(tmp)) sort.sgn.idxs <- apply(density, 2, order, decreasing=TRUE) gsva_rnk2 <- apply(sort.sgn.idxs, 2, compute_rank_score.mod, nrow(cnts))