changeset 3:a4a10c7924d1 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/samtools/samtools_slice_bam commit 411130b45dc30f7f24f41cdeec5e148c5d8faf40
author iuc
date Tue, 09 May 2017 11:17:27 -0400
parents 2b474ebbfc7d
children 344fc91e1bfd
files macros.xml samtools_slice_bam.xml tool_dependencies.xml
diffstat 3 files changed, 39 insertions(+), 55 deletions(-) [+]
line wrap: on
line diff
--- a/macros.xml	Tue Apr 21 17:37:49 2015 -0400
+++ b/macros.xml	Tue May 09 11:17:27 2017 -0400
@@ -1,16 +1,17 @@
 <macros>
     <xml name="requirements">
         <requirements>
-            <requirement type="package" version="1.2">samtools</requirement>
+            <requirement type="package" version="1.3.1">samtools</requirement>
             <yield/>
         </requirements>
     </xml>
+    <token name="@TOOL_VERSION@">1.3.1</token>
     <xml name="citations">
         <citations>
             <citation type="bibtex">
                 @misc{SAM_def,
                 title={Definition of SAM/BAM format},
-                url = {https://samtools.github.io/hts-specs/SAMv1.pdf},}
+                url = {https://samtools.github.io/hts-specs/},}
             </citation>
             <citation type="doi">10.1093/bioinformatics/btp352</citation>
             <citation type="doi">10.1093/bioinformatics/btr076</citation>
@@ -41,7 +42,7 @@
         </citations>
     </xml>
     <xml name="version_command">
-        <version_command>samtools --version | head -n 1 | awk '{ print $2 }'</version_command>
+        <version_command><![CDATA[samtools 2>&1 | grep Version]]></version_command>
     </xml>
     <xml name="stdio">
         <stdio>
@@ -64,7 +65,5 @@
 5. Click **Save**
 
 The medatada will be re-detected and you will be able to see the list of reference sequences in the &quot;**Select references (chromosomes and contigs) you would like to restrict bam to**&quot; drop-down.
-
     </token>
-
 </macros>
--- a/samtools_slice_bam.xml	Tue Apr 21 17:37:49 2015 -0400
+++ b/samtools_slice_bam.xml	Tue May 09 11:17:27 2017 -0400
@@ -1,43 +1,40 @@
-<tool id="samtools_slice_bam" name="Slice" version="2.0">
-  <description>BAM by genomic regions</description>
-  <macros>
-    <import>macros.xml</import>
-  </macros>
-  <!-- <code file="samtools_slice_options.py"/> -->
-  <expand macro="requirements"></expand>
-  <expand macro="stdio"></expand>
-  <expand macro="version_command"></expand>
-    <command>
-<![CDATA[
-    ln -s "${input_bam}" temp_input.bam &&
-    ln -s "${input_bam.metadata.bam_index}" temp_input.bam.bai &&
+<tool id="samtools_slice_bam" name="Slice" version="2.0.1">
+    <description>BAM by genomic regions</description>
+    <macros>
+        <import>macros.xml</import>
+    </macros>
+
+    <expand macro="requirements"/>
+    <expand macro="stdio"/>
+    <expand macro="version_command"/>
+
+    <command><![CDATA[
+    ln -s '${input_bam}' temp_input.bam &&
+    ln -s '${input_bam.metadata.bam_index}' temp_input.bam.bai &&
 
     #if str($slice_method.slice_method_selector) == "bed":
-    
         samtools view -@ \${GALAXY_SLOTS:-1} -b -L "${input_interval}" -o unsorted_output.bam temp_input.bam && 
-
     #elif str($slice_method.slice_method_selector) == "chr":
-
         samtools view -@ \${GALAXY_SLOTS:-1} -b -o unsorted_output.bam temp_input.bam 
         ${ ' '.join( map( lambda x:'"%s"' % ( x ), str( $slice_method.refs ).split(",") ) ) } &&
-
     #elif str($slice_method.slice_method_selector) == "man":
-
         samtools view -@ \${GALAXY_SLOTS:-1} -b -o unsorted_output.bam temp_input.bam 
 
         #for $region in $slice_method.regions:
             "${region.chrom}:${region.start}-${region.end}"
         #end for
-
         &&
-
     #end if
 
-    samtools sort -O bam -T sorted -@ \${GALAXY_SLOTS:-1} -o "${output_bam}" unsorted_output.bam
-]]>
-    </command>
+    samtools sort
+        -O bam
+        -T sorted
+        -@ \${GALAXY_SLOTS:-1}
+        -o '${output_bam}'
+        unsorted_output.bam
+    ]]></command>
     <inputs>
-        <param name="input_bam" format="bam" label="Select BAM dataset to slice" type="data" />
+        <param name="input_bam" type="data" format="bam" label="Select BAM dataset to slice" />
         <conditional name="slice_method">
             <param name="slice_method_selector" type="select" label="How do you want to slice your dataset?">
                 <option value="bed">using a list of intervals from a BED dataset</option>
@@ -45,7 +42,7 @@
                 <option value="man">by chromosomes/contigs and coordinates</option>
             </param>
             <when value="bed">
-                <param format="bed" label="BED file" name="input_interval" type="data" help="BED datasets can be obtained using &quot;Get Data -> UCSC Main&quot; datasource."/>
+                <param name="input_interval" type="data" format="bed" label="BED file" help="BED datasets can be obtained using &quot;Get Data -> UCSC Main&quot; datasource" />
             </when>
             <when value="chr">
                 <param name="refs" type="select" optional="False" multiple="True" label="Select references (chromosomes and contigs) you would like to restrict bam to" help="Click and type in the box above to see options. You can select multiple entries. If &quot;No options available&quot; is displayed, you need to re-detect metadata on the input dataset. See help section below.">
@@ -75,49 +72,43 @@
                     <param name="start" type="integer" min="1" value="0" label="Enter START coordinate (1-based)"/>
                     <param name="end" type="integer" min="1" value="100" label="Enter END coordinate"/>
                 </repeat>
-
-
             </when>
         </conditional>
-
     </inputs>
     <outputs>
-        <data format="bam" name="output_bam" />
+        <data name="output_bam" format="bam" />
     </outputs>
     <tests>
         <test>
-            <param ftype="bam" name="input_bam" value="bam-slice-input.bam" />
+            <param name="input_bam" ftype="bam" value="bam-slice-input.bam" />
             <param name="slice_method_selector" value="bed"/>
-            <param ftype="bed" name="input_interval" value="bam-slice.bed" />
-            <output file="bam-slice-test1.bam" ftype="bam" name="output_bam" />
+            <param name="input_interval" ftype="bed" value="bam-slice.bed" />
+            <output name="output_bam" file="bam-slice-test1.bam" ftype="bam" />
         </test>
         <test>
-            <param ftype="bam" name="input_bam" value="bam-slice-input.bam" />
+            <param name="input_bam" ftype="bam" value="bam-slice-input.bam" />
             <param name="slice_method_selector" value="chr"/>
             <param name="refs" value="chrM" />
-            <output file="bam-slice-test2.bam" ftype="bam" name="output_bam" />
+            <output name="output_bam" file="bam-slice-test2.bam" ftype="bam" />
         </test>
         <test>
-            <param ftype="bam" name="input_bam" value="bam-slice-input.bam" />
+            <param name="input_bam" ftype="bam" value="bam-slice-input.bam" />
             <param name="slice_method_selector" value="man"/>
             <param name="chrom" value="chrM" />
             <param name="start" value="1" />
             <param name="end" value="1000" />
-            <output file="bam-slice-test3.bam" ftype="bam" name="output_bam" />
+            <output name="output_bam" file="bam-slice-test3.bam" ftype="bam" />
         </test>
     </tests>
-    <help>
-<![CDATA[
-
+    <help><![CDATA[
 **What it does**
 
-Allows to restrict (slice) input BAM dataset to a list of intervals defined in a BED file, individual chromosomes, or manually set list of coordinates. BED datasets can be obtained from **Get Data -> UCSC Main**.
+Allows to restrict (slice) input BAM dataset to a list of intervals defined in a BED file, individual chromosomes, or manually set list of coordinates.
+BED datasets can be obtained from **Get Data -> UCSC Main**.
 
 This tool is based on ``samtools view`` command. 
 
 @no-chrom-options@
-
-]]>
-  </help>
-    <expand macro="citations"></expand>
+    ]]></help>
+    <expand macro="citations"/>
 </tool>
--- a/tool_dependencies.xml	Tue Apr 21 17:37:49 2015 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-<?xml version="1.0"?>
-<tool_dependency>
-    <package name="samtools" version="1.2">
-        <repository changeset_revision="6eea04363026" name="package_samtools_1_2" owner="iuc" toolshed="https://toolshed.g2.bx.psu.edu" />
-    </package>
-</tool_dependency>