comparison bcftools_convert_from_vcf.xml @ 0:d396503fdbdb draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bcftools commit 21c66fb27c7e2fd21c7f7607b3b29e77e64fb86d-dirty
author jjohnson
date Sat, 25 Jun 2016 20:47:20 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:d396503fdbdb
1 <?xml version='1.0' encoding='utf-8'?>
2 <tool name="bcftools @EXECUTABLE@ from vcf" id="bcftools_@EXECUTABLE@_from_vcf" version="@VERSION@.0">
3 <description>Converts VCF/BCF to IMPUTE2/SHAPEIT formats</description>
4 <macros>
5 <token name="@EXECUTABLE@">convert</token>
6 <import>macros.xml</import>
7 <xml name="macro_vcf_ids">
8 <param name="vcf_ids" type="boolean" truevalue="--vcf-ids" falsevalue="" checked="false"
9 label="Output VCF IDs instead of CHROM:POS_REF_ALT" help="(\-\-vcf_ids)"/>
10 </xml>
11 <xml name="macro_haploid2diploid">
12 <param name="haploid2diploid" type="boolean" truevalue="--haploid2diploid" falsevalue="" checked="false"
13 label="convert haploid genotypes to diploid homozygotes" help="(\-\-haploid2diploid)"/>
14 </xml>
15 </macros>
16 <expand macro="requirements" />
17 <expand macro="version_command" />
18 <command detect_errors="aggressive"><![CDATA[
19 @PREPARE_ENV@
20 @PREPARE_INPUT_FILE@
21 #set $section = $sec_restrict
22 @PREPARE_TARGETS_FILE@
23
24 bcftools @EXECUTABLE@
25
26 #if $convert.convert_to == 'gen_sample':
27 --tag $convert.tag $convert.chrom $convert.vcf_ids
28 --gensample "$output_gen,$output_samples"
29 #elif $convert.convert_to == 'hap_sample':
30 $convert.vcf_ids $convert.haploid2diploid
31 --hapsample "$output_hap,$output_samples"
32 #elif $convert.convert_to == 'hap_legend_sample':
33 $convert.vcf_ids $convert.haploid2diploid
34 --haplegendsample "$output_hap,$output_legend,$output_samples"
35 #end if
36
37 ## VCF input section
38 #set $section = $sec_restrict
39 @INCLUDE@
40 @EXCLUDE@
41 @REGIONS@
42 @TARGETS@
43 @SAMPLES@
44
45 ## Primary Input/Outputs
46 "$input_file" .
47 ]]>
48 </command>
49 <inputs>
50 <expand macro="macro_input" />
51 <section name="sec_restrict" expanded="false" title="Restrict to">
52 <expand macro="macro_regions" />
53 <expand macro="macro_targets" />
54 <expand macro="macro_samples" />
55 <expand macro="macro_include" />
56 <expand macro="macro_exclude" />
57 </section>
58 <conditional name="convert">
59 <param name="convert_to" type="select" label="convert to">
60 <option value="gen_sample">gen sample - IMPUTE2 or SHAPEIT</option>
61 <option value="hap_sample">hap sample - IMPUTE2 or SHAPEIT</option>
62 <option value="hap_legend_sample">hap legend sample - IMPUTE2 or SHAPEIT</option>
63 </param>
64 <when value="gen_sample">
65 <param name="tag" type="select" label="tag to take values for .gen file: GT,PL,GL,GP">
66 <option value="GT">GT</option>
67 <option value="PL">PL</option>
68 <option value="GP">GP</option>
69 <!--
70 <option value="GL">GL</option>
71 -->
72 </param>
73 <param name="chrom" type="boolean" truevalue="--chrom" falsevalue="" checked="false"
74 label="Output chromosome in first column instead of CHROM:POS_REF_ALT" help="(\-\-chrom)"/>
75 <expand macro="macro_vcf_ids"/>
76 </when>
77 <when value="hap_sample">
78 <expand macro="macro_haploid2diploid"/>
79 <expand macro="macro_vcf_ids"/>
80 </when>
81 <when value="hap_legend_sample">
82 <expand macro="macro_haploid2diploid"/>
83 <expand macro="macro_vcf_ids"/>
84 </when>
85 </conditional>
86 </inputs>
87 <outputs>
88 <data name="output_gen" format="tabular" label="${input_file.name.rsplit('.',1)[0]}.gen">
89 <filter>convert['convert_to'] == 'gen_sample'</filter>
90 </data>
91 <data name="output_hap" format="tabular" label="${input_file.name.rsplit('.',1)[0]}.haps">
92 <filter>convert['convert_to'] in ('hap_sample','hap_legend_sample')</filter>
93 </data>
94 <data name="output_legend" format="tabular" label="${input_file.name.rsplit('.',1)[0]}.legend">
95 <filter>convert['convert_to'] == 'hap_legend_sample'</filter>
96 </data>
97 <data name="output_samples" format="tabular" label="${input_file.name.rsplit('.',1)[0]}.samples"/>
98 </outputs>
99 <tests>
100 <test>
101 <param name="input_file" ftype="vcf" value="convert.vcf" />
102 <param name="convert_to" value="gen_sample" />
103 <output name="output_gen">
104 <assert_contents>
105 <has_text text="X:2698560_G_A X:2698560_G_A 2698560 G A 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0"/>
106 </assert_contents>
107 </output>
108 <output name="output_samples">
109 <assert_contents>
110 <has_text text="NA00001 NA00001 0"/>
111 </assert_contents>
112 </output>
113 </test>
114 <test>
115 <param name="input_file" ftype="vcf" value="convert.vcf" />
116 <param name="convert_to" value="gen_sample" />
117 <param name="tag" value="GP" />
118 <param name="chrom" value="True" />
119 <output name="output_gen">
120 <assert_contents>
121 <has_text text="X X:2698560_G_A 2698560 G A 1.00"/>
122 </assert_contents>
123 </output>
124 </test>
125 <test>
126 <param name="input_file" ftype="vcf" value="check.vcf" />
127 <param name="convert_to" value="gen_sample" />
128 <param name="tag" value="GT" />
129 <param name="chrom" value="True" />
130 <param name="vcf_ids" value="True" />
131 <output name="output_gen">
132 <assert_contents>
133 <has_text text="1 id3D 3062915 GTTT G 0 1 0 0 1 0"/>
134 </assert_contents>
135 </output>
136 </test>
137 <test>
138 <param name="input_file" ftype="vcf" value="convert.vcf" />
139 <param name="convert_to" value="hap_sample" />
140 <output name="output_hap">
141 <assert_contents>
142 <has_text text="X X:2698769_AAG_A 2698769 AAG A 1 0 1 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0"/>
143 </assert_contents>
144 </output>
145 </test>
146 <test>
147 <param name="input_file" ftype="vcf" value="convert.vcf" />
148 <param name="convert_to" value="hap_legend_sample" />
149 <output name="output_hap">
150 <assert_contents>
151 <has_text text="1 0 1 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0"/>
152 </assert_contents>
153 </output>
154 <output name="output_legend">
155 <assert_contents>
156 <has_text text="X:2698769_AAG_A 2698769 AAG A"/>
157 </assert_contents>
158 </output>
159 <output name="output_samples">
160 <assert_contents>
161 <has_text text="sample population group sex"/>
162 <has_text text="NA00001 NA00001 NA00001 2"/>
163 </assert_contents>
164 </output>
165 </test>
166 </tests>
167
168 <help><![CDATA[
169 =====================================
170 bcftools @EXECUTABLE@ from vcf
171 =====================================
172
173 Converts VCF/BCF to other formats. See man page for file formats details.
174
175 @REGIONS_HELP@
176 @TARGETS_HELP@
177 @EXPRESSIONS_HELP@
178
179 @BCFTOOLS_MANPAGE@#@EXECUTABLE@
180
181 @BCFTOOLS_WIKI@
182 ]]>
183 </help>
184 <expand macro="citations" />
185 </tool>