Skip to content

Commit

Permalink
update tests to include all tools
Browse files Browse the repository at this point in the history
  • Loading branch information
csangara committed Oct 2, 2024
1 parent 34fbca2 commit bbefd9c
Show file tree
Hide file tree
Showing 19 changed files with 205 additions and 78 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test_run_dataset_R.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ jobs:
run: |
echo $(ls)
Rscript unit-test/test_run_dataset.R \
rctd,music,spatialdwls
rctd,music,spatialdwls,nnls,seurat
68 changes: 68 additions & 0 deletions .github/workflows/test_run_dataset_dstg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: test run_dataset mode - dstg
# This workflow runs the pipeline with the minimal test dataset to check that it completes without any syntax errors
on: [pull_request, workflow_dispatch ]

jobs:
run_dataset:
name: Run workflow with run_dataset mode
runs-on: ubuntu-latest
strategy:
matrix:
# Nextflow versions: check pipeline minimum and latest edge version
nxf_ver:
- 'NXF_VER=21.04.3'
steps:
- name: Check out pipeline code
uses: actions/checkout@v3
# with:
# lfs: true

- name: Download test dataset
run: |
wget https://zenodo.org/record/5763377/files/test_data.tar.gz?download=1 -O test_data.tar.gz
tar -xzvf test_data.tar.gz
echo $(ls)
# - name: Checkout LFS objects
# run: git lfs checkout

