diff bcftools_roh.xml @ 5:45091d60320f draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bcftools commit 9d03fe38504a35d11660dadb44cb1beee32fcf4e
author iuc
date Thu, 13 Apr 2017 17:41:53 -0400
parents 33454033cdf6
children b0d39ef600a7
line wrap: on
line diff
--- a/bcftools_roh.xml	Sat Mar 11 18:05:17 2017 -0500
+++ b/bcftools_roh.xml	Thu Apr 13 17:41:53 2017 -0400
@@ -1,6 +1,6 @@
 <?xml version='1.0' encoding='utf-8'?>
 <tool name="bcftools @EXECUTABLE@" id="bcftools_@EXECUTABLE@" version="@VERSION@.0">
-    <description>HMM model for detecting runs of autozygosity</description>
+    <description>HMM model for detecting runs of homo/autozygosity</description>
     <macros>
         <token name="@EXECUTABLE@">roh</token>
         <import>macros.xml</import>
@@ -12,6 +12,7 @@
 @PREPARE_INPUT_FILE@
 #set $section = $sec_restrict
 @PREPARE_TARGETS_FILE@
+@PREPARE_REGIONS_FILE@
 ## General section
 #set $section = $sec_general
 @PREPARE_AF_FILE@
@@ -39,6 +40,13 @@
 #if $section.rec_rate:
   --rec-rate "${section.rec_rate}"
 #end if
+#if $section.buffer_size:
+  #if $section.buffer_overlap:
+    --buffer-size "${section.buffer_size},${section.buffer_overlap}"
+  #else:
+    --buffer-size "${section.buffer_size}"
+  #end if
+#end if
 
 ## HMM section
 #set $section = $sec_hmm
@@ -54,10 +62,15 @@
 #set $section = $sec_restrict
 @REGIONS@
 @TARGETS@
+@SAMPLES@
+
+#if str($output_type) in ('r','s'):
+  --output-type $output_type
+#end if
 
 ## Primary Input/Outputs
 @INPUT_FILE@
-> "$output_file"
+> '$output_file'
 ]]>
     </command>
     <inputs>
@@ -65,6 +78,7 @@
         <section name="sec_restrict" expanded="false" title="Restrict to">
             <expand macro="macro_regions" />
             <expand macro="macro_targets" />
+            <expand macro="macro_samples" />
         </section>
         <section name="sec_general" expanded="true" title="Roh General Options">
             <expand macro="macro_sample" />
@@ -77,25 +91,53 @@
             <param name="skip_indels" type="boolean" truevalue="--skip-indels" falsevalue="" label="Skip Indels" help="Skip indels as their genotypes are enriched for errors" />
             <param name="genetic_map" type="data" format="data" label="Genetic Map" optional="True" help="Genetic map in IMPUTE2 format, single file or mask, where string &quot;{CHROM}&quot; is replaced with chromosome name" />
             <param name="rec_rate" type="float" label="Rec Rate" optional="True" help="Constant recombination rate per bp" />
+            <param name="buffer_size" type="integer" label="Sliding Buffer Size" optional="True">
+                <help>
+Use when the entire many-sample file cannot fit into memory. 
+The number of sites to keep in memory. 
+If negative, it is interpreted as the maximum memory to use, in MB.
+                </help>
+            </param>
+            <param name="buffer_overlap" type="integer" min="0" label="Sliding Buffer Overlap" optional="True">
+                <help>
+The number of overlapping sites for the sliding buffer. The default overlap is set to roughly 1% of the buffer size. 
+                </help>
+            </param>
         </section>
         <section name="sec_hmm" expanded="true" title="HMM Options">
             <param name="hw_to_az" type="float" label="Hw To Az" value="6.7e-8" optional="True" help="P(AZ|HW) transition probability from HW (Hardy-Weinberg) to AZ (autozygous) state" />
             <param name="az_to_hw" type="float" label="Az To Hw" value="5e-9" optional="True" help="P(HW|AZ) transition probability from AZ to HW state" />
             <param name="viterbi_training" type="boolean" truevalue="--viterbi-training" falsevalue="" label="Viterbi Training" help="Perform Viterbi training to estimate transition probabilities" />
         </section>
+        <param name="output_type" type="select" optional="true" label="limit output">
+            <option value="s">s:per-site</option>
+            <option value="r">r:regions</option>
+        </param>
     </inputs>
     <outputs>
         <data name="output_file" format="tabular"/>
     </outputs>
     <tests>
-        <!-- Need an actual test input file -->
         <test>
-            <param name="input_file" ftype="vcf" value="mpileup.vcf" />
-            <param name="sample" value="HG00100" />
+            <param name="input_file" ftype="vcf" value="roh.vcf" />
+            <param name="AF_dflt" value="0.4" />
+            <param name="GTs_only" value="30" />
             <output name="output_file">
                 <assert_contents>
-                    <has_text text="HG00100"/>
-                    <has_text text="State "/>
+                    <has_text_matching expression="ST\tsample\t1"/>
+                    <has_text_matching expression="RG\tsample\t1"/>
+                </assert_contents>
+            </output>
+        </test>
+        <test>
+            <param name="input_file" ftype="vcf" value="roh.vcf" />
+            <param name="AF_dflt" value="0.4" />
+            <param name="GTs_only" value="30" />
+            <param name="output_type" value="r" />
+            <output name="output_file">
+                <assert_contents>
+                    <not_has_text text="ST"/>
+                    <has_text_matching expression="RG\tsample\t1"/>
                 </assert_contents>
             </output>
         </test>