Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GHA for doublet-detection module #462

Merged
merged 15 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
sjspielman marked this conversation as resolved.
Show resolved Hide resolved
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
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