Skip to content

Commit

Permalink
Merge pull request #462 from sjspielman/sjspielman/461-doublet-gha
Browse files Browse the repository at this point in the history
GHA for doublet-detection module
  • Loading branch information
sjspielman committed May 28, 2024
2 parents 8937a0a + 63ec223 commit ce1b734
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 5 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/run_doublet-detection.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# 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
defaults:
run:
shell: bash -el {0}

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: Install dependencies needed to build certain R packages
run: |
sudo apt-get update
# 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 \
libglpk-dev
- 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 conda-lock and activate locked conda environment
run: |
conda install conda-lock
conda-lock install --name test ${MODULE_PATH}/conda-lock.yml
- name: Run doublet-detection module
run: |
cd $MODULE_PATH
bash run_doublet-detection.sh
2 changes: 1 addition & 1 deletion analyses/doublet-detection/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
15 changes: 15 additions & 0 deletions analyses/doublet-detection/doublet-detection.Rproj
Original file line number Diff line number Diff line change
@@ -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
5 changes: 2 additions & 3 deletions analyses/doublet-detection/scripts/00_format-benchmark-data.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
2 changes: 1 addition & 1 deletion analyses/doublet-detection/scripts/01a_run-scdblfinder.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ce1b734

Please sign in to comment.