diff unionBedGraphs.xml @ 1:82aac94b06c3 draft

Uploaded
author iuc
date Thu, 08 Jan 2015 14:25:51 -0500
parents b8348686a0b9
children 607c0576c6ab
line wrap: on
line diff
--- a/unionBedGraphs.xml	Tue Nov 04 01:45:04 2014 -0500
+++ b/unionBedGraphs.xml	Thu Jan 08 14:25:51 2015 -0500
@@ -1,106 +1,106 @@
-<tool id="bedtools_mergebedgraph" name="Merge BedGraph files" version="@WRAPPER_VERSION@.0">
+<tool id="bedtools_unionbedgraph" name="Merge BedGraph files" version="@WRAPPER_VERSION@.0">
     <description></description>
     <macros>
         <import>macros.xml</import>
     </macros>
     <expand macro="requirements" />
     <expand macro="stdio" />
-    <command>unionBedGraphs
+    <command>
+<![CDATA[
+    unionBedGraphs
         $header
-        -filler '$filler'
+        -filler "${filler}"
         #if $zero.value == True:
             -empty
-            -g ${chromInfo}
-        #end if
-        
-        -i '$input1'
-        '$input2'
-        #for $q in $bedgraphs
-            '${q.input}'
-        #end for
-
-        -names
-        #if $name1.choice == "tag":
-            '${input1.name}'
-        #else
-            '${name1.custom_name}'
+            -g $genome
         #end if
 
-        #if $name2.choice == "tag":
-            '${input2.name}'
-        #else
-            '${name2.custom_name}'
+        #if str($tag.tag_select) == "tag":
+            #set files = '" "'.join( [ str( $file ) for $file in $tag.inputs ] )
+            -i "${files}"
+        #else:
+            -i
+            #for $bg in $tag.bedgraphs:
+                "${bg.input}"
+            #end for
+            -names
+            #for $bg in $tag.bedgraphs:
+                "${bg.custom_name}"
+            #end for
         #end if
-
-        #for $q in $bedgraphs
-            #if $q.name.choice == "tag":
-                '${q.input.name}'
-            #else
-                '${q.input.custom_name}'
-            #end if
-        #end for
-        &gt; '$output'
+        > "${output}"
+]]>
     </command>
     <inputs>
-        <!-- Make it easy for the user, first two input files are always shown -->
-        <!-- INPUT 1 -->
-        <param name="input1" format="bedgraph" type="data" label="First BedGraph file" />
-        
-        <conditional name="name1">
-            <param name="choice" type="select" label="Sample name">
+        <conditional name="tag">
+            <param name="tag_select" type="select" label="Sample name">
                 <option value="tag" selected="true">Use input's tag</option>
-                <option value="custom">Enter custom table name</option>
+                <option value="custom">Enter custom name per file</option>
             </param>
             <when value="tag">
+                <param name="inputs" format="bedgraph" type="data" multiple="True" label="BedGraph files" />
             </when>
             <when value="custom">
-                <param name="custom_name" type="text" area="false" label="Custom sample name"/>
-            </when>
-        </conditional>
-
-        <!-- INPUT 2 -->
-        <param name="input2" format="bedgraph" type="data" label="Second BedGraph file" />
-        
-        <conditional name="name2">
-            <param name="choice" type="select" label="Sample name">
-                <option value="tag" selected="true">Use input's tag</option>
-                <option value="custom">Enter custom table name</option>
-            </param>
-            <when value="tag">
-            </when>
-            <when value="custom">
-                <param name="custom_name" type="text" area="false" label="Custom sample name"/>
+                <repeat name="bedgraphs" title="Add BedGraph files" min="2" >
+                    <param name="input" format="bedgraph" type="data" multiple="True" label="BedGraph file" />
+                    <param name="custom_name" type="text" area="false" label="Custom sample name"/>
+                </repeat>
             </when>
         </conditional>
