diff ivar_variants.xml @ 7:252dfb042563 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ivar/ commit 80ad6146e8852fb04fbdbe7b14ab120eee605e3a"
author iuc
date Fri, 11 Jun 2021 15:42:14 +0000
parents 147465efa99c
children 38b91a3190cd
line wrap: on
line diff
--- a/ivar_variants.xml	Thu Jun 10 22:06:04 2021 +0000
+++ b/ivar_variants.xml	Fri Jun 11 15:42:14 2021 +0000
@@ -1,4 +1,4 @@
-<tool id="ivar_variants" name="ivar variants" version="@VERSION@+galaxy1">
+<tool id="ivar_variants" name="ivar variants" version="@VERSION@+galaxy2">
     <description>Call variants from aligned BAM file</description>
     <macros>
         <import>macros.xml</import>
@@ -13,13 +13,14 @@
         samtools mpileup -A -d 0 --reference ref.fa -B -Q 0 sorted.bam | ivar variants 
         -p variants
         -q $min_qual
-        -t $min_freq &&
-        #if str($output_format.choice) == 'vcf'
-            python '${__tool_directory__}/ivar_variants_to_vcf.py' 
+        -t $min_freq 
+        #if str($output_format.choice) == "tabular" or str($output_format.choice) == "tabular_and_vcf"
+            && cp variants.tsv '$output_variants_tabular'
+        #end if
+        #if str($output_format.choice) == 'vcf' or str($output_format.choice) == "tabular_and_vcf"
+            && python '${__tool_directory__}/ivar_variants_to_vcf.py' 
             ${output_format.pass_only}
-            variants.tsv '$output_variants'
-        #else
-            cp variants.tsv '$output_variants'
+            variants.tsv '$output_variants_vcf'
         #end if
     ]]>    </command>
     <inputs>
@@ -31,25 +32,33 @@
             <param name="choice" type="select" label="Output format">
                 <option value="tabular">Tabular (native tool output)</option>
                 <option value="vcf">VCF</option>
+                <option value="tabular_and_vcf">Both Tabular and VCF</option>
             </param>
             <when value="vcf">
                 <param argument="--pass_only" type="boolean" truevalue="--pass_only" falsevalue="" label="In VCF only output variants that PASS all filters" />
             </when>
+            <when value="tabular_and_vcf">
+                <param argument="--pass_only" type="boolean" truevalue="--pass_only" falsevalue="" label="In VCF only output variants that PASS all filters" />
+            </when>
             <when value="tabular" />
         </conditional>    
     </inputs>
     <outputs>
-        <data name="output_variants" format="tabular" label="${tool.name} on ${on_string}">
-            <change_format>
-                <when input="output_format.choice" value="vcf" format="vcf" />
-            </change_format>
+        <data name="output_variants_tabular" format="tabular" label="${tool.name} tabular output on ${on_string}">
+            <filter>output_format['choice'] == 'tabular' or output_format['choice'] == 'tabular_and_vcf'</filter>
+            <actions>
+                <action name="column_names" type="metadata" default="REGION,POS,REF,ALT,REF_DP,REF_RV,REF_QUAL,ALT_DP,ALT_RV,ALT_QUAL,ALT_FREQ,TOTAL_DP,PVAL,PASS,GFF_FEATURE,REF_CODON,REF_AA,ALT_CODON,ALT_AA" />
+            </actions>
+        </data>
+        <data name="output_variants_vcf" format="vcf" label="${tool.name} VCF on ${on_string}">
+            <filter>output_format['choice'] == 'vcf' or output_format['choice'] == 'tabular_and_vcf'</filter>
         </data>
     </outputs>
     <tests>
         <test expect_num_outputs="1">
             <param name="input_bam" value="zika/Z52_a.masked.sorted.bam" />
             <param name="ref" value="zika/db/PRV.fa" />
-            <output name="output_variants" file="zika/Z52_a.tsv" ftype="tabular" lines_diff="10"/>
+            <output name="output_variants_tabular" file="zika/Z52_a.tsv" ftype="tabular" lines_diff="10"/>
         </test>
         <test expect_num_outputs="1">
             <param name="input_bam" value="zika/Z52_a.masked.sorted.bam" />
@@ -57,8 +66,19 @@
             <conditional name="output_format">
                 <param name="choice" value="vcf" />
             </conditional>
-            <output name="output_variants" file="zika/Z52_a.vcf" ftype="vcf"/>
+            <output name="output_variants_vcf" file="zika/Z52_a.vcf" ftype="vcf"/>
         </test>
+        <test expect_num_outputs="2">
+            <param name="input_bam" value="zika/Z52_a.masked.sorted.bam" />
+            <param name="ref" value="zika/db/PRV.fa" />
+            <conditional name="output_format">
+                <param name="choice" value="tabular_and_vcf" />
+                <param name="pass_only" value="true" />
+            </conditional>
+            <output name="output_variants_tabular" file="zika/Z52_a.tsv" ftype="tabular" lines_diff="10"/>
+            <output name="output_variants_vcf" file="zika/Z52_a_pass.vcf" ftype="vcf"/>
+        </test>
+
     </tests>
     <help><![CDATA[
         iVar uses the output of the samtools mpileup command to call variants -