changeset 4:4afb4a5f0924 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/samtools/sam_to_bam commit 411130b45dc30f7f24f41cdeec5e148c5d8faf40
author iuc
date Tue, 09 May 2017 11:18:00 -0400
parents 6bb1b0a4652f
children d6181de75bdd
files macros.xml sam_to_bam.xml test-data/cached_locally/all_fasta.loc test-data/cached_locally/fasta_indexes.loc test-data/chr_m.fasta.fai tool_data_table_conf.xml.test tool_dependencies.xml
diffstat 7 files changed, 53 insertions(+), 55 deletions(-) [+]
line wrap: on
line diff
--- a/macros.xml	Fri Dec 18 19:42:41 2015 -0500
+++ b/macros.xml	Tue May 09 11:18:00 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>echo $(samtools --version | head -n 1)", "$(samtools --version | grep -o -E "htslib.*?")</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/sam_to_bam.xml	Fri Dec 18 19:42:41 2015 -0500
+++ b/sam_to_bam.xml	Tue May 09 11:18:00 2017 -0400
@@ -1,23 +1,34 @@
-<tool id="sam_to_bam" name="SAM-to-BAM" version="2.1">
-  <description>convert SAM to BAM</description>
-  <macros>
-    <import>macros.xml</import>
-  </macros>
-  <expand macro="requirements"></expand>
-  <expand macro="stdio"></expand>
-  <expand macro="version_command"></expand>
-  <command>
-    <![CDATA[
+<tool id="sam_to_bam" name="SAM-to-BAM" version="2.1.1">
+    <description>convert SAM to BAM</description>
+
+    <macros>
+        <import>macros.xml</import>
+    </macros>
+    <expand macro="requirements"/>
+    <expand macro="stdio"/>
+    <expand macro="version_command"/>
+
+    <command><![CDATA[
         #if $source.index_source == "history":
-          ln -s $source.ref_file input.fa &&
-          samtools faidx input.fa &&
+            ln -s '${source.ref_file}' input.fa &&
+            samtools faidx input.fa &&
         #else
-          ln -s ${source.index.fields.path} input.fa &&
-          ln -s ${source.index.fields.path}.fai input.fa.fai &&
+            ln -s '${source.index.fields.path}' input.fa &&
+            ln -s '${source.index.fields.path}.fai' input.fa.fai &&
         #end if
-        samtools view -b -@ \${GALAXY_SLOTS:-1} -t input.fa.fai "$input1" | samtools sort -O bam -@ \${GALAXY_SLOTS:-1} -o "$output1" -T temp
-    ]]>
-    </command>
+
+        samtools view
+            -b
+            -@ \${GALAXY_SLOTS:-1}
+            -t input.fa.fai '$input1' |
+
+        samtools sort
+            -O bam
+            -@ \${GALAXY_SLOTS:-1}
+            -o '$output1'
+            -T temp
+    ]]></command>
+
     <inputs>
         <conditional name="source">
             <param label="Choose the source for the reference genome" name="index_source" type="select">
@@ -25,11 +36,11 @@
                 <option value="history">Use a genome from the history</option>
             </param>
             <when value="cached">
-                <param format="sam" label="SAM file to convert" metadata_name="dbkey" name="input1" type="data">
+                <param name="input1" type="data" format="sam" label="SAM file to convert">
                     <validator type="unspecified_build" />
                     <validator message="Sequences are not currently available for the specified build." metadata_column="1" metadata_name="dbkey" table_name="fasta_indexes" type="dataset_metadata_in_data_table" />
                 </param>
-                <param label="Using reference genome" name="index" type="select">
+                <param name="index" type="select" label="Using reference genome">
                     <options from_data_table="fasta_indexes">
                         <filter column="1" key="dbkey" ref="input1" type="data_meta" />
                         <validator message="No reference genome is available for the build associated with the selected input dataset" type="no_options" />
@@ -37,13 +48,13 @@
                 </param>
             </when>
             <when value="history">
-                <param format="sam" label="SAM file to convert" name="input1" type="data" />
-                <param format="fasta" label="Using reference file" metadata_name="dbkey" name="ref_file" type="data" />
+                <param name="input1" type="data" format="sam" label="SAM file to convert" />
+                <param name="ref_file" type="data" format="fasta" label="Using reference file" />
             </when>
         </conditional>
     </inputs>
     <outputs>
