changeset 3:de833cc76a8e draft default tip

"planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/sambamba commit 1b6bff4ab8aaac8a247f603648f63bbadb02e1fe"
author artbio
date Thu, 30 Dec 2021 17:44:31 +0000
parents 7ad3484aa5db
children
files sambamba.xml test-data/regions.bed
diffstat 2 files changed, 40 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/sambamba.xml	Thu Dec 30 02:06:08 2021 +0000
+++ b/sambamba.xml	Thu Dec 30 17:44:31 2021 +0000
@@ -1,4 +1,4 @@
-<tool id="sambamba_sample_or_filter" name="Sample or Filter BAM" version="0.7.1+galaxy0">
+<tool id="sambamba_sample_or_filter" name="Sample, Slice or Filter BAM" version="0.7.1+galaxy1">
     <description>
         on flags, fields, and tags using Sambamba
     </description>
@@ -26,9 +26,14 @@
                  --subsampling-seed='$sambamba_options.seed'
                  -s '$sambamba_options.fraction'
                  -o '$outfile' input.bam
+        #end if
 
-        #else
-            sambamba slice -o '$outfile' input.bam $sambamba_options.region
+        #if $sambamba_options.selector == 'slice'
+            #if $sambamba_options.slice.slice_format == 'text'
+                sambamba slice -o '$outfile' input.bam $sambamba_options.slice.region
+            #else
+                sambamba slice --regions $sambamba_options.slice.bed_file -o '$outfile' input.bam
+            #end if
         #end if
     ]]></command>
     <inputs>
@@ -64,15 +69,27 @@
             </when>
 
             <when value="slice">
-                <param name="region" type="text" size="40" label="Region in format chr:beg-end">
-                    <help>
-                    Regions can be specified as 'chr2' (the whole chr2), 'chr2:1000000'
-                    (region starting from 1,000,000bp) or 'chr2:1,000,000-2,000,000'
-                    (region between 1,000,000 and 2,000,000bp including the end points).
-                    The coordinates are 1-based. NOTE that sambamba slice only outputs
-                    BAM-format datasets.
-                    </help>
-                </param>
+                <conditional name="slice">
+                    <param name="slice_format" type="select" label="specify in text field or a bed file">
+                        <option value="text">Specify in the region field</option>
+                        <option value="bed" selected="true">BED file</option>
+                    </param>
+                    <when value="bed">
+                        <param name="bed_file" type="data" format="bed" label="BED file"
+                               help="The coordinates are 0-based. NOTE that sambamba slice only outputs BAM-format datasets."/>
+                    </when>
+                    <when value="text">
+                        <param name="region" type="text" size="40" label="Region(s) in space-separated format chr:start-end">
+                            <help>
+                            Regions can be specified as 'chr2' (the whole chr2), 'chr2:1000000'
+                            (region starting from 1,000,000bp) or 'chr2:1,000,000-2,000,000'
+                            (region between 1,000,000 and 2,000,000bp including the end points).
+                            The coordinates are 1-based. NOTE that sambamba slice only outputs
+                            BAM-format datasets.
+                            </help>
+                        </param>
+                    </when>
+                </conditional>
             </when>
 
             <when value="sample">
@@ -131,10 +148,19 @@
         <test>
             <param name="input" value="c1215_fixmate.bam" ftype="bam" />
             <param name="selector" value="slice" />
+            <param name="slice_format" value="text" />
             <param name="query" value='' />
             <param name="region" value="AL096846:1000-2000 AL096846:4000-5000" />
             <output name="outfile" file="c1215_fixmate_region-sliced.bam" ftype="bam"/>
         </test>
+        <test>
+            <param name="input" value="c1215_fixmate.bam" ftype="bam" />
+            <param name="selector" value="slice" />
+            <param name="slice_format" value="bed" />
+            <param name="query" value='' />
+            <param name="bed_file" value="regions.bed" />
+            <output name="outfile" file="c1215_fixmate_region-sliced.bam" ftype="bam"/>
+        </test>
          <test>
             <param name="input" value="ex1_header.sam" ftype="sam" />
             <param name="selector" value="sample" />
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/regions.bed	Thu Dec 30 17:44:31 2021 +0000
@@ -0,0 +1,2 @@
+AL096846	999	2000
+AL096846	3999	5000