diff sam_to_bam.xml @ 11:1e69848b596f draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/samtools/sam_to_bam commit 0f75269223c0821c6c82acf98fde947d0f816f2b"
author iuc
date Tue, 28 Sep 2021 16:11:24 +0000
parents cf1ffd88f895
children 9bd1568619cd
line wrap: on
line diff
--- a/sam_to_bam.xml	Thu Oct 17 02:17:48 2019 -0400
+++ b/sam_to_bam.xml	Tue Sep 28 16:11:24 2021 +0000
@@ -1,4 +1,4 @@
-<tool id="sam_to_bam" name="SAM-to-BAM" version="2.1.1">
+<tool id="sam_to_bam" name="SAM-to-BAM" version="2.1.2" profile="@PROFILE@">
     <description>convert SAM to BAM</description>
 
     <macros>
@@ -9,62 +9,39 @@
     <expand macro="version_command"/>
 
     <command><![CDATA[
-        #if $source.index_source == "history":
-            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 &&
-        #end if
+        @ADDTHREADS@
+        @ADDMEMORY@
+        @PREPARE_FASTA_IDX@
 
         samtools view
             -b
-            -@ \${GALAXY_SLOTS:-1}
-            -t input.fa.fai '$input1' |
+            -@ \$addthreads
+            -t '$reffai'
+            '$input' |
 
         samtools sort
             -O bam
-            -@ \${GALAXY_SLOTS:-1}
+            -@ \$addthreads -m \$addmemory"M"
             -o '$output1'
             -T "\${TMPDIR:-.}"
     ]]></command>
 
     <inputs>
-        <conditional name="source">
-            <param label="Choose the source for the reference genome" name="index_source" type="select">
-                <option value="cached">Use a built-in genome</option>
-                <option value="history">Use a genome from the history</option>
-            </param>
-            <when value="cached">
-                <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 name="index" type="select" label="Using reference genome">
-                    <options from_data_table="fasta_indexes">
-                        <filter column="dbkey" 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" />
-                    </options>
-                </param>
-            </when>
-            <when value="history">
-                <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>
+        <param name="input" type="data" format="sam" label="SAM file to convert"/>
+        <expand macro="mandatory_reference" argument="-t"/>
     </inputs>
     <outputs>
         <data name="output1" format="bam" label="${tool.name} on ${on_string}: converted BAM">
             <actions>
-                <conditional name="source.index_source">
+                <conditional name="addref_cond.addref_select">
                     <when value="cached">
                         <action name="dbkey" type="metadata">
-                            <option name="source.input1" param_attribute="dbkey" type="from_param" />
+                            <option name="input" param_attribute="dbkey" type="from_param" />
                         </action>
                     </when>
                     <when value="history">
                         <action name="dbkey" type="metadata">
-                            <option name="source.ref_file" param_attribute="dbkey" type="from_param" />
+                            <option name="addref_cond.ref" param_attribute="dbkey" type="from_param" />
                         </action>
                     </when>
                 </conditional>
@@ -73,22 +50,22 @@
     </outputs>
     <tests>
         <test>
-            <param name="index_source" value="history" />
-            <param name="input1" ftype="sam" value="sam_to_bam_in1.sam" />
-            <param name="ref_file" ftype="fasta" dbkey="equCab2" value="chr_m.fasta" />
-            <output name="output1" ftype="bam" file="sam_to_bam_out1.bam" />
+            <param name="addref_select" value="history" />
+            <param name="ref" ftype="fasta" dbkey="equCab2" value="chr_m.fasta" />
+            <param name="input" ftype="sam" value="sam_to_bam_in1.sam" />
+            <output name="output1" ftype="bam" file="sam_to_bam_out1.bam" lines_diff="4"/>
         </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" />
+            <param name="addref_select" value="cached" />
+            <param name="ref" value="equCab2chrM" />
+            <param name="input" ftype="sam" dbkey="equCab2" value="sam_to_bam_in1.sam" />
+            <output name="output1" ftype="bam" file="sam_to_bam_out2.bam" lines_diff="4"/>
         </test>
         <test>
-            <param name="index_source" value="history" />
-            <param name="input1" ftype="sam" value="sam_to_bam_noheader_in2.sam" />
-            <param name="ref_file" ftype="fasta" dbkey="equCab2" value="chr_m.fasta" />
-            <output name="output1" ftype="bam" file="sam_to_bam_out3.bam" />
+            <param name="addref_select" value="history" />
+            <param name="ref" ftype="fasta" dbkey="equCab2" value="chr_m.fasta" />
+            <param name="input" ftype="sam" value="sam_to_bam_noheader_in2.sam" />
+            <output name="output1" ftype="bam" file="sam_to_bam_out3.bam" lines_diff="4"/>
         </test>
     </tests>
     <help><![CDATA[