diff multiIntersectBed.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/multiIntersectBed.xml	Tue Nov 04 01:45:04 2014 -0500
+++ b/multiIntersectBed.xml	Thu Jan 08 14:25:51 2015 -0500
@@ -6,108 +6,92 @@
     <expand macro="requirements" />
     <expand macro="stdio" />
     <command>
-        multiIntersectBed
+<![CDATA[
+        bedtools multiinter
         $header
+        $cluster
+        -filler "${filler}"
         #if $zero.value == True:
             -empty
-            -g ${chromInfo}
-        #end if
-        
-        -i '$input1'
-        '$input2'
-        #for $q in $beds
-            '${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 $file in $tag.beds:
+                "${file.input}"
+            #end for
+            -names
+            #for $file in $tag.beds:
+                "{$file.custom_name}"
+            #end for
         #end if
 
-        #for $q in $beds
-            #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="bed" type="data" label="First sorted BED 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="bed" type="data" multiple="True" label="BED 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="bed" type="data" label="Second sorted BED 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="beds" title="Add BED files" min="2" >
+                    <param name="input" format="bed" type="data" multiple="True" label="BED 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="beds" title="Add'l sorted BED files" >
-            <param name="input" format="bed" type="data" label="BED 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 that are not covered by any of the files" help="If set, regions that are not overlapped by any file will also be reported. Requires a valid organism key for all input datasets" />
+        <expand macro="genome" />
+        <param name="cluster" type="boolean" checked="false" truevalue="-cluster" falsevalue="" 
+            label="Invoke Ryan Layers's clustering algorithm"
+            help="(-cluster)" />
+        <param name="zero" type="boolean" checked="true"
+            label="Report regions that are not covered by any of the files"
+            help="If set, regions that are not overlapped by any file 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="Common intervals identified from among ${input1.name}, ${input2.name} and so on." />
+        <data format="bed" name="output" />
     </outputs>
+    <tests>
+        <test>
+            <param name="tag_select" value="tag"/>
+            <param name="inputs" value="multiIntersectBed1.bed,multiIntersectBed2.bed,multiIntersectBed3.bed" ftype="bed" />
+            <param name="zero" value="False"/>
+            <output name="output" file="multiIntersectBed_result1.bed" ftype="bed" />
+        </test>
+        <test>
+            <param name="tag_select" value="tag"/>
+            <param name="inputs" value="multiIntersectBed1.bed,multiIntersectBed2.bed,multiIntersectBed3.bed" ftype="bed" />
+            <param name="header" value="True"/>
+            <param name="zero" value="False"/>
+            <output name="output" file="multiIntersectBed_result2.bed" lines_diff="2" ftype="bed" />
+        </test>
+        <test>
+            <param name="tag_select" value="tag"/>
+            <param name="inputs" value="multiIntersectBed1.bed,multiIntersectBed2.bed,multiIntersectBed3.bed" ftype="bed" />
+            <param name="zero" value="True"/>
+            <param name="genome" value="multiIntersectBed1.len"/>
+            <output name="output" file="multiIntersectBed_result3.bed" ftype="bed" />
+        </test>
+    </tests>
     <help>
-    
+<![CDATA[
 **What it does**
 
-This tool identifies common intervals among multiple, sorted BED files. Intervals can be common among 0 to N of the N input BED files. The pictorial and raw data examples below illustrate the behavior of this tool more clearly.
-
-
-.. image:: http://people.virginia.edu/~arq5x/files/bedtools-galaxy/mbi.png
+This tool identifies common intervals among multiple, sorted BED files. Intervals can be common among 0 to N of the N input BED files.
 
 
 .. class:: warningmark
@@ -131,7 +115,7 @@
 **Example input**::
 
     # a.bed
-    chr1  6   12
+    chr1  6   12bed
     chr1  10  20
     chr1  22  27
     chr1  24  30
@@ -190,7 +174,7 @@
 
 
 @REFERENCES@
-
+]]>
     </help>
     <expand macro="citations" />
 </tool>