From fcb0102b8f1172efac2576aee731eb4d95497c97 Mon Sep 17 00:00:00 2001
From: ticlla <monicaroxana.ticllaccenhua@unibas.ch>
Date: Sun, 24 Nov 2019 20:26:26 +0100
Subject: [PATCH] add local rule to make report after MetaPhlAn2 rule has
 completed

---
 Snakefile | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/Snakefile b/Snakefile
index 825f6e0..9dd1b51 100644
--- a/Snakefile
+++ b/Snakefile
@@ -103,6 +103,7 @@ localrules:
     StrainPhlAn,
     rawQC_make_report,
     preQC_make_report,
+    MetaPhlAn2_make_report,
     PhlAnProf_make_report
 ##----------------------------------------------------------------------------##
 ## Run entire workflow
@@ -194,9 +195,27 @@ rule preQC_make_report:
         --report {params.report_path} \
         -s {params.workflow_dir}/Snakefile preQC) &>{log}
         '''
+        
+rule MetaPhlAn2_make_report:
+    output:
+        temp(touch(OUT_DIR+'/logs/metaphlan2_make_report.done'))
+    log:
+        OUT_DIR+'/logs/MetaPhlAn2_make_report.log'
+    params:
+        report_path = OUT_DIR+'/MetaPhlAn2_report.html',
+        workdir = workdir_path,
+        workflow_dir = workflow_path
+    shell:
+        '''
+        (snakemake \
+        --directory={params.workdir} \
+        --report {params.report_path} \
+        -s {params.workflow_dir}/Snakefile MetaPhlAn2) &>{log}
+        '''
+        
 rule PhlAnProf_make_report:
     output:
-        temp(touch(OUT_DIR+'/logs/preQC_make_report.done'))
+        temp(touch(OUT_DIR+'/logs/phlanprof_make_report.done'))
     log:
         OUT_DIR+'/logs/PhlAnProf_make_report.log'
     params:
-- 
GitLab