From 7dc23aaf2d22ac9b03bba2b839a295667decbf4a Mon Sep 17 00:00:00 2001
From: Yohan Jarosz <yohanjarosz@yahoo.fr>
Date: Tue, 21 Jul 2015 15:40:12 +0200
Subject: [PATCH] add report to output

---
 rules/Analysis/master.rules |  2 +-
 rules/Util.rules            | 10 +++-------
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/rules/Analysis/master.rules b/rules/Analysis/master.rules
index cf64cd3..458c618 100644
--- a/rules/Analysis/master.rules
+++ b/rules/Analysis/master.rules
@@ -164,7 +164,7 @@ def analysis_output_files():
         addon = ANALYSIS_OUTPUT_FILES['mt'] + ANALYSIS_OUTPUT_FILES['mt_only']
     all = expand('%s/{name}' % AN_OUT, name=addon)
     plots = analysis_plot_files_output()
-    return all + plots
+    return all + plots + ["%s/REPORT.html" % OUTPUTDIR]
 
 
 # include sub rules
diff --git a/rules/Util.rules b/rules/Util.rules
index 02fb97f..82ffbbd 100644
--- a/rules/Util.rules
+++ b/rules/Util.rules
@@ -104,6 +104,8 @@ rule DIAGRAMMS:
 rule REPORT:
     input:
         ["lib/imp.html", "lib/d3.min.js", "lib/jquery-2.1.1.min.js", "lib/imp.js"] + expand(["{dir}/workflow.png", "{dir}/workflow.pdf"], dir=OUTPUTDIR)
+    output:
+        "%s/REPORT.html" % OUTPUTDIR
     params:
         outdir = "%s" % OUTPUTDIR
     message:
@@ -112,16 +114,10 @@ rule REPORT:
         with open('%s/data.js' % OUTPUTDIR, 'w') as whandle:
             towrite = json.dumps(config)
             whandle.write("IMP_CONFIG = %s;" % towrite)
-            if os.path.exists('stats.json'):
-                with open('stats.json', 'r') as rhandle:
-                    towrite = json.load(rhandle)
-                    whandle.write("\nIMP_STATS = %s;" % towrite )
-        shell("cp {input[0]} {params.outdir}/IMP.html")
+        shell("cp {input[0]} {params.outdir}/REPORT.html")
         shell("cp {input[1]} {params.outdir}")
         shell("cp {input[2]} {params.outdir}")
         shell("cp {input[3]} {params.outdir}")
-        if os.path.exists('imp.log'):
-            shell("mv imp.log {params.outdir}")
 
 
 rule REPORT2:
-- 
GitLab