From 4c4442d9814d914193b24fa2852ec7f8fa2cd251 Mon Sep 17 00:00:00 2001
From: Peng Lian <Peng.Lian@UTSouthwestern.edu>
Date: Wed, 2 Mar 2022 12:20:16 -0600
Subject: [PATCH] Add support for Astrocyte

---
 .gitlab-ci.yml                                | 19 ++++++++++++++-----
 README.md                                     |  4 ++--
 astrocyte_pkg.yml                             | 11 +++++++++++
 testing/run_human_pe_test.sh                  |  2 +-
 testing/run_mouse_se_test.sh                  |  2 +-
 .../configs/nextflow.config                   |  2 +-
 6 files changed, 30 insertions(+), 10 deletions(-)
 rename nextflow.config => workflow/configs/nextflow.config (96%)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 81846b4..d8af594 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -5,22 +5,31 @@ variables:
   GIT_SUBMODULE_STRATEGY: normal
 
 before_script:
+  - module load astrocyte/1.0.0
   - module load nextflow/20.01.0
   - module load singularity/3.0.2
 
 stages:
-  - integration
+  - check
+  - test_human
+  - test_mouse
+
+# This performs validation of the astrocyte_pkg.yml file
+astrocyte_check:
+  stage: check
+  script:
+  - astrocyte_cli check "$CI_PROJECT_DIR" 
 
 test_human:
-  stage: integration
+  stage: test_human
   script:
-    - nextflow run -c nextflow.config -with-dag flowchart.png -with-timeline human_timeline.html -with-report human_report.html workflow/main.nf --design  /project/shared/bicf_workflow_ref/workflow_testdata/rnaseq/design.rnaseq.txt --input  /project/shared/bicf_workflow_ref/workflow_testdata/rnaseq --output human_output
+    - nextflow run -c workflow/configs/nextflow.config -with-dag flowchart.png -with-timeline human_timeline.html -with-report human_report.html workflow/main.nf --design  /project/shared/bicf_workflow_ref/workflow_testdata/rnaseq/design.rnaseq.txt --input  /project/shared/bicf_workflow_ref/workflow_testdata/rnaseq --output human_output
   artifacts:
     expire_in: 2 days
 
 test_mouse:
-  stage: integration
+  stage: test_mouse
   script:
-    - nextflow run -c nextflow.config -with-dag flowchart.png -with-timeline mouse_timeline.html -with-report mouse_report.html  workflow/main.nf --input  /project/shared/bicf_workflow_ref/workflow_testdata/rnaseq --design /project/shared/bicf_workflow_ref/workflow_testdata/rnaseq/mouse_se.design.txt --pairs se --fusion skip --genome /project/shared/bicf_workflow_ref/mouse/GRCm38 --markdups null --output mouse_output
+    - nextflow run -c workflow/configs/nextflow.config -with-dag flowchart.png -with-timeline mouse_timeline.html -with-report mouse_report.html  workflow/main.nf --input  /project/shared/bicf_workflow_ref/workflow_testdata/rnaseq --design /project/shared/bicf_workflow_ref/workflow_testdata/rnaseq/mouse_se.design.txt --pairs se --fusion skip --genome /project/shared/bicf_workflow_ref/mouse/GRCm38 --markdups null --output mouse_output
   artifacts:
     expire_in: 2 days
diff --git a/README.md b/README.md
index 93561bb..7b6ac56 100644
--- a/README.md
+++ b/README.md
@@ -69,7 +69,7 @@ module load nextflow/20.01.0 singularity/3.5.3
 base=$repoClonedDirectory
 datadir='/project/shared/bicf_workflow_ref/workflow_testdata/rnaseq'
 
-nextflow -C ${base}/nextflow.config run ${base}/workflow/main.nf --design  ${datadir}/design.rnaseq.txt --input ${datadir} --output analysis
+nextflow -C ${base}/workflow/configs/nextflow.config run ${base}/workflow/main.nf --design  ${datadir}/design.rnaseq.txt --input ${datadir} --output analysis
 
 ```
 
@@ -80,7 +80,7 @@ module load nextflow/20.01.0 singularity/3.5.3
 base=$repoClonedDirectory
 datadir='/project/shared/bicf_workflow_ref/workflow_testdata/rnaseq'
 
-nextflow -C ${base}/nextflow.config run -with-dag flowchart.png -with-timeline mouse_timeline.html -with-report mouse_report.html ${base}/workflow/main.nf --design  ${datadir}/mouse_se.design.txt --input ${datadir} --pairs se --output analysis
+nextflow -C ${base}/workflow/configs/nextflow.config run -with-dag flowchart.png -with-timeline mouse_timeline.html -with-report mouse_report.html ${base}/workflow/main.nf --design  ${datadir}/mouse_se.design.txt --input ${datadir} --pairs se --output analysis
 
 ```
 
