Skip to content

Commit

Permalink
Merge pull request #953 from jashapiro/jashapiro/seurat-convert
Browse files Browse the repository at this point in the history
Add Seurat conversion script
  • Loading branch information
jashapiro authored Dec 19, 2024
2 parents 695f37c + 973334b commit 27d1947
Show file tree
Hide file tree
Showing 9 changed files with 3,044 additions and 41 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/docker_seurat-conversion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ concurrency:
cancel-in-progress: true

on:
# pull_request:
# branches:
# - main
# paths:
# - "analyses/seurat-conversion/Dockerfile"
# - "analyses/seurat-conversion/.dockerignore"
# - "analyses/seurat-conversion/renv.lock"
# - "analyses/seurat-conversion/conda-lock.yml"
# push:
# branches:
# - main
# paths:
# - "analyses/seurat-conversion/Dockerfile"
# - "analyses/seurat-conversion/.dockerignore"
# - "analyses/seurat-conversion/renv.lock"
# - "analyses/seurat-conversion/conda-lock.yml"
pull_request:
branches:
- main
paths:
- "analyses/seurat-conversion/Dockerfile"
- "analyses/seurat-conversion/.dockerignore"
- "analyses/seurat-conversion/renv.lock"
- "analyses/seurat-conversion/conda-lock.yml"
push:
branches:
- main
paths:
- "analyses/seurat-conversion/Dockerfile"
- "analyses/seurat-conversion/.dockerignore"
- "analyses/seurat-conversion/renv.lock"
- "analyses/seurat-conversion/conda-lock.yml"
workflow_dispatch:
inputs:
push-ecr:
Expand Down
36 changes: 22 additions & 14 deletions .github/workflows/run_seurat-conversion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ concurrency:

on:
workflow_dispatch:
# workflow_call:
# pull_request:
# branches:
# - main
# paths:
# - analyses/seurat-conversion/**
# - "!analyses/seurat-conversion/Dockerfile"
# - "!analyses/seurat-conversion/.dockerignore"
# - .github/workflows/run_seurat-conversion.yml
workflow_call:
pull_request:
branches:
- main
paths:
- analyses/seurat-conversion/**
- "!analyses/seurat-conversion/Dockerfile"
- "!analyses/seurat-conversion/.dockerignore"
- .github/workflows/run_seurat-conversion.yml

jobs:
run-module:
Expand All @@ -44,19 +44,27 @@ jobs:
r-version: 4.4.0
use-public-rspm: true

- name: Set up pandoc
uses: r-lib/actions/setup-pandoc@v2
- name: Install additional dependencies
run: |
sudo apt-get install -y \
libhdf5-dev \
libglpk40
- name: Set up renv
uses: r-lib/actions/setup-renv@v2
with:
working-directory: ${{ env.MODULE_PATH }}

# Update this step as needed to download the desired data
- name: Download test data
run: ./download-data.py --test-data --format SCE
env:
# Unless otherwise stated, the first sample ID in the given project
# For the multiplexed project SCPCP000009, set of samples `SCPCS000133,SCPCS000134,SCPCS000135,SCPCS000136` (this group of samples has 2 associated libraries). Only `SCPCS000133` is specified in the SAMPLES string here.
# For the project SCPCP000011, the sample SCPCS000435 was specifically selected as an edge case sample with <10 cells
SAMPLES: "SCPCS000001,SCPCS000024,SCPCS000050,SCPCS000101,SCPCS000124,SCPCS000133,SCPCS000168,SCPCS000216,SCPCS000246,SCPCS000250,SCPCS000298,SCPCS000435,SCPCS000481,SCPCS000484,SCPCS000490,SCPCS000502,SCPCS000514,SCPCS000616,SCPCS000632,SCPCS000758"
run: |
./download-data.py --test-data --format SCE --samples ${SAMPLES}
- name: Run analysis module
run: |
cd ${MODULE_PATH}
# run module script(s) here
bash run_seurat-conversion.sh
5 changes: 5 additions & 0 deletions analyses/seurat-conversion/.Rprofile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@
if (Sys.getenv('OPENSCPCA_DOCKER') != 'TRUE') {
source('renv/activate.R')
}

# work around renv 1.0.11 bug
if (exists("object")){
rm(object)
}
18 changes: 8 additions & 10 deletions analyses/seurat-conversion/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,27 @@ This analysis module is used to convert the SingleCellExperiment objects from th

## Description

Please provide a description of your module, including:

- What type of analysis is included?
- What methods or tools are used?

If there are multiple steps in the module, please include an outline of the analysis steps and scripts used.

## Usage

TBD
The `run_seurat-conversion.sh` script will convert all `_processed.rds` and `_filtered.rds` files in the repository's `data/current/` directory, placing output files in the module's `results/seurat/` directory.
To process specific sets of files, the `scripts/seurat-conversion.R` script can be run directly, specifying input and output directories as needed.

## Input files

Input modules will be a SingleCellExperiment objects (as `.rds` files) from the ScPCA Portal.
## Input files

Input files are SingleCellExperiment objects (as `.rds` files) from the ScPCA Portal.
By default, these are the files in the `data/current/` directory of the `OpenScPCA-analysis` repository, as downloaded by the `download-data.py` script.

## Output files

Seurat object files (as `.rds` files) will be generated as output, organized by project.
Seurat object files (as `.rds` files) will be generated as output, organized following the same directory structure as the input files.
For example, if an input file is `$REPO_ROOT/data/current/SCPCP000000/SCPCS000000/SCPCL000000_processed.rds`, the corresponding output file will be placed at `results/seurat/SCPCP000000/SCPCS000000/SCPCL000000_processed_seurat.rds`.

## Software requirements

The code for the project will be in R, so all software dependencies will be managed by `renv`.
The code for this module is all written in R, with all software dependencies managed by `renv`.

## Computational resources

Expand Down
4 changes: 3 additions & 1 deletion analyses/seurat-conversion/components/dependencies.R
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# R dependencies not captured by `renv`
# library("missing_package")
library("Seurat")
library("scater")
library("scran")
Loading

0 comments on commit 27d1947

Please sign in to comment.