diff bcftools_convert_to_vcf.xml @ 8:843e008b15fd draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bcftools commit e648d86d550ddf2eb67237752320c390b3a780e5
author iuc
date Wed, 05 Jun 2019 13:11:03 -0400
parents 367ba501b6eb
children 8bb5efd7a3dd
line wrap: on
line diff
--- a/bcftools_convert_to_vcf.xml	Thu Feb 21 16:05:01 2019 -0500
+++ b/bcftools_convert_to_vcf.xml	Wed Jun 05 13:11:03 2019 -0400
@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='utf-8'?>
-<tool name="bcftools @EXECUTABLE@ to vcf" id="bcftools_@EXECUTABLE@_to_vcf" version="@TOOL_VERSION@">
+<tool name="bcftools @EXECUTABLE@ to vcf" id="bcftools_@EXECUTABLE@_to_vcf" version="@TOOL_VERSION@+galaxy1">
     <description>Converts other formats to VCF/BCFk</description>
     <macros>
         <token name="@EXECUTABLE@">convert</token>
@@ -27,14 +27,15 @@
     ln -s '$convert.input_file' $input_vcf &&
   #end if
 #end if
-#set $section = $convert
-@PREPARE_FASTA_REF@
+#if $convert.convert_from == 'gvcf' or $convert.convert_from == 'tsv':
+  #set $section = $convert.reference_source
+  @PREPARE_FASTA_REF@
+#end if
 
 bcftools @EXECUTABLE@
 
 @OUTPUT_TYPE@
 
-#set $section = $convert
 #if $convert.convert_from == 'gen_sample':
   --gensample2vcf '$convert.input_file,$convert.input_sample'
 #elif $convert.convert_from == 'hap_sample':
@@ -46,6 +47,7 @@
    --gvcf2vcf $input_vcf
 #elif $convert.convert_from == 'tsv':
    @FASTA_REF@
+   #set $section = $convert
    @SAMPLES@
    @COLUMNS@
    --tsv2vcf '$convert.input_file'
@@ -95,9 +97,11 @@
     </outputs>
     <tests>
         <test>
-            <param name="convert_from"  value="gen_sample" />
-            <param name="input_file" ftype="tabular" value="convert.gs.gt.gen" />
-            <param name="input_sample" ftype="tabular" value="convert.gs.gt.samples" />
+            <conditional name="convert">
+                <param name="convert_from"  value="gen_sample" />
+                <param name="input_file" ftype="tabular" value="convert.gs.gt.gen" />
+                <param name="input_sample" ftype="tabular" value="convert.gs.gt.samples" />
+            </conditional>
             <param name="output_type" value="v" />
             <output name="output_file">
                 <assert_contents>
@@ -107,9 +111,26 @@
             </output>
         </test>
         <test>
-            <param name="convert_from"  value="hap_sample" />
-            <param name="input_file" ftype="tabular" value="convert.hs.gt.hap" />
-            <param name="input_sample" ftype="tabular" value="convert.hs.gt.samples" />
+            <conditional name="convert">
+                <param name="convert_from"  value="hap_sample" />
+                <param name="input_file" ftype="tabular" value="convert.hs.gt.hap" />
+                <param name="input_sample" ftype="tabular" value="convert.hs.gt.samples" />
+            </conditional>
+            <param name="output_type" value="v" />
+            <output name="output_file">
+                <assert_contents>
+                    <has_text_matching expression="#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tNA00001\tNA00002\tNA00003\tNA00004\tNA00005\tNA00006\tNA00007\tNA00008\tNA00009\tNA00010" />
+                    <has_text_matching expression="X\t2698769\t.\tAAG\tA\t.\t.\t.\tGT\t1|0\t1|1\t0|1\t1|0\t1|0\t0|0\t0|0\t0|0\t0|0\t0|0" />
+                </assert_contents>
+            </output>
+        </test>
+        <test>
+            <conditional name="convert">
+                <param name="convert_from"  value="hap_legend_sample" />
+                <param name="input_file" ftype="tabular" value="convert.hls.gt.hap" />
+                <param name="input_legend" ftype="tabular" value="convert.hls.gt.legend" />
+                <param name="input_sample" ftype="tabular" value="convert.hls.gt.samples" />
+            </conditional>
             <param name="output_type" value="v" />
             <output name="output_file">
                 <assert_contents>