diff --git a/astrocyte_pkg.yml b/astrocyte_pkg.yml
index 47962cd..2568b3e 100644
--- a/astrocyte_pkg.yml
+++ b/astrocyte_pkg.yml
@@ -20,6 +20,17 @@ description: |
   It implements differential expression analysis, gene set enrichment analysis,
   gene fusion analysis and variant identification using RNASeq data.
 
+# The minimum Astrocyte version that requires to run this workflow. For old pipelines, which do not have this label 
+# a default value of 0.3.1 will be assigned automatically. A request of minimum version less than 0.4.0 will be ignored.
+minimum_astrocyte_version: '0.4.1'
+# The Nextflow version that requires to run this workflow.  For old pipelines, which do not have this label 
+# a default value of 0.31.0 will be assigned automatically. Please make sure the requested nextflow version is available
+# in the module list.
+nextflow_version: '20.01.0'
+# (Optional) The Nextflow config file to use for this workflow. If provided, the file should exist in workflow/configs
+nextflow_config: 'nextflow.config'
+# The container to use for this workflow, none/singularity. If omitted, the default value 'none' will be used.
+container: 'none'
 
 # -----------------------------------------------------------------------------
 # DOCUMENTATION
diff --git a/testing/run_human_pe_test.sh b/testing/run_human_pe_test.sh
index e8624c0..ade5af3 100644
--- a/testing/run_human_pe_test.sh
+++ b/testing/run_human_pe_test.sh
@@ -4,4 +4,4 @@ module load nextflow/20.01.0 singularity/3.5.3
 base='/project/BICF/BICF_Core/s166458/rnaseq_astrocyte'
 datadir='/project/shared/bicf_workflow_ref/workflow_testdata/rnaseq'
 
-nextflow -C ${base}/nextflow.config run ${base}/workflow/main.nf --design  ${datadir}/design.rnaseq.txt --input ${datadir} --output analysis
+nextflow -C ${base}/workflow/configs/nextflow.config run ${base}/workflow/main.nf --design  ${datadir}/design.rnaseq.txt --input ${datadir} --output analysis
diff --git a/testing/run_mouse_se_test.sh b/testing/run_mouse_se_test.sh
index 2c105e3..2d3f06b 100644
--- a/testing/run_mouse_se_test.sh
+++ b/testing/run_mouse_se_test.sh
@@ -4,4 +4,4 @@ module load nextflow/20.01.0 singularity/3.5.3
 base='/project/BICF/BICF_Core/s166458/rnaseq_astrocyte'
 datadir='/project/shared/bicf_workflow_ref/workflow_testdata/rnaseq'
 
-nextflow -C ${base}/nextflow.config run -with-dag flowchart.png -with-timeline mouse_timeline.html -with-report mouse_report.html ${base}/workflow/main.nf --design  ${datadir}/mouse_se.design.txt --input ${datadir} --pairs se --output analysis
+nextflow -C ${base}/workflow/configs/nextflow.config run -with-dag flowchart.png -with-timeline mouse_timeline.html -with-report mouse_report.html ${base}/workflow/main.nf --design  ${datadir}/mouse_se.design.txt --input ${datadir} --pairs se --output analysis
diff --git a/nextflow.config b/workflow/configs/nextflow.config
similarity index 96%
rename from nextflow.config
rename to workflow/configs/nextflow.config
index 150748a..3103d1e 100644
--- a/nextflow.config
+++ b/workflow/configs/nextflow.config
@@ -39,7 +39,7 @@ process {
 
 singularity {
   enabled = true
-  runOptions='--no-home --cleanenv'
+  runOptions='--no-home --cleanenv --disable-cache'
   singularity.cacheDir="$PWD"
 }
 
-- 
GitLab