-
-        <!-- Additional files, if the user needs more -->
-        <repeat name="bedgraphs" title="Add'l BedGraph files" >
-            <param name="input" format="bedgraph" type="data" label="BedGraph file" />
-            <conditional name="name">
-                <param name="choice" type="select" label="Sample name">
-                    <option value="tag" selected="true">Use input's tag</option>
-                    <option value="custom">Enter custom table name</option>
-                </param>
-                <when value="tag">
-                </when>
-                <when value="custom">
-                    <param name="custom_name" type="text" area="false" label="Custom sample name"/>
-                </when>
-            </conditional>
-        </repeat>
-
-        <param name="header" type="boolean" checked="true" truevalue="-header" falsevalue="" label="Print header line" help="The first line will include the name of each sample." />
-
-        <param name="zero" type="boolean" checked="true" label="Report regions with zero coverage" help="If set, regions without any coverage will also be reported. Requires a valid organism key for all input datasets" />
-
-        <param name="filler" type="text" value="0" label="Text to use for no-coverage value" help="Can be 0.0, N/A, - or any other value." />
+        <expand macro="genome" />
+        <param name="zero" type="boolean" checked="true"
+            label="Report regions with zero coverage"
+            help="If set, regions without any coverage will also be reported. Requires a valid organism key for all input datasets" />
+        <param name="filler" type="text" value="N/A"
+            label="Text to use for no-coverage value"
+            help="Can be 0.0, N/A, - or any other value. (-filler)" />
+        <expand macro="print_header" />
     </inputs>
-
     <outputs>
-        <data format="tabular" name="output"  metadata_source="input1" label="Merged BedGraphs of ${input1.name}, ${input2.name} and so on." />
+        <data name="output" format="bedgraph" />
     </outputs>
+    <tests>
+        <test>
+            <param name="tag_select" value="tag"/>
+            <param name="inputs" value="unionBedGraphs1.bg,unionBedGraphs2.bg,unionBedGraphs3.bg" ftype="bedgraph" />
+            <param name="zero" value="False"/>
+            <output name="output" file="unionBedGraphs_result1.bg" ftype="bedgraph" />
+        </test>
+        <test>
+            <param name="tag_select" value="tag"/>
+            <param name="inputs" value="unionBedGraphs1.bg,unionBedGraphs2.bg,unionBedGraphs3.bg" ftype="bedgraph" />
+            <param name="header" value="True"/>
+            <param name="zero" value="False"/>
+            <output name="output" file="unionBedGraphs_result2.bg" ftype="bedgraph" />
+        </test>
+        <test>
+            <param name="tag_select" value="tag"/>
+            <param name="inputs" value="unionBedGraphs1.bg,unionBedGraphs2.bg,unionBedGraphs3.bg" ftype="bedgraph" />
+            <param name="zero" value="True"/>
+            <param name="genome" value="unionBedGraphs1.len"/>
+            <output name="output" file="unionBedGraphs_result3.bg" ftype="bedgraph" />
+        </test>
+        <test>
+            <param name="tag_select" value="custom"/>
+            <repeat name="bedgraphs">
+                <param name="input" value="unionBedGraphs1.bg" />
+                <param name="custom_name" value="first" />
+            </repeat>
+            <repeat name="bedgraphs">
+                <param name="input" value="unionBedGraphs2.bg" />
+                <param name="custom_name" value="second" />
+            </repeat>
+            <repeat name="bedgraphs">
+                <param name="input" value="unionBedGraphs3.bg" />
+                <param name="custom_name" value="third" />
+            </repeat>
+            <param name="zero" value="True"/>
+            <param name="genome" value="unionBedGraphs1.len"/>
+            <output name="output" file="unionBedGraphs_result4.bg" ftype="bedgraph" />
+        </test>
+    </tests>
     <help>
-    
+<![CDATA[
 **What it does**
 
 This tool merges multiple BedGraph files, allowing direct and fine-scale coverage comparisons among many samples/files. The BedGraph files need not represent the same intervals; the tool will identify both common and file-specific intervals. In addition, the BedGraph values need not be numeric: one can use any text as the BedGraph value and the tool will compare the values from multiple files.
@@ -226,7 +226,7 @@
     chr1   600    700    0         0.43
 
 @REFERENCES@
- 
+]]>
     </help>
     <expand macro="citations" />
 </tool>