diff samtools_cram_to_bam.xml @ 4:1551b0dd2d16 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/samtools/cram_to_bam commit 0f75269223c0821c6c82acf98fde947d0f816f2b"
author iuc
date Tue, 28 Sep 2021 16:11:03 +0000
parents 858ada516d8f
children 634df184b2a8
line wrap: on
line diff
--- a/samtools_cram_to_bam.xml	Sat Jul 31 07:26:19 2021 +0000
+++ b/samtools_cram_to_bam.xml	Tue Sep 28 16:11:03 2021 +0000
@@ -1,4 +1,4 @@
-<tool id="samtools_cram_to_bam" name="samtools CRAM to BAM" version="@TOOL_VERSION@+galaxy1">
+<tool id="samtools_cram_to_bam" name="samtools CRAM to BAM" version="@TOOL_VERSION@" profile="@PROFILE@">
     <description>convert CRAM alignments to BAM format</description>
 
     <macros>
@@ -9,52 +9,31 @@
     <expand macro="version_command"/>
 
     <command><![CDATA[
-        #set input_cram = "input.cram"
-        ln -s '${input_alignment}' '${input_cram}' &&
-        #if str( $input_alignment.metadata.cram_index ) != "None":
-            ln -f -s '${input_alignment.metadata.cram_index}' '${input_cram}.crai' &&
+        @ADDTHREADS@
+        ln -s '$input' input.cram &&
+        #if str( $input.metadata.cram_index ) != "None":
+            ln -f -s '${input.metadata.cram_index}' input.cram.crai &&
         #end if
 
-        #if $reference_source.reference_source_selector == 'history':
-            #set ref_fa = 'ref.fa'
-            ln -s '${reference_source.input_reference}' ref.fa &&
-        #else:
-            #set ref_fa = str( $reference_source.input_reference.fields.path )
-        #end if
+        @PREPARE_FASTA_IDX@
 
         samtools view
             #if $parameter_regions.target_region == "regions_bed_file"
-                -L '${parameter_regions.regions_bed_file}'
+                -L '$parameter_regions.regions_bed_file'
             #end if
-            -@ \${GALAXY_SLOTS:-2}
+            -@ \$addthreads
             -b
-            -T '$ref_fa'
+            -T '$reffa'
             -o '$output_alignment'
-            '$input_cram'
+            input.cram
             #if $parameter_regions.target_region == "region"
-                '${parameter_regions.region_string}'
+                '$parameter_regions.region_string'
             #end if
     ]]></command>
 
     <inputs>
-        <param name="input_alignment" type="data" format="cram" label="CRAM alignment file"/>
-        <conditional name="reference_source">
-            <param name="reference_source_selector" type="select" label="Load reference genome from">
-                <option value="cached">Local cache</option>
-                <option value="history">History</option>
-            </param>
-            <when value="cached">
-                <param name="input_reference" type="select" label="Reference genome">
-                    <options from_data_table="fasta_indexes">
-                        <filter type="data_meta" ref="input_alignment" key="dbkey" column="dbkey" />
-                    </options>
-                    <validator type="no_options" message="A built-in reference genome is not available for the build associated with the selected input file"/>
-                </param>
-            </when>
-            <when value="history">
-                <param name="input_reference" type="data" format="fasta" label="Reference FASTA file"/>
-            </when>
-        </conditional>
+        <param name="input" type="data" format="cram" label="CRAM alignment file"/>
+        <expand macro="mandatory_reference" argument="-t"/>
         <conditional name="parameter_regions">
             <param name="target_region" type="select" label="Choose conversion within specific genomic region(s)">
                 <option value="entire_input_file">Entire BAM alignment file</option>
@@ -77,36 +56,33 @@
 
     <tests>
         <test>
-            <param name="input_alignment" value="test.cram" ftype="cram" />
-            <param name="reference_source_selector" value="history" />
-            <param name="input_reference" value="test.fa" />
-
-            <output name="output_alignment" file="test.bam" compare="sim_size" delta="250" />
+            <param name="input" value="test.cram" ftype="cram" />
+            <param name="addref_select" value="history" />
+            <param name="ref" value="test.fa" />
+            <output name="output_alignment" file="test.bam" ftype="bam" lines_diff="4" />
         </test>
         <test>
-            <param name="input_alignment" value="test.cram" ftype="cram" />
-            <param name="reference_source_selector" value="history" />
-            <param name="input_reference" value="test.fa" />
+            <param name="input" value="test.cram" ftype="cram" />
+            <param name="addref_select" value="history" />
+            <param name="ref" value="test.fa" />
             <param name="target_region" value="region" />
             <param name="region_string" value="CHROMOSOME_I" />
-
-            <output name="output_alignment" file="test.bam" compare="sim_size" delta="250" />
+            <output name="output_alignment" file="test.bam" ftype="bam" lines_diff="4" />
         </test>
         <test>
-            <param name="input_alignment" value="test.cram" ftype="cram" />
-            <param name="reference_source_selector" value="history" />
-            <param name="input_reference" value="test.fa" />
+            <param name="input" value="test.cram" ftype="cram" />
+            <param name="addref_select" value="history" />
+            <param name="ref" value="test.fa" />
             <param name="target_region" value="regions_bed_file" />
             <param name="regions_bed_file" value="test.bed" ftype="bed" />
-
-            <output name="output_alignment" file="test.bam" compare="sim_size" delta="250" />
+            <output name="output_alignment" file="test.bam" ftype="bam" lines_diff="4" />
         </test>
         <test>
-            <param name="input_alignment" value="test2.cram" dbkey="equCab2" ftype="cram" />
-            <param name="reference_source_selector" value="cached" />
-            <param name="input_reference" value="equCab2chrM" />
+            <param name="input" value="test2.cram" dbkey="equCab2" ftype="cram" />
+            <param name="addref_select" value="cached" />
+            <param name="ref" value="equCab2chrM" />
             <param name="target_region" value="entire_input_file" />
-            <output name="output_alignment" file="sam_to_bam_out2.bam" compare="sim_size" delta="250" />
+            <output name="output_alignment" file="sam_to_bam_out2.bam" ftype="bam" lines_diff="4" />
         </test>
     </tests>