From 19b55fc67cd61ddbffb2211636366a0bf8012213 Mon Sep 17 00:00:00 2001
From: sruthipsuresh <sruthiprabhasuresh@gmail.com>
Date: Wed, 27 Jan 2021 08:09:49 -0600
Subject: [PATCH] Fixed intersect, complement indentation issues

---
 software/bedtools/complement/main.nf  | 18 +++++++++-----
 software/bedtools/complement/meta.yml |  1 -
 software/bedtools/intersect/main.nf   | 34 +++++++++++++--------------
 software/bedtools/intersect/meta.yml  | 11 +++++----
 4 files changed, 36 insertions(+), 28 deletions(-)

diff --git a/software/bedtools/complement/main.nf b/software/bedtools/complement/main.nf
index 7dce461d..850be828 100644
--- a/software/bedtools/complement/main.nf
+++ b/software/bedtools/complement/main.nf
@@ -26,10 +26,16 @@ process BEDTOOLS_COMPLEMENT {
     path  "*.version.txt"                    , emit: version
 
     script:
-        def software = getSoftwareName(task.process)
-        def prefix   = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
-        """
-        bedtools complement -i $beds -g $sizes ${options.args} > ${prefix}.complement.bed
-        bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt
-        """
+    def software = getSoftwareName(task.process)
+    def prefix   = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
+    """
+    bedtools \\
+        complement \\
+        -i $beds \\
+        -g $sizes \\
+        $options.args \\
+        > ${prefix}.complement.bed
+
+    bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt
+    """
 }
diff --git a/software/bedtools/complement/meta.yml b/software/bedtools/complement/meta.yml
index a4cd9eee..1ab533ac 100644
--- a/software/bedtools/complement/meta.yml
+++ b/software/bedtools/complement/meta.yml
@@ -8,7 +8,6 @@ tools:
         description: |
             A set of tools for genomic analysis tasks, specifically enabling genome arithmetic (merge, count, complement) on various file types.
         documentation: https://bedtools.readthedocs.io/en/latest/content/tools/complement.html
-
 params:
     - outdir:
         type: string
diff --git a/software/bedtools/intersect/main.nf b/software/bedtools/intersect/main.nf
index 2dd6f2d8..16c11da1 100644
--- a/software/bedtools/intersect/main.nf
+++ b/software/bedtools/intersect/main.nf
@@ -20,22 +20,22 @@ process BEDTOOLS_INTERSECT {
 
     input:
     tuple val(meta), path(bed1), path(bed2)
-    
-    output:
-        tuple val(meta), path("*.intersect.bed"), emit: bed
-        path  "*.version.txt", emit: version
 
-    script: // TODO change script to account for multiple possible intersections
-        def software = getSoftwareName(task.process)
-        def prefix   = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
-        """
-        bedtools \\
-            intersect \\
-            -a ${bed1} \\
-            -b ${bed2} \\
-            $options.args \\
-            > ${prefix}.intersect.bed
-            
-        bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt
-        """
+    output:
+    tuple val(meta), path("*.intersect.bed"), emit: bed
+    path  "*.version.txt", emit: version
+
+    script:
+    def software = getSoftwareName(task.process)
+    def prefix   = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
+    """
+    bedtools \\
+        intersect \\
+        -a ${bed1} \\
+        -b ${bed2} \\
+        $options.args \\
+        > ${prefix}.intersect.bed
+
+    bedtools --version | sed -e "s/bedtools v//g" > ${software}.version.txt
+    """
 }
diff --git a/software/bedtools/intersect/meta.yml b/software/bedtools/intersect/meta.yml
index b6e5e91c..03b00c80 100644
--- a/software/bedtools/intersect/meta.yml
+++ b/software/bedtools/intersect/meta.yml
@@ -9,7 +9,6 @@ tools:
         description: |
             A set of tools for genomic analysis tasks, specifically enabling genome arithmetic (merge, count, complement) on various file types.
         documentation: https://bedtools.readthedocs.io/en/latest/content/tools/intersect.html
-
 params:
     - outdir:
         type: string
@@ -33,10 +32,15 @@ input:
         description: |
             Groovy Map containing sample information
             e.g. [ id:'test', single_end:false ]
-    - bed:
+    - bed1:
         type: file
-        description: List of bed files
+        description: Bed file, each feature in 1 is compared to 2 in search of overlaps
         pattern: "*.{bed}"
+    - bed2:
+        type: file
+        description: Second bed file, used to compare to 1.
+        pattern: "*.{bed}"
+
 output:
     - meta:
         type: map
@@ -52,7 +56,6 @@ output:
         type: file
         description: File containing software version
         pattern: "*.{version.txt}"
-
 authors:
     -"@Emiller88"
     -"@sruthipsuresh"