From db446d7d26277d357075478060f0749d0bcf5fcc Mon Sep 17 00:00:00 2001
From: aknecht2 <aknecht2@unl.edu>
Date: Tue, 12 Apr 2016 08:33:15 -0500
Subject: [PATCH] Updated conf to include excel files.  Added new output files
 to macs2 job & module.

---
 chipathlon/conf.py                                       | 3 ++-
 chipathlon/jobs/modules/peak_call.yaml                   | 6 +++++-
 chipathlon/jobs/params/macs2_callpeak.yaml               | 4 ++++
 .../jobs/scripts/{db_save_bed.py => db_save_result.py}   | 9 ++++++++-
 4 files changed, 19 insertions(+), 3 deletions(-)
 rename chipathlon/jobs/scripts/{db_save_bed.py => db_save_result.py} (69%)

diff --git a/chipathlon/conf.py b/chipathlon/conf.py
index ff35fd0..08a8378 100644
--- a/chipathlon/conf.py
+++ b/chipathlon/conf.py
@@ -47,7 +47,8 @@ file_extensions = {
     "quality": ["quality"],
     "qc": ["qc"],
     "pdf": ["pdf"],
-    "ccscore": ["ccscore"]
+    "ccscore": ["ccscore"],
+    "xls": ["xls"]
 }
 
 # list of resources that can be specified per job (step) in
diff --git a/chipathlon/jobs/modules/peak_call.yaml b/chipathlon/jobs/modules/peak_call.yaml
index c3f61db..2f45804 100644
--- a/chipathlon/jobs/modules/peak_call.yaml
+++ b/chipathlon/jobs/modules/peak_call.yaml
@@ -49,7 +49,11 @@ peak_call:
               type: argument
         additional_inputs: null
         outputs:
-          - results.narrowPeak:
+          - peaks.narrowPeak:
+              type: file
+          - peaks.xls:
+              type: file
+          - summits.bed:
               type: file
     - sort_awk_sort_peaks:
         inputs:
diff --git a/chipathlon/jobs/params/macs2_callpeak.yaml b/chipathlon/jobs/params/macs2_callpeak.yaml
index 8c60ac9..f0c48d5 100644
--- a/chipathlon/jobs/params/macs2_callpeak.yaml
+++ b/chipathlon/jobs/params/macs2_callpeak.yaml
@@ -10,6 +10,10 @@ macs2_callpeak:
   outputs:
     - bed:
         type: file
+    - xls:
+        type: file
+    - bed:
+        type: file
   command: macs2
   arguments:
     - callpeak:
diff --git a/chipathlon/jobs/scripts/db_save_bed.py b/chipathlon/jobs/scripts/db_save_result.py
similarity index 69%
rename from chipathlon/jobs/scripts/db_save_bed.py
rename to chipathlon/jobs/scripts/db_save_result.py
index 35c82d5..ca983f2 100644
--- a/chipathlon/jobs/scripts/db_save_bed.py
+++ b/chipathlon/jobs/scripts/db_save_result.py
@@ -5,8 +5,15 @@ parser = argparse.ArgumentParser(description="Insert a bed file into the databas
 parser.add_argument("-p", "--password", dest="password", required=True, help="Database user password.")
 parser.add_argument("-u", "--username", dest="username", required=True, help="Database user.")
 parser.add_argument("-h", "--host", dest="host", required=True, help="Database host.")
-parser.add_argument("-f", "--file", dest="file", required=True, help="Path to bed file.")
+parser.add_argument("-f", "--file", dest="file", required=True, help="Path to result file.")
 parser.add_argument("-c", "--controls", dest="control_ids", required=True, nargs="+", help="List of control ids.")
 parser.add_argument("-e", "--experiments", dest="experiment_ids", required=True, nargs="+", help="List of experiment/signal ids.")
 parser.add_argument("-a", "--additional", dest="additional")
+parser.add_argument("-t", "--type", dest="type", required=True, help="Type of result file to save [bed, peak]")
 args = parser.parse_args()
+
+mdb = chipathlon.db.MongoDB(args.host, args.username, args.password)
+if args.type() == "bed":
+    mdb.save_bed(args.f, args.c, args.e, {})
+elif args.type() == "peak":
+    mdb.save_peak(args.f, args.c, args.e, {})
-- 
GitLab