From 538e1aac0c5c7cd5d0e8a9f7156bf4075d7ff652 Mon Sep 17 00:00:00 2001 From: "Stephanie J. Spielman" Date: Fri, 24 May 2024 12:10:53 -0400 Subject: [PATCH 01/12] doublet-detection gha --- .github/workflows/run_doublet-detection.yml | 62 +++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/run_doublet-detection.yml diff --git a/.github/workflows/run_doublet-detection.yml b/.github/workflows/run_doublet-detection.yml new file mode 100644 index 00000000..4018c640 --- /dev/null +++ b/.github/workflows/run_doublet-detection.yml @@ -0,0 +1,62 @@ +# This is a workflow to run the doublet-detection module +# This module has both an renv and a conda environment +# +# Analysis modules are run based on three triggers: +# - Manual trigger +# - On pull requests where code in the module has changed +# - As a reusable workflow called from a separate workflow which periodically runs all modules + +name: Run doublet-detection analysis module +env: + MODULE_PATH: analyses/doublet-detection + AWS_DEFAULT_REGION: us-east-1 + +concurrency: + # only one run per branch at a time + group: doublet-detection-${{ github.ref }} + cancel-in-progress: true + +on: + workflow_dispatch: + workflow_call: + pull_request: + branches: + - main + paths: + - analyses/doublet-detection/** +jobs: + run-module: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + # Eventually, a step to download data will go here. + + - name: Set up R + uses: r-lib/actions/setup-r@v2 + with: + r-version: 4.4.0 + use-public-rspm: true + + - name: Set up pandoc + uses: r-lib/actions/setup-pandoc@v2 + + - name: Set up renv + uses: r-lib/actions/setup-renv@v2 + with: + working-directory: ${{ env.MODULE_PATH }} + + - name: Set up conda + uses: conda-incubator/setup-miniconda@v3 + + - name: Install and activate locked conda environment + run: | + conda install conda-lock + conda-lock install --name doublet-detection ${MODULE_PATH}/conda-lock.yml + + - name: Run doublet-detection module + run: | + cd $MODULE_PATH + bash run_doublet-detection.sh From 5eb3a984ced37991b411ddb1caea5129d180c844 Mon Sep 17 00:00:00 2001 From: Stephanie Spielman Date: Fri, 24 May 2024 12:25:16 -0400 Subject: [PATCH 02/12] Update .github/workflows/run_doublet-detection.yml Co-authored-by: Joshua Shapiro --- .github/workflows/run_doublet-detection.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/run_doublet-detection.yml b/.github/workflows/run_doublet-detection.yml index 4018c640..b3feb5a0 100644 --- a/.github/workflows/run_doublet-detection.yml +++ b/.github/workflows/run_doublet-detection.yml @@ -27,6 +27,9 @@ on: jobs: run-module: runs-on: ubuntu-latest + defaults: + run: + shell: bash -el {0} steps: - name: Checkout repo From bf4c374c899adfcaa6e3bd6e88e7d78b3be697ef Mon Sep 17 00:00:00 2001 From: "Stephanie J. Spielman" Date: Fri, 24 May 2024 13:31:07 -0400 Subject: [PATCH 03/12] lil readme modification to trigger gha --- analyses/doublet-detection/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/analyses/doublet-detection/README.md b/analyses/doublet-detection/README.md index 51de0eaa..cd48a2ff 100644 --- a/analyses/doublet-detection/README.md +++ b/analyses/doublet-detection/README.md @@ -2,7 +2,7 @@ ## Description -This module explores doublet detection across ScPCA datasets. +This module explores the use of doublet detection methods across ScPCA datasets. Methods used in this module include the following: From 4d088d139b71c0673055aaa292417c15648e7b0e Mon Sep 17 00:00:00 2001 From: "Stephanie J. Spielman" Date: Fri, 24 May 2024 14:03:59 -0400 Subject: [PATCH 04/12] install a couple dependencies --- .github/workflows/run_doublet-detection.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/run_doublet-detection.yml b/.github/workflows/run_doublet-detection.yml index b3feb5a0..4ea0b2f3 100644 --- a/.github/workflows/run_doublet-detection.yml +++ b/.github/workflows/run_doublet-detection.yml @@ -43,6 +43,16 @@ jobs: r-version: 4.4.0 use-public-rspm: true + - name: Install dependencies needed to build certain R packages + run: | + sudo apt-get update + # We need these to build Rhtslib, a dependency of scDblFinder: + # https://github.com/samtools/htslib/blob/30c9c50a874059e3dae7ff8c0ad9e8a9258031c8/INSTALL#L31-L41 + sudo apt-get install \ + zlib \ + libbz2 \ + liblzma + - name: Set up pandoc uses: r-lib/actions/setup-pandoc@v2 From 4297800ef6182d6fad894baae96c7f310b871243 Mon Sep 17 00:00:00 2001 From: "Stephanie J. Spielman" Date: Fri, 24 May 2024 14:09:27 -0400 Subject: [PATCH 05/12] names --- .github/workflows/run_doublet-detection.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run_doublet-detection.yml b/.github/workflows/run_doublet-detection.yml index 4ea0b2f3..a95e7308 100644 --- a/.github/workflows/run_doublet-detection.yml +++ b/.github/workflows/run_doublet-detection.yml @@ -49,9 +49,9 @@ jobs: # We need these to build Rhtslib, a dependency of scDblFinder: # https://github.com/samtools/htslib/blob/30c9c50a874059e3dae7ff8c0ad9e8a9258031c8/INSTALL#L31-L41 sudo apt-get install \ - zlib \ - libbz2 \ - liblzma + zlib1g-dev \ + libbz2-dev \ + lzma-dev - name: Set up pandoc uses: r-lib/actions/setup-pandoc@v2 From d61871020b95bc28c205739a81a1edaac554e2aa Mon Sep 17 00:00:00 2001 From: "Stephanie J. Spielman" Date: Fri, 24 May 2024 14:42:21 -0400 Subject: [PATCH 06/12] update dependencies --- .github/workflows/run_doublet-detection.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_doublet-detection.yml b/.github/workflows/run_doublet-detection.yml index a95e7308..b722eb48 100644 --- a/.github/workflows/run_doublet-detection.yml +++ b/.github/workflows/run_doublet-detection.yml @@ -49,9 +49,10 @@ jobs: # We need these to build Rhtslib, a dependency of scDblFinder: # https://github.com/samtools/htslib/blob/30c9c50a874059e3dae7ff8c0ad9e8a9258031c8/INSTALL#L31-L41 sudo apt-get install \ - zlib1g-dev \ - libbz2-dev \ + libcurl4-openssl-dev \ lzma-dev + # already present: zlib1g-dev & libbz2-dev + - name: Set up pandoc uses: r-lib/actions/setup-pandoc@v2 From 38e669d8a977377ae94cc0f0d2d8e13ae2fb9cf3 Mon Sep 17 00:00:00 2001 From: "Stephanie J. Spielman" Date: Fri, 24 May 2024 15:06:02 -0400 Subject: [PATCH 07/12] igraph dep --- .github/workflows/run_doublet-detection.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run_doublet-detection.yml b/.github/workflows/run_doublet-detection.yml index b722eb48..9b7addcb 100644 --- a/.github/workflows/run_doublet-detection.yml +++ b/.github/workflows/run_doublet-detection.yml @@ -46,12 +46,13 @@ jobs: - name: Install dependencies needed to build certain R packages run: | sudo apt-get update - # We need these to build Rhtslib, a dependency of scDblFinder: - # https://github.com/samtools/htslib/blob/30c9c50a874059e3dae7ff8c0ad9e8a9258031c8/INSTALL#L31-L41 + # libcurl4-openssl-dev and lzma-dev are needed for Rhtslib, a dependency of scDblFinder: + # https://github.com/samtools/htslib/blob/30c9c50a874059e3dae7ff8c0ad9e8a9258031c8/INSTALL#L31-L41 + # libglpk-dev is needed for igraph sudo apt-get install \ libcurl4-openssl-dev \ - lzma-dev - # already present: zlib1g-dev & libbz2-dev + lzma-dev \ + libglpk-dev - name: Set up pandoc From 72c0048a14bba1eb640e26aec6664414b32251cc Mon Sep 17 00:00:00 2001 From: "Stephanie J. Spielman" Date: Fri, 24 May 2024 15:38:29 -0400 Subject: [PATCH 08/12] Rproj file needs to be added --- .../doublet-detection/doublet-detection.Rproj | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 analyses/doublet-detection/doublet-detection.Rproj diff --git a/analyses/doublet-detection/doublet-detection.Rproj b/analyses/doublet-detection/doublet-detection.Rproj new file mode 100644 index 00000000..d96a2b3a --- /dev/null +++ b/analyses/doublet-detection/doublet-detection.Rproj @@ -0,0 +1,15 @@ +Version: 1.0 + +RestoreWorkspace: Default +SaveWorkspace: Default +AlwaysSaveHistory: Default + +EnableCodeIndexing: Yes +UseSpacesForTab: Yes +NumSpacesForTab: 2 +Encoding: UTF-8 + +RnwWeave: Sweave +LaTeX: pdfLaTeX + +StripTrailingWhitespace: Yes From 09a27fbc78d71aac57b8a7b250746f955029cd40 Mon Sep 17 00:00:00 2001 From: "Stephanie J. Spielman" Date: Tue, 28 May 2024 09:08:29 -0400 Subject: [PATCH 09/12] try actually activating --- .github/workflows/run_doublet-detection.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run_doublet-detection.yml b/.github/workflows/run_doublet-detection.yml index 9b7addcb..ca680fa6 100644 --- a/.github/workflows/run_doublet-detection.yml +++ b/.github/workflows/run_doublet-detection.yml @@ -66,10 +66,11 @@ jobs: - name: Set up conda uses: conda-incubator/setup-miniconda@v3 - - name: Install and activate locked conda environment + - name: Install conda-lock and activate locked conda environment run: | conda install conda-lock conda-lock install --name doublet-detection ${MODULE_PATH}/conda-lock.yml + conda activate doublet-detection - name: Run doublet-detection module run: | From 9a0adfce90ed9e4f55c4cd9e0a25b0e64ee1c17f Mon Sep 17 00:00:00 2001 From: "Stephanie J. Spielman" Date: Tue, 28 May 2024 09:12:44 -0400 Subject: [PATCH 10/12] find renv root --- .../doublet-detection/scripts/00_format-benchmark-data.R | 5 ++--- analyses/doublet-detection/scripts/01a_run-scdblfinder.R | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/analyses/doublet-detection/scripts/00_format-benchmark-data.R b/analyses/doublet-detection/scripts/00_format-benchmark-data.R index 8af6e3fc..ab13e13f 100755 --- a/analyses/doublet-detection/scripts/00_format-benchmark-data.R +++ b/analyses/doublet-detection/scripts/00_format-benchmark-data.R @@ -11,10 +11,9 @@ # - In the SCE file, this is in the colData slot # - In the AnnData file, this is in the obs slot -# Load renv -project_root <- here::here() +# Load renv environment and libraries +project_root <- rprojroot::find_root(rprojroot::is_renv_project) renv::load(project_root) - library(optparse) diff --git a/analyses/doublet-detection/scripts/01a_run-scdblfinder.R b/analyses/doublet-detection/scripts/01a_run-scdblfinder.R index 3cddf38d..c79c55bc 100755 --- a/analyses/doublet-detection/scripts/01a_run-scdblfinder.R +++ b/analyses/doublet-detection/scripts/01a_run-scdblfinder.R @@ -4,7 +4,7 @@ # Load libraries and renv environment ------ -project_root <- here::here() +project_root <- rprojroot::find_root(rprojroot::is_renv_project) renv::load(project_root) library(SingleCellExperiment) From 1b606b67a611f468937d4349b36820c88e508744 Mon Sep 17 00:00:00 2001 From: Stephanie Spielman Date: Tue, 28 May 2024 10:58:58 -0400 Subject: [PATCH 11/12] Update .github/workflows/run_doublet-detection.yml Co-authored-by: Joshua Shapiro --- .github/workflows/run_doublet-detection.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/run_doublet-detection.yml b/.github/workflows/run_doublet-detection.yml index ca680fa6..a56993bd 100644 --- a/.github/workflows/run_doublet-detection.yml +++ b/.github/workflows/run_doublet-detection.yml @@ -69,8 +69,7 @@ jobs: - name: Install conda-lock and activate locked conda environment run: | conda install conda-lock - conda-lock install --name doublet-detection ${MODULE_PATH}/conda-lock.yml - conda activate doublet-detection + conda-lock install --name test ${MODULE_PATH}/conda-lock.yml - name: Run doublet-detection module run: | From 63ec223954e3f75e14b637c83dac69970ae7ba90 Mon Sep 17 00:00:00 2001 From: "Stephanie J. Spielman" Date: Tue, 28 May 2024 14:47:52 -0400 Subject: [PATCH 12/12] turn off PR trigger --- .github/workflows/run_doublet-detection.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/run_doublet-detection.yml b/.github/workflows/run_doublet-detection.yml index a56993bd..85240521 100644 --- a/.github/workflows/run_doublet-detection.yml +++ b/.github/workflows/run_doublet-detection.yml @@ -19,11 +19,12 @@ concurrency: on: workflow_dispatch: workflow_call: - pull_request: - branches: - - main - paths: - - analyses/doublet-detection/** + #pull_request: + # branches: + # - main + # paths: + # - analyses/doublet-detection/** + jobs: run-module: runs-on: ubuntu-latest