From 7c79779594fa77c8f5fbbee70b4ddb4888ea5553 Mon Sep 17 00:00:00 2001
From: aknecht2 <aknecht2@unl.edu>
Date: Sat, 9 Apr 2016 16:06:02 -0500
Subject: [PATCH] Updated conf to include tagalign files.  Renamed script files
 from wrappers.  Added cat_spp for ungzipped results.  Updated peak_call.yaml
 to rename .bed files to .tagAlign for spp.

---
 chipathlon/conf.py                            |  2 +-
 chipathlon/jobs/modules/peak_call.yaml        | 20 ++++++++++++++++--
 .../jobs/params/cat_awk_sort_peaks.yaml       | 21 +++++++++++++++++++
 chipathlon/jobs/params/mv_bed_tagalign.yaml   | 21 +++++++++++++++++++
 .../jobs/params/sort_awk_sort_peaks.yaml      |  2 +-
 .../jobs/params/zcat_awk_sort_peaks.yaml      |  2 +-
 chipathlon/jobs/scripts/cat_spp.sh            |  3 +++
 chipathlon/jobs/scripts/mv_bed_tagalign.sh    |  3 +++
 .../{sort_wrapper.sh => sort_macs2.sh}        |  0
 .../scripts/{zcat_wrapper.sh => zcat_spp.sh}  |  0
 10 files changed, 69 insertions(+), 5 deletions(-)
 create mode 100644 chipathlon/jobs/params/cat_awk_sort_peaks.yaml
 create mode 100644 chipathlon/jobs/params/mv_bed_tagalign.yaml
 create mode 100644 chipathlon/jobs/scripts/cat_spp.sh
 create mode 100644 chipathlon/jobs/scripts/mv_bed_tagalign.sh
 rename chipathlon/jobs/scripts/{sort_wrapper.sh => sort_macs2.sh} (100%)
 rename chipathlon/jobs/scripts/{zcat_wrapper.sh => zcat_spp.sh} (100%)

