From f7cda54618ed6119cd8d185d47f60be643a6abbc Mon Sep 17 00:00:00 2001
From: BIOPZ-Bak Maciej <maciej.bak@unibas.ch>
Date: Fri, 12 Jun 2020 18:36:14 +0200
Subject: [PATCH] Add Snakemake report

---
 install/environment.root.yml                  | 6 +++++-
 install/environment.yml                       | 7 ++++++-
 tests/test_integration_workflow/test.local.sh | 9 +++++++++
 tests/test_integration_workflow/test.slurm.sh | 9 +++++++++
 4 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/install/environment.root.yml b/install/environment.root.yml
index 20075ba..acfbe7e 100644
--- a/install/environment.root.yml
+++ b/install/environment.root.yml
@@ -4,10 +4,14 @@ channels:
   - defaults
 dependencies:
   - graphviz=2.40.1
+  - jinja2=2.11.2
+  - networkx=2.4
   - pip=20.0.2
+  - pygments=2.6.1
+  - pygraphviz=1.3
   - python=3.7.4
   - singularity=3.5.2
   - pip:
     - pandas==1.0.1
-    - snakemake==5.10.0
+    - snakemake==5.19.2
 
diff --git a/install/environment.yml b/install/environment.yml
index 1f69c61..8fcba7a 100644
--- a/install/environment.yml
+++ b/install/environment.yml
@@ -1,11 +1,16 @@
 name: zarp
 channels:
+  - conda-forge
   - defaults
 dependencies:
   - graphviz=2.40.1
+  - jinja2=2.11.2
+  - networkx=2.4
   - pip=20.0.2
+  - pygments=2.6.1
+  - pygraphviz=1.3
   - python=3.7.4
   - pip:
     - pandas==1.0.1
-    - snakemake==5.10.0
+    - snakemake==5.19.2
 
diff --git a/tests/test_integration_workflow/test.local.sh b/tests/test_integration_workflow/test.local.sh
index 16d7157..883424d 100755
--- a/tests/test_integration_workflow/test.local.sh
+++ b/tests/test_integration_workflow/test.local.sh
@@ -3,11 +3,14 @@
 # Tear down test environment
 cleanup () {
     rc=$?
+    rm -rf .cache/
+    rm -rf .config/
     rm -rf .fontconfig/
     rm -rf .java/
     rm -rf .snakemake/
     rm -rf logs/
     rm -rf results/
+    rm -rf snakemake_report.html
     cd $user_dir
     echo "Exit status: $rc"
 }
@@ -32,6 +35,12 @@ snakemake \
     --singularity-args="--bind ${PWD}/../input_files,${PWD}/../../images" \
     --verbose
 
+# Create a Snakemake report after the workflow execution
+snakemake \
+    --snakefile="../../Snakefile" \
+    --configfile="../input_files/config.yaml" \
+    --report="snakemake_report.html"
+
 # Check md5 sum of some output files
 find results/ -type f -name \*\.gz -exec gunzip '{}' \;
 find results/ -type f -name \*\.zip -exec sh -c 'unzip -o {} -d $(dirname {})' \;
diff --git a/tests/test_integration_workflow/test.slurm.sh b/tests/test_integration_workflow/test.slurm.sh
index fef99cc..0145ae7 100755
--- a/tests/test_integration_workflow/test.slurm.sh
+++ b/tests/test_integration_workflow/test.slurm.sh
@@ -3,11 +3,14 @@
 # Tear down test environment
 cleanup () {
     rc=$?
+    rm -rf .cache/
+    rm -rf .config/
     rm -rf .fontconfig/
     rm -rf .java/
     rm -rf .snakemake/
     rm -rf logs/
     rm -rf results/
+    rm -rf snakemake_report.html
     cd $user_dir
     echo "Exit status: $rc"
 }
@@ -34,6 +37,12 @@ snakemake \
     --singularity-args="--bind ${PWD}/../input_files,${PWD}/../../images" \
     --verbose
 
+# Create a Snakemake report after the workflow execution
+snakemake \
+    --snakefile="../../Snakefile" \
+    --configfile="../input_files/config.yaml" \
+    --report="snakemake_report.html"
+
 # Check md5 sum of some output files
 find results/ -type f -name \*\.gz -exec gunzip '{}' \;
 find results/ -type f -name \*\.zip -exec sh -c 'unzip -o {} -d $(dirname {})' \;
-- 
GitLab