comparison bcftools_convert_from_vcf.xml @ 25:61d4b20f3b11 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/bcftools commit f6efda26965eb73c9107d367fd5ffdf246ed0dbc
author iuc
date Tue, 02 Dec 2025 07:43:16 +0000
parents 0155f20adc71
children
comparison
equal deleted inserted replaced
24:0155f20adc71 25:61d4b20f3b11
2 <description>Converts VCF/BCF to IMPUTE2/SHAPEIT formats</description> 2 <description>Converts VCF/BCF to IMPUTE2/SHAPEIT formats</description>
3 <macros> 3 <macros>
4 <token name="@EXECUTABLE@">convert</token> 4 <token name="@EXECUTABLE@">convert</token>
5 <import>macros.xml</import> 5 <import>macros.xml</import>
6 <xml name="macro_vcf_ids"> 6 <xml name="macro_vcf_ids">
7 <param name="vcf_ids" type="boolean" truevalue="--vcf-ids" falsevalue="" checked="false" 7 <param name="vcf_ids" type="boolean" truevalue="--vcf-ids" falsevalue="" checked="false" label="Output VCF IDs instead of CHROM:POS_REF_ALT" help="(\-\-vcf_ids)"/>
8 label="Output VCF IDs instead of CHROM:POS_REF_ALT" help="(\-\-vcf_ids)"/>
9 </xml> 8 </xml>
10 <xml name="macro_haploid2diploid"> 9 <xml name="macro_haploid2diploid">
11 <param name="haploid2diploid" type="boolean" truevalue="--haploid2diploid" falsevalue="" checked="false" 10 <param name="haploid2diploid" type="boolean" truevalue="--haploid2diploid" falsevalue="" checked="false" label="convert haploid genotypes to diploid homozygotes" help="(\-\-haploid2diploid)"/>
12 label="convert haploid genotypes to diploid homozygotes" help="(\-\-haploid2diploid)"/>
13 </xml> 11 </xml>
14 <xml name="macro_sexinfo"> 12 <xml name="macro_sexinfo">
15 <conditional name="sex_info"> 13 <conditional name="sex_info">
16 <param name="sex_info_src" type="select" label="sex column"> 14 <param name="sex_info_src" type="select" label="sex column">
17 <help><![CDATA[ 15 <help><![CDATA[
26 <when value="none"/> 24 <when value="none"/>
27 <when value="history"> 25 <when value="history">
28 <param name="sex_info_file" type="data" format="tabular" label="per sample sex designation file"/> 26 <param name="sex_info_file" type="data" format="tabular" label="per sample sex designation file"/>
29 </when> 27 </when>
30 <when value="entry"> 28 <when value="entry">
31 <param name="sex_info_lines" type="text" area="True" label="per sample sex designation" > 29 <param name="sex_info_lines" type="text" area="True" label="per sample sex designation">
32 <validator type="regex" message="sample M or F separated by TAB">^(\S+[ \t][MF](\n\S+[ \t][MF])*)$</validator> 30 <validator type="regex" message="sample M or F separated by TAB">^(\S+[ \t][MF](\n\S+[ \t][MF])*)$</validator>
33 <sanitizer sanitize="False"/> 31 <sanitizer sanitize="False"/>
34 </param> 32 </param>
35 </when> 33 </when>
36 </conditional> 34 </conditional>
41 #elif $convert.sex_info.sex_info_src == 'history': 39 #elif $convert.sex_info.sex_info_src == 'history':
42 --sex "$convert.sex_info.sex_info_file" 40 --sex "$convert.sex_info.sex_info_file"
43 #end if 41 #end if
44 </token> 42 </token>
45 </macros> 43 </macros>
46 <expand macro="bio_tools" /> 44 <expand macro="bio_tools"/>
47 <expand macro="requirements" /> 45 <expand macro="requirements"/>
48 <expand macro="version_command" /> 46 <expand macro="version_command"/>
49 <command detect_errors="aggressive"><![CDATA[ 47 <command detect_errors="aggressive"><![CDATA[
50 @PREPARE_ENV@
51 @PREPARE_INPUT_FILE@ 48 @PREPARE_INPUT_FILE@
52 #set $section = $sec_restrict 49 #set $section = $sec_restrict
53 @PREPARE_TARGETS_FILE@ 50 @PREPARE_TARGETS_FILE@
54 @PREPARE_REGIONS_FILE@ 51 @PREPARE_REGIONS_FILE@
55 52
79 @TARGETS@ 76 @TARGETS@
80 @SAMPLES@ 77 @SAMPLES@
81 78
82 79
83 ## Primary Input/Outputs 80 ## Primary Input/Outputs
84 "$input_file" . 81 @INPUT_FILE@ .
85 ]]> 82 ]]>
86 </command> 83 </command>
87 <configfiles> 84 <configfiles>
88 <configfile name="entered_sex_file"><![CDATA[#slurp 85 <configfile name="entered_sex_file"><![CDATA[#slurp
89 #if $convert.sex_info.sex_info_src == 'entry': 86 #if $convert.sex_info.sex_info_src == 'entry':
90 $convert.sex_info.sex_info_lines.__str__.strip().replace(' ','\t')#slurp 87 $convert.sex_info.sex_info_lines.__str__.strip().replace(' ','\t')#slurp
91 #end if]]></configfile> 88 #end if]]></configfile>
92 </configfiles> 89 </configfiles>
93 <inputs> 90 <inputs>
94 <expand macro="macro_input" /> 91 <expand macro="macro_input"/>
95 <section name="sec_restrict" expanded="false" title="Restrict to"> 92 <section name="sec_restrict" expanded="false" title="Restrict to">
96 <expand macro="macro_restrict" /> 93 <expand macro="macro_region_restrict"/>
97 <expand macro="macro_restrict" type="target" label_type="Target" /> 94 <expand macro="macro_target_restrict"/>
98 <expand macro="macro_samples" /> 95 <expand macro="macro_samples"/>
99 <expand macro="macro_include" /> 96 <expand macro="macro_include"/>
100 <expand macro="macro_exclude" /> 97 <expand macro="macro_exclude"/>
101 </section> 98 </section>
102 <param argument="--keep-duplicates" type="boolean" truevalue="--keep-duplicates" falsevalue="" checked="false" label="Keep duplicates" help="Keep all multiallelic variants" /> 99 <param argument="--keep-duplicates" type="boolean" truevalue="--keep-duplicates" falsevalue="" checked="false" label="Keep duplicates" help="Keep all multiallelic variants"/>
103 <conditional name="convert"> 100 <conditional name="convert">
104 <param name="convert_to" type="select" label="convert to"> 101 <param name="convert_to" type="select" label="convert to">
105 <option value="gen_sample">gen sample - IMPUTE2 or SHAPEIT</option> 102 <option value="gen_sample">gen sample - IMPUTE2 or SHAPEIT</option>
106 <option value="hap_sample">hap sample - IMPUTE2 or SHAPEIT</option> 103 <option value="hap_sample">hap sample - IMPUTE2 or SHAPEIT</option>
107 <option value="hap_legend_sample">hap legend sample - IMPUTE2 or SHAPEIT</option> 104 <option value="hap_legend_sample">hap legend sample - IMPUTE2 or SHAPEIT</option>
113 <option value="GP">GP</option> 110 <option value="GP">GP</option>
114 <!-- 111 <!--
115 <option value="GL">GL</option> 112 <option value="GL">GL</option>
116 --> 113 -->
117 </param> 114 </param>
118 <param name="convert_3N6" argument="--3N6" type="boolean" truevalue="--3N6" falsevalue="" checked="false" label="3N6 format" help="Use 3N+6 column format instead of the old 3N+5 column format" /> 115 <param name="convert_3N6" argument="--3N6" type="boolean" truevalue="--3N6" falsevalue="" checked="false" label="3N6 format" help="Use 3N+6 column format instead of the old 3N+5 column format"/>
119 <expand macro="macro_vcf_ids"/> 116 <expand macro="macro_vcf_ids"/>
120 <expand macro="macro_sexinfo"/> 117 <expand macro="macro_sexinfo"/>
121 </when> 118 </when>
122 <when value="hap_sample"> 119 <when value="hap_sample">
123 <expand macro="macro_haploid2diploid"/> 120 <expand macro="macro_haploid2diploid"/>
131 </when> 128 </when>
132 </conditional> 129 </conditional>
133 </inputs> 130 </inputs>
134 <outputs> 131 <outputs>
135 <data name="output_gen" format="tabular" label="${input_file.name.rsplit('.',1)[0]}.gen"> 132 <data name="output_gen" format="tabular" label="${input_file.name.rsplit('.',1)[0]}.gen">
136 <filter>convert['convert_to'] == 'gen_sample'</filter> 133 <filter>convert['convert_to'] == 'gen_sample'</filter>
137 </data> 134 </data>
138 <data name="output_hap" format="tabular" label="${input_file.name.rsplit('.',1)[0]}.haps"> 135 <data name="output_hap" format="tabular" label="${input_file.name.rsplit('.',1)[0]}.haps">
139 <filter>convert['convert_to'] in ('hap_sample','hap_legend_sample')</filter> 136 <filter>convert['convert_to'] in ('hap_sample','hap_legend_sample')</filter>
140 </data> 137 </data>
141 <data name="output_legend" format="tabular" label="${input_file.name.rsplit('.',1)[0]}.legend"> 138 <data name="output_legend" format="tabular" label="${input_file.name.rsplit('.',1)[0]}.legend">
142 <filter>convert['convert_to'] == 'hap_legend_sample'</filter> 139 <filter>convert['convert_to'] == 'hap_legend_sample'</filter>
143 </data> 140 </data>
144 <data name="output_samples" format="tabular" label="${input_file.name.rsplit('.',1)[0]}.samples"/> 141 <data name="output_samples" format="tabular" label="${input_file.name.rsplit('.',1)[0]}.samples"/>
145 </outputs> 142 </outputs>
146 <tests> 143 <tests>
147 <test expect_num_outputs="2"> 144 <test expect_num_outputs="2">
148 <param name="input_file" ftype="vcf" value="convert.vcf" /> 145 <param name="input_file" ftype="vcf" value="convert.vcf"/>
149 <param name="convert_to" value="gen_sample" /> 146 <conditional name="convert">
147 <param name="convert_to" value="gen_sample"/>
148 </conditional>
150 <output name="output_gen"> 149 <output name="output_gen">
151 <assert_contents> 150 <assert_contents>
152 <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"/> 151 <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"/>
153 </assert_contents> 152 </assert_contents>
154 </output> 153 </output>
157 <has_text text="NA00001 NA00001 0"/> 156 <has_text text="NA00001 NA00001 0"/>
158 </assert_contents> 157 </assert_contents>
159 </output> 158 </output>
160 </test> 159 </test>
161 <test expect_num_outputs="2"> 160 <test expect_num_outputs="2">
162 <param name="input_file" ftype="vcf" value="convert.vcf" /> 161 <param name="input_file" ftype="vcf" value="convert.vcf"/>
163 <param name="convert_to" value="gen_sample" /> 162 <conditional name="convert">
164 <param name="tag" value="GP" /> 163 <param name="convert_to" value="gen_sample"/>
165 <param name="convert_3N6" value="True" /> 164 <param name="tag" value="GP"/>
165 <param name="convert_3N6" value="True"/>
166 </conditional>
166 <output name="output_gen"> 167 <output name="output_gen">
167 <assert_contents> 168 <assert_contents>
168 <has_text text="X:2698630_A_G X:2698630_A_G 2698630 A G 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000 1.000000"/> 169 <has_text text="X:2698630_A_G X:2698630_A_G 2698630 A G 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000 1.000000"/>
169 </assert_contents> 170 </assert_contents>
170 </output> 171 </output>
171 </test> 172 </test>
172 <test expect_num_outputs="2"> 173 <test expect_num_outputs="2">
173 <param name="input_file" ftype="vcf" value="check.vcf" /> 174 <param name="input_file" ftype="vcf" value="check.vcf"/>
174 <param name="convert_to" value="gen_sample" /> 175 <conditional name="convert">
175 <param name="tag" value="GT" /> 176 <param name="convert_to" value="gen_sample"/>
176 <param name="convert_3N6" value="True" /> 177 <param name="tag" value="GT"/>
177 <param name="vcf_ids" value="True" /> 178 <param name="convert_3N6" value="True"/>
179 <param name="vcf_ids" value="True"/>
180 </conditional>
178 <output name="output_gen"> 181 <output name="output_gen">
179 <assert_contents> 182 <assert_contents>
180 <has_text text="1:3062915_GTTT_G id3D 3062915 GTTT G 0 1 0 0 1 0"/> 183 <has_text text="1:3062915_GTTT_G id3D 3062915 GTTT G 0 1 0 0 1 0"/>
181 </assert_contents> 184 </assert_contents>
182 </output> 185 </output>
183 </test> 186 </test>
184 <test expect_num_outputs="2"> 187 <test expect_num_outputs="2">
185 <param name="input_file" ftype="vcf" value="convert.vcf" /> 188 <param name="input_file" ftype="vcf" value="convert.vcf"/>
186 <param name="convert_to" value="hap_sample" /> 189 <conditional name="convert">
190 <param name="convert_to" value="hap_sample"/>
191 </conditional>
187 <output name="output_hap"> 192 <output name="output_hap">
188 <assert_contents> 193 <assert_contents>
189 <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"/> 194 <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"/>
190 </assert_contents> 195 </assert_contents>
191 </output> 196 </output>
192 </test> 197 </test>
193 <test expect_num_outputs="3"> 198 <test expect_num_outputs="3">
194 <param name="input_file" ftype="vcf" value="convert.vcf" /> 199 <param name="input_file" ftype="vcf" value="convert.vcf"/>
195 <param name="convert_to" value="hap_legend_sample" /> 200 <conditional name="convert">
201 <param name="convert_to" value="hap_legend_sample"/>
202 </conditional>
196 <output name="output_hap"> 203 <output name="output_hap">
197 <assert_contents> 204 <assert_contents>
198 <has_text text="1 0 1 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0"/> 205 <has_text text="1 0 1 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0"/>
199 </assert_contents> 206 </assert_contents>
200 </output> 207 </output>
210 </assert_contents> 217 </assert_contents>
211 </output> 218 </output>
212 </test> 219 </test>
213 <!-- Test keep-duplicates option --> 220 <!-- Test keep-duplicates option -->
214 <test expect_num_outputs="3"> 221 <test expect_num_outputs="3">
215 <param name="input_file" ftype="vcf" value="convert.vcf" /> 222 <param name="input_file" ftype="vcf" value="convert.vcf"/>
216 <param name="convert_to" value="hap_legend_sample" /> 223 <conditional name="convert">
224 <param name="convert_to" value="hap_legend_sample"/>
225 </conditional>
217 <param name="keep_duplicates" value="true"/> 226 <param name="keep_duplicates" value="true"/>
218 <output name="output_hap"> 227 <output name="output_hap">
219 <assert_contents> 228 <assert_contents>
220 <has_text text="1 0 1 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0"/> 229 <has_text text="1 0 1 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0"/>
221 </assert_contents> 230 </assert_contents>
230 <has_text text="sample population group sex"/> 239 <has_text text="sample population group sex"/>
231 <has_text text="NA00001 NA00001 NA00001 2"/> 240 <has_text text="NA00001 NA00001 NA00001 2"/>
232 </assert_contents> 241 </assert_contents>
233 </output> 242 </output>
234 <assert_command> 243 <assert_command>
235 <has_text text="--keep-duplicates" /> 244 <has_text text="--keep-duplicates"/>
236 </assert_command> 245 </assert_command>
237 </test> 246 </test>
238 <!-- Test region overlap --> 247 <!-- Test region overlap -->
239 <test expect_num_outputs="2"> 248 <test expect_num_outputs="2">
240 <param name="input_file" ftype="vcf" value="convert.vcf" /> 249 <param name="input_file" ftype="vcf" value="convert.vcf"/>
241 <param name="convert_to" value="gen_sample" /> 250 <conditional name="convert">
251 <param name="convert_to" value="gen_sample"/>
252 </conditional>
242 <section name="sec_restrict"> 253 <section name="sec_restrict">
243 <param name="regions_overlap" value="1"/> 254 <conditional name="regions">
255 <param name="regions_src" value="regions" />
256 <repeat name="region_specs">
257 <param name="chrom" value="X" />
258 </repeat>
259 </conditional>
244 </section> 260 </section>
245 <output name="output_gen"> 261 <output name="output_gen">
246 <assert_contents> 262 <assert_contents>
247 <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"/> 263 <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"/>
248 </assert_contents> 264 </assert_contents>
251 <assert_contents> 267 <assert_contents>
252 <has_text text="NA00001 NA00001 0"/> 268 <has_text text="NA00001 NA00001 0"/>
253 </assert_contents> 269 </assert_contents>
254 </output> 270 </output>
255 <assert_command> 271 <assert_command>
256 <has_text text="--regions-overlap" /> 272 <has_text text="--regions-overlap"/>
257 </assert_command> 273 </assert_command>
258 </test> 274 </test>
259 </tests> 275 </tests>
260
261 <help><![CDATA[ 276 <help><![CDATA[
262 ===================================== 277 =====================================
263 bcftools @EXECUTABLE@ from vcf 278 bcftools @EXECUTABLE@ from vcf
264 ===================================== 279 =====================================
265 280
269 @TARGETS_HELP@ 284 @TARGETS_HELP@
270 @EXPRESSIONS_HELP@ 285 @EXPRESSIONS_HELP@
271 286
272 @BCFTOOLS_MANPAGE@#@EXECUTABLE@ 287 @BCFTOOLS_MANPAGE@#@EXECUTABLE@
273 288
274 @BCFTOOLS_WIKI@ 289 @BCFTOOLS_HOWTOS@
275 ]]> 290 ]]>
276 </help> 291 </help>
277 <expand macro="citations" /> 292 <expand macro="citations"/>
278 </tool> 293 </tool>