diff variant.xml @ 3:e86fcef8ed91 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/medaka commit e80b649094384fc6d7a8f917300db3550cc99a44"
author iuc
date Tue, 01 Sep 2020 03:08:24 -0400
parents 43388fc8ad0b
children 2308bc523659
line wrap: on
line diff
--- a/variant.xml	Thu Jun 18 05:08:21 2020 -0400
+++ b/variant.xml	Tue Sep 01 03:08:24 2020 -0400
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<tool id="medaka_variant" name="medaka: Variant" version="@TOOL_VERSION@+galaxy0" profile="@PROFILE@">
+<tool id="medaka_variant" name="medaka: Variant" version="@TOOL_VERSION@+galaxy1" profile="@PROFILE@">
     <description>Probability decoding</description>
     <macros>
         <import>macros.xml</import>
@@ -25,62 +25,80 @@
 #end for
 '$out_result' ## output
 
-|& tee '$out_log'
+2>&1 | tee '$out_log'
+
+#if $out_annotated
+    && python '$__tool_directory__/annotateVCF.py' '$out_result' '$in_mpileup' '$out_annotated'
+#end if
     ]]></command>
     <inputs>
         <param argument="inputs" type="data" format="h5" multiple="true" label="Select consensus file(s)"/>
         <expand macro="reference"/>
-        <param argument="--region" type="text" value="" optional="true" label="Set reference names to limit variant calling" help="Separated by ','."/>
+        <param argument="--region" type="text" value="" optional="true" label="Set reference names to limit variant calling" help="Separated by ','.">
+            <sanitizer invalid_char="">
+                <valid initial="string.ascii_letters,string.digits">
+                    <add value="_"/>
+                    <add value=","/>
+                    <add value="."/>
+                </valid>
+            </sanitizer>
+        </param>
         <param argument="--verbose" type="boolean" truevalue="--verbose" falsevalue="" label="Populate VCF info fields?"/>
-        <param name="out" type="select" multiple="true" optional="false" label="Select output file(s)">
-            <option value="result" selected="true">Result</option>
-            <option value="log">Log</option>
-        </param>
+
+        <conditional name="output_annotated">
+            <param name="output_annotated_select" type="select" label="Output annotated VCF?" help="Annotate allele frequency, depth of coverage, etc for each variant (requires pileup file)">
+                <option value="true" selected="true">Output annotated VCF</option>
+                <option value="false">Don't output annotated VCF</option>
+            </param>
+            <when value="true">
+                <param name="in_mpileup" type = "data" format="pileup" optional="false" label="Mpileup to annotate the VCF"/>
+            </when>
+        </conditional>
+        <param name="output_log_bool" type="boolean" label="Output log file?" checked="true"/>
     </inputs>
     <outputs>
         <!-- standard -->
-        <data name="out_result" format="vcf" label="${tool.name} on ${on_string}: Result">
-            <filter>'result' in out</filter>
+        <data name="out_result" format="vcf" label="${tool.name} on ${on_string}: Result"/>
+        <!-- optional -->
+        <data name="out_annotated" format="vcf" label="${tool.name} on ${on_string}: Annotated">
+            <filter>output_annotated_select</filter>
         </data>
-        <!-- optional -->
         <data name="out_log" format="tabular" label="${tool.name} on ${on_string}: Log">
-            <filter>'log' in out</filter>
+            <filter>output_log_bool</filter>
         </data>
     </outputs>
     <tests>
         <!-- #1 default -->
-        <test expect_num_outputs="1">
+        <test expect_num_outputs="3">
+            <param name="inputs" value="medaka_test.hdf"/>
             <conditional name="reference_source">
-                <param name="reference_source_selector" value="cached"/>
-                <param name="ref_file" value="bwa-mem-mt-genome"/>
+                <param name="reference_source_selector" value="history"/>
+                <param name="ref_file" value="ref.fasta"/>
             </conditional>
-            <param name="inputs" value="consensus.hdf"/>
+            <conditional name="output_annotated">
+                <param name="output_annotated_select" value="true"/>
+                <param name="in_mpileup" value="annotate_vcf_test.pileup"/>
+            </conditional>
+            <param name="output_log_bool" value="true"/>
+            
             <output name="out_result">
                 <assert_contents>
-                    <has_n_lines n="6"/>
-                    <has_line line="##fileformat=VCFv4.1"/>
+                    <has_n_lines n="9"/>
+                    <has_line line="##fileformat=VCFv4.1" />
+                    <has_line line="##medaka_version=1.0.3" />
                 </assert_contents>
             </output>
-        </test>
-        <!-- #2 -->
-        <test expect_num_outputs="2">
-            <conditional name="reference_source">
-                <param name="reference_source_selector" value="cached"/>
-                <param name="ref_file" value="bwa-mem-mt-genome"/>
-            </conditional>
-            <param name="inputs" value="consensus.hdf"/>
-            <param name="verbose" value="true"/>
-            <param name="out" value="result,log"/>
-            <output name="out_result">
+            <output name="out_annotated">
                 <assert_contents>
-                    <has_n_lines n="13"/>
-                    <has_line line="##fileformat=VCFv4.1"/>
+                    <has_n_lines n="16"/>
+                    <has_line line="##fileformat=VCFv4.1" />
+                    <has_line line="##medaka_version=1.0.3" />
+                    <has_line line="##annotateVCFVersion=0.1" />
                 </assert_contents>
             </output>
             <output name="out_log">
                 <assert_contents>
-                    <has_n_lines n="17"/>
-                    <has_text_matching expression=".+Loaded.+"/>
+                    <has_n_lines n="8" />
                 </assert_contents>
             </output>
         </test>
@@ -108,4 +126,4 @@
 @REFERENCES@
     ]]></help>
     <expand macro="citations"/>
-</tool>
\ No newline at end of file
+</tool>