@@ -119,22 +140,11 @@
             </output>
         </test>
         <test>
-            <param name="convert_from"  value="hap_legend_sample" />
-            <param name="input_file" ftype="tabular" value="convert.hls.gt.hap" />
-            <param name="input_legend" ftype="tabular" value="convert.hls.gt.legend" />
-            <param name="input_sample" ftype="tabular" value="convert.hls.gt.samples" />
-            <param name="output_type" value="v" />
-            <output name="output_file">
-                <assert_contents>
-                    <has_text_matching expression="#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tNA00001\tNA00002\tNA00003\tNA00004\tNA00005\tNA00006\tNA00007\tNA00008\tNA00009\tNA00010" />
-                    <has_text_matching expression="X\t2698769\t.\tAAG\tA\t.\t.\t.\tGT\t1|0\t1|1\t0|1\t1|0\t1|0\t0|0\t0|0\t0|0\t0|0\t0|0" />
-                </assert_contents>
-            </output>
-        </test>
-        <test>
-            <param name="convert_from"  value="gvcf" />
-            <param name="input_file" ftype="vcf" value="convert.gvcf.vcf" />
-            <param name="fasta_ref" ftype="fasta" value="gvcf.fa" />
+            <conditional name="convert">
+                <param name="convert_from"  value="gvcf" />
+                <param name="input_file" ftype="vcf" value="convert.gvcf.vcf" />
+                <expand macro="test_using_reference" ref="gvcf.fa" />
+            </conditional>
             <param name="output_type" value="v" />
             <output name="output_file">
                 <assert_contents>
@@ -144,11 +154,43 @@
             </output>
         </test>
         <test>
-            <param name="convert_from"  value="tsv" />
-            <param name="input_file" ftype="tabular" value="convert.23andme" />
-            <param name="fasta_ref" ftype="fasta" value="23andme.fa" />
-            <param name="samples"  value="SAMPLE1" />
-            <param name="columns"  value="ID,CHROM,POS,AA" />
+            <conditional name="convert">
+                <param name="convert_from"  value="gvcf" />
+                <param name="input_file" ftype="vcf" dbkey="?" value="convert.gvcf.vcf" />
+                <expand macro="test_using_reference" select_from="cached" ref="gvcf" />
+            </conditional>
+            <param name="output_type" value="v" />
+            <output name="output_file">
+                <assert_contents>
+                    <has_text_matching expression="#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tSAMPLE99" />
+                    <has_text_matching expression="22\t10\t.\tC\t.\t0\tLowGQX\tBLOCKAVG_min30p3a\tGT:GQX:DP:DPF\t0/0:5:2:0" />
+                </assert_contents>
+            </output>
+        </test>
+        <test>
+            <conditional name="convert">
+                <param name="convert_from"  value="tsv" />
+                <param name="input_file" ftype="tabular" value="convert.23andme" />
+                <expand macro="test_using_reference" ref="23andme.fa" />
+                <param name="samples"  value="SAMPLE1" />
+                <param name="columns"  value="ID,CHROM,POS,AA" />
+            </conditional>
+            <param name="output_type" value="v" />
+            <output name="output_file">
+                <assert_contents>
+                    <has_text_matching expression="#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tSAMPLE1" />
+                    <has_text_matching expression="1\t10\trs002\tG\tA\t.\t.\t.\tGT\t1/0" />
+                </assert_contents>
+            </output>
+        </test>
+        <test>
+            <conditional name="convert">
+                <param name="convert_from"  value="tsv" />
+                <param name="input_file" ftype="tabular" dbkey="?" value="convert.23andme" />
+                <expand macro="test_using_reference" select_from="cached" ref="23andme" />
+                <param name="samples"  value="SAMPLE1" />
+                <param name="columns"  value="ID,CHROM,POS,AA" />
+            </conditional>
             <param name="output_type" value="v" />
             <output name="output_file">
                 <assert_contents>