diff --git a/chipathlon/conf.py b/chipathlon/conf.py
index 38c2691..b76e140 100644
--- a/chipathlon/conf.py
+++ b/chipathlon/conf.py
@@ -17,7 +17,7 @@ file_extensions = {
     "sai": ["sai"],
     "sam": ["sam"],
     "bam": ["bam"],
-    "bed": ["bed", "narrowPeak", "broadPeak"],
+    "bed": ["bed", "narrowPeak", "broadPeak", "tagAlign"],
     "bwa_genome": ["amb", "ann", "bwt", "pac", "sa"],
     "bowtie2_genome": ["1.bt2", "2.bt2", "3.bt2", "4.bt2", "rev.1.bt2", "rev.2.bt2"],
     "quality": ["quality"],
diff --git a/chipathlon/jobs/modules/peak_call.yaml b/chipathlon/jobs/modules/peak_call.yaml
index 3f68d0a..ea10a30 100644
--- a/chipathlon/jobs/modules/peak_call.yaml
+++ b/chipathlon/jobs/modules/peak_call.yaml
@@ -1,12 +1,28 @@
 peak_call:
   - spp[tool]:
-    - r_spp_nodups:
+    - mv_bed_tagalign:
         inputs:
           - exp.bed:
               type: file
+        additional_inputs: null
+        outputs:
+          - exp.tagAlign:
+              type: file
+    - mv_bed_tagalign:
+        inputs:
           - control.bed:
               type: file
         additional_inputs: null
+        outputs:
+          - control.tagAlign:
+              type: file
+    - r_spp_nodups:
+        inputs:
+          - exp.tagAlign:
+              type: file
+          - control.tagAlign:
+              type: file
+        additional_inputs: null
         outputs:
           - results.narrowPeak:
               type: file
@@ -14,7 +30,7 @@ peak_call:
               type: file
           - results.ccscore:
               type: file
-    - zcat_awk_sort_peaks:
+    - cat_awk_sort_peaks:
         inputs:
           - results.narrowPeak:
               type: file
diff --git a/chipathlon/jobs/params/cat_awk_sort_peaks.yaml b/chipathlon/jobs/params/cat_awk_sort_peaks.yaml
new file mode 100644
index 0000000..d4cafc0
--- /dev/null
+++ b/chipathlon/jobs/params/cat_awk_sort_peaks.yaml
@@ -0,0 +1,21 @@
+cat_awk_sort_peaks:
+  inputs:
+    - bed:
+        type: file
+  additional_inputs: null
+  outputs:
+    - bed:
+        type: file
+  command: cat_spp
+  arguments:
+    - "$inputs.0":
+        changeable: false
+        required: true
+        has_value: false
+    - "$outputs.0":
+        changeable: false
+        required: true
+        has_value: false
+  walltime: 2000
+  memory: 2000
+  cores: 1
diff --git a/chipathlon/jobs/params/mv_bed_tagalign.yaml b/chipathlon/jobs/params/mv_bed_tagalign.yaml
new file mode 100644
index 0000000..5b54086
--- /dev/null
+++ b/chipathlon/jobs/params/mv_bed_tagalign.yaml
@@ -0,0 +1,21 @@
+zcat_awk_sort_peaks:
+  inputs:
+    - bed:
+        type: file
+  additional_inputs: null
+  outputs:
+    - bed:
+        type: file
+  command: mv_bed_tagalign
+  arguments:
+    - "$inputs.0":
+        changeable: false
+        required: true
+        has_value: false
+    - "$outputs.0":
+        changeable: false
+        required: true
+        has_value: false
+  walltime: 2000
+  memory: 2000
+  cores: 1
diff --git a/chipathlon/jobs/params/sort_awk_sort_peaks.yaml b/chipathlon/jobs/params/sort_awk_sort_peaks.yaml
index 1271f40..3979e68 100644
--- a/chipathlon/jobs/params/sort_awk_sort_peaks.yaml
+++ b/chipathlon/jobs/params/sort_awk_sort_peaks.yaml
@@ -6,7 +6,7 @@ sort_awk_sort_peaks:
   outputs:
     - bed:
         type: file
-  command: sort
+  command: sort_macs2
   arguments:
     - "$inputs.0":
         changeable: false
diff --git a/chipathlon/jobs/params/zcat_awk_sort_peaks.yaml b/chipathlon/jobs/params/zcat_awk_sort_peaks.yaml
index f226897..cebf20e 100644
--- a/chipathlon/jobs/params/zcat_awk_sort_peaks.yaml
+++ b/chipathlon/jobs/params/zcat_awk_sort_peaks.yaml
@@ -6,7 +6,7 @@ zcat_awk_sort_peaks:
   outputs:
     - bed:
         type: file
-  command: zcat
+  command: zcat_spp
   arguments:
     - "$inputs.0":
         changeable: false
diff --git a/chipathlon/jobs/scripts/cat_spp.sh b/chipathlon/jobs/scripts/cat_spp.sh
new file mode 100644
index 0000000..54abba4
--- /dev/null
+++ b/chipathlon/jobs/scripts/cat_spp.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+/bin/cat "$1" | awk 'BEGIN{OFS="\t"}{print $1,int($2),int($3),$4,$5,$6,$7,$8,$9,$10;}' > "$2"
diff --git a/chipathlon/jobs/scripts/mv_bed_tagalign.sh b/chipathlon/jobs/scripts/mv_bed_tagalign.sh
new file mode 100644
index 0000000..f5def69
--- /dev/null
+++ b/chipathlon/jobs/scripts/mv_bed_tagalign.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+/bin/mv "$1" "$2"
diff --git a/chipathlon/jobs/scripts/sort_wrapper.sh b/chipathlon/jobs/scripts/sort_macs2.sh
similarity index 100%
rename from chipathlon/jobs/scripts/sort_wrapper.sh
rename to chipathlon/jobs/scripts/sort_macs2.sh
diff --git a/chipathlon/jobs/scripts/zcat_wrapper.sh b/chipathlon/jobs/scripts/zcat_spp.sh
similarity index 100%
rename from chipathlon/jobs/scripts/zcat_wrapper.sh
rename to chipathlon/jobs/scripts/zcat_spp.sh
-- 
GitLab