- name: Install Nextflow
run: |
wget -qO- get.nextflow.io | bash
sudo mv nextflow /usr/local/bin/
export ${{ matrix.nxf_ver }}
nextflow self-update
- name: Run pipeline with test data
run: |
nextflow run main.nf -profile test,docker --mode run_dataset \
--methods dstg
- name: Upload proportions and metrics
uses: actions/upload-artifact@v3
with:
name: deconv-proportions-and-metrics
path: |
deconv_proportions/*
results/*
trace.txt
test_output_run_dataset:
name: Tests outputs of the pipeline
needs: run_dataset
runs-on: ubuntu-latest
container: rocker/tidyverse:3.6.3
steps:
- name: Check out pipeline code
uses: actions/checkout@v3

- name: Download proportions from test run
uses: actions/download-artifact@v3
with:
name: deconv-proportions-and-metrics

- name: Check proportions and metrics with testthat
shell: bash
run: |
echo $(ls)
Rscript unit-test/test_run_dataset.R dstg
6 changes: 3 additions & 3 deletions .github/workflows/test_run_dataset_python.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: test run_dataset mode
name: test run_dataset mode for Python tools
# This workflow runs the pipeline with the minimal test dataset to check that it completes without any syntax errors
on: [ pull_request, workflow_dispatch ]

Expand Down Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Run pipeline with test data
run: |
nextflow run main.nf -profile test,docker --mode run_dataset \
--methods cell2location,stereoscope,destvi
--methods cell2location,stereoscope,destvi,tangram,stride
- name: Upload proportions and metrics
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -66,4 +66,4 @@ jobs:
run: |
echo $(ls)
Rscript unit-test/test_run_dataset.R \
cell2location,stereoscope,destvi
cell2location,stereoscope,destvi,tangram,stride
2 changes: 1 addition & 1 deletion .github/workflows/test_run_dataset_spotlight.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: test run_dataset mode
name: test run_dataset mode - spotlight
# This workflow runs the pipeline with the minimal test dataset to check that it completes without any syntax errors
on: [pull_request, workflow_dispatch ]

Expand Down
4 changes: 3 additions & 1 deletion conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ params {
deconv_args = [spotlight: "--logfc.threshold 0.25 --min.pct 0.1",
cell2location: [build: "-p 10", fit: "-p 10 -n 30"],
stereoscope: "-n 5000",
destvi: []]
destvi: [],
dstg: [dir: ""],
stride: "--ntopics 20"]

synthspot = [sc_input: "unit-test/test_sc_data.rds",
clust_var: "subclass",
Expand Down
4 changes: 2 additions & 2 deletions unit-test/test_run_dataset/metrics_cell2location_test_sp_data
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"corr" "RMSE" "accuracy" "balanced_accuracy" "sensitivity" "specificity" "precision" "F1" "F2" "prc"
0.110622360090902 0.100663167915726 0.207 0.5 1 0 0.207 0.343 0.566 0.275883464348976
"corr" "RMSE" "accuracy" "balanced_accuracy" "sensitivity" "specificity" "precision" "F1" "F2" "prc" "roc" "jsd"
0.110642599743902 0.10066314583284 0.207 0.5 1 0 0.207 0.343 0.566 0.275917367241725 0.582912761355442 0.61888617039506
4 changes: 2 additions & 2 deletions unit-test/test_run_dataset/metrics_destvi_test_sp_data
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"corr" "RMSE" "accuracy" "balanced_accuracy" "sensitivity" "specificity" "precision" "F1" "F2" "prc"
0.0145696592201077 0.101729783953808 0.207 0.5 1 0 0.207 0.343 0.566 0.2192500796612
"corr" "RMSE" "accuracy" "balanced_accuracy" "sensitivity" "specificity" "precision" "F1" "F2" "prc" "roc" "jsd"
0.014569664254185 0.101729783780696 0.207 0.5 1 0 0.207 0.343 0.566 0.2192500796612 0.504506128334536 0.626149897957899
2 changes: 2 additions & 0 deletions unit-test/test_run_dataset/metrics_dstg_test_sp_data
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"corr" "RMSE" "accuracy" "balanced_accuracy" "sensitivity" "specificity" "precision" "F1" "F2" "prc" "roc" "jsd"
0.680519179784906 0.0682051290374751 0.367 0.601 1 0.202 0.246 0.395 0.62 0.699914632736589 0.879551189617876 0.317108568421564
4 changes: 2 additions & 2 deletions unit-test/test_run_dataset/metrics_spotlight_test_sp_data
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"corr" "RMSE" "accuracy" "balanced_accuracy" "sensitivity" "specificity" "precision" "F1" "F2" "prc"
0.865593803191432 0.0523936246671797 0.524 0.686 0.961 0.411 0.298 0.455 0.665 0.90028650805289
"corr" "RMSE" "accuracy" "balanced_accuracy" "sensitivity" "specificity" "precision" "F1" "F2" "prc" "roc" "jsd"
0.865593803191432 0.0523936246671797 0.524 0.686 0.961 0.411 0.298 0.455 0.665 0.900242143795783 0.936418529199713 0.224147894488034
4 changes: 2 additions & 2 deletions unit-test/test_run_dataset/metrics_stereoscope_test_sp_data
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"corr" "RMSE" "accuracy" "balanced_accuracy" "sensitivity" "specificity" "precision" "F1" "F2" "prc"
0.0110282994161923 0.104999613513269 0.217 0.502 0.987 0.017 0.207 0.342 0.563 0.206284339597483
"corr" "RMSE" "accuracy" "balanced_accuracy" "sensitivity" "specificity" "precision" "F1" "F2" "prc" "roc" "jsd"
0.0110282963938356 0.104999613443245 0.217 0.502 0.987 0.017 0.207 0.342 0.563 0.206284339597483 0.512436914203316 0.644602335090136
2 changes: 2 additions & 0 deletions unit-test/test_run_dataset/metrics_stride_test_sp_data
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"corr" "RMSE" "accuracy" "balanced_accuracy" "sensitivity" "specificity" "precision" "F1" "F2" "prc" "roc" "jsd"
0.54223410865828 0.091716447911441 0.595 0.691 0.855 0.527 0.32 0.466 0.641 0.553426086385818 0.77460346070656 0.401417602891877
2 changes: 2 additions & 0 deletions unit-test/test_run_dataset/metrics_tangram_test_sp_data
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"corr" "RMSE" "accuracy" "balanced_accuracy" "sensitivity" "specificity" "precision" "F1" "F2" "prc" "roc" "jsd"
0.771419110743224 0.0644334125870186 0.796 0.808 0.829 0.788 0.504 0.627 0.734 0.794897985371974 0.897981254506127 0.206574602899636
Loading

0 comments on commit bbefd9c

Please sign in to comment.