-        <data format="bam" label="${tool.name} on ${on_string}: converted BAM" name="output1">
+        <data name="output1" format="bam" label="${tool.name} on ${on_string}: converted BAM">
             <actions>
                 <conditional name="source.index_source">
                     <when value="cached">
@@ -64,26 +75,26 @@
         <test>
             <param name="index_source" value="history" />
             <param name="input1" ftype="sam" value="sam_to_bam_in1.sam" />
-            <param dbkey="equCab2" ftype="fasta" name="ref_file" value="chr_m.fasta" />
-            <output file="sam_to_bam_out1.bam" ftype="bam" name="output1" />
+            <param name="ref_file" ftype="fasta" dbkey="equCab2" value="chr_m.fasta" />
+            <output name="output1" ftype="bam" file="sam_to_bam_out1.bam" />
+        </test>
+        <test>
+            <param name="index_source" value="cached" />
+            <param name="input1" ftype="sam" dbkey="equCab2" value="sam_to_bam_in1.sam" />
+            <param name="index" value="equCab2chrM" />
+            <output name="output1" ftype="bam" file="sam_to_bam_out2.bam" />
         </test>
         <test>
             <param name="index_source" value="history" />
             <param name="input1" ftype="sam" value="sam_to_bam_noheader_in2.sam" />
-            <param dbkey="equCab2" ftype="fasta" name="ref_file" value="chr_m.fasta" />
-            <output file="sam_to_bam_out3.bam" ftype="bam" name="output1" />
+            <param name="ref_file" ftype="fasta" dbkey="equCab2" value="chr_m.fasta" />
+            <output name="output1" ftype="bam" file="sam_to_bam_out3.bam" />
         </test>
     </tests>
-    <help>
-<![CDATA[
+    <help><![CDATA[
 **What it does**
 
-Converts SAM dataset into its binary, BAM, representation using ``samtools sort`` and ``view`` commands::
-
-  samtools sort -O bam -o sorted_input.bam [INPUT SAM] 
-  samtools view -b -h -o -T [REFERENCE GENOME] [OUTPUT BAM] sorted_input.bam
-
-]]>
-  </help>
-  <expand macro="citations"></expand>
+Converts SAM dataset into its binary, BAM, representation using the ``samtools view`` and ``sort`` commands.
+    ]]></help>
+    <expand macro="citations"/>
 </tool>
--- a/test-data/cached_locally/all_fasta.loc	Fri Dec 18 19:42:41 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-chrM	chr_m	Horse (Equus caballus): equCab2 chrM	${__HERE__}/chrM.fasta
--- a/test-data/cached_locally/fasta_indexes.loc	Fri Dec 18 19:42:41 2015 -0500
+++ b/test-data/cached_locally/fasta_indexes.loc	Tue May 09 11:18:00 2017 -0400
@@ -1,1 +1,1 @@
-chrM	chr_m	Horse (Equus caballus): equCab2 chrM	${__HERE__}/chrM.fasta
+equCab2chrM	equCab2	Horse (Equus caballus): equCab2 chrM	${__HERE__}/chr_m.fasta
--- a/test-data/chr_m.fasta.fai	Fri Dec 18 19:42:41 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-chrM	16660	6	50	51
--- a/tool_data_table_conf.xml.test	Fri Dec 18 19:42:41 2015 -0500
+++ b/tool_data_table_conf.xml.test	Tue May 09 11:18:00 2017 -0400
@@ -3,8 +3,4 @@
         <columns>value, dbkey, name, path</columns>
         <file path="${__HERE__}/test-data/cached_locally/fasta_indexes.loc" />
     </table>
-    <table name="all_fasta" comment_char="#">
-        <columns>value, dbkey, name, path</columns>
-        <file path="${__HERE__}/test-data/cached_locally/all_fasta.loc" />
-    </table>
-</tables>
\ No newline at end of file
+</tables>
--- a/tool_dependencies.xml	Fri Dec 18 19:42:41 2015 -0500
+++ /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="a55970300738" name="package_samtools_1_2" owner="iuc" toolshed="https://testtoolshed.g2.bx.psu.edu" />
-    </package>
-</tool_dependency>