Mercurial > repos > iuc > bcftools_reheader
comparison bcftools_reheader.xml @ 0:6ca0d413a76a draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bcftools commit ef90c4602bdb83ea7455946c9d175ea27284e643
author | iuc |
---|---|
date | Wed, 06 Jul 2016 07:08:44 -0400 |
parents | |
children | 4e8e8fa7f39e |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:6ca0d413a76a |
---|---|
1 <?xml version='1.0' encoding='utf-8'?> | |
2 <tool name="bcftools @EXECUTABLE@" id="bcftools_@EXECUTABLE@" version="@VERSION@.0"> | |
3 <description>Modify header of VCF/BCF files, change sample names</description> | |
4 <macros> | |
5 <token name="@EXECUTABLE@">reheader</token> | |
6 <import>macros.xml</import> | |
7 </macros> | |
8 <expand macro="requirements" /> | |
9 <expand macro="version_command" /> | |
10 <command detect_errors="aggressive"><![CDATA[ | |
11 @PREPARE_ENV@ | |
12 @PREPARE_INPUT_FILE@ | |
13 bcftools @EXECUTABLE@ | |
14 | |
15 #set $section = $sec_default | |
16 | |
17 #if $section.header: | |
18 --header "${section.header}" | |
19 #end if | |
20 | |
21 #if $section.rename_samples.samples_src == 'history': | |
22 --samples "${section.rename_samples.sample_file}" | |
23 #elif $section.rename_samples.samples_src == 'entry': | |
24 --samples "${entered_sample_file}" | |
25 #end if | |
26 | |
27 ## Primary Input/Outputs | |
28 @INPUT_FILE@ | |
29 | bcftools view | |
30 @OUTPUT_TYPE@ | |
31 > "$output_file" | |
32 ]]> | |
33 </command> | |
34 <configfiles> | |
35 <configfile name="entered_sample_file"><![CDATA[#slurp | |
36 #if $sec_default.rename_samples.samples_src == 'entry' | |
37 $sec_default.rename_samples.sample_lines.__str__.strip()#slurp | |
38 #end if]]></configfile> | |
39 </configfiles> | |
40 | |
41 <inputs> | |
42 <expand macro="macro_input" /> | |
43 <section name="sec_default" expanded="true" title="Default Options"> | |
44 <param name="header" type="data" format="vcf" label="Header" optional="True" help="New header" /> | |
45 <conditional name="rename_samples"> | |
46 <param name="samples_src" type="select" label="New Sample names"> | |
47 <help><![CDATA[ | |
48 New sample names, one name per line, in the same order as they appear in the VCF file. | |
49 Alternatively, only samples which need to be renamed can be listed as | |
50 "old_name new_name" pairs separated by whitespaces, each on separate line. | |
51 ]]></help> | |
52 <option value="none">Do not change</option> | |
53 <option value="history">From your history</option> | |
54 <option value="entry">From text input</option> | |
55 </param> | |
56 <when value="none"/> | |
57 <when value="history"> | |
58 <param name="sample_file" type="data" format="tabular" label="Samples file"/> | |
59 </when> | |
60 <when value="entry"> | |
61 <param name="sample_lines" type="text" area="True" label="Samples text entry" > | |
62 <validator type="regex" message="Either one name per line, or old new sample names per line">^((\S+(\n\S+))|(\S+[ \t]\S+(\n\S+[ \t]\S+)*))$</validator> | |
63 <sanitizer sanitize="False"/> | |
64 </param> | |
65 </when> | |
66 </conditional> | |
67 </section> | |
68 <expand macro="macro_select_output_type" /> | |
69 </inputs> | |
70 <outputs> | |
71 <expand macro="macro_vcf_output"/> | |
72 </outputs> | |
73 <tests> | |
74 <test> | |
75 <param name="input_file" ftype="vcf" value="reheader.vcf" /> | |
76 <param name="header" ftype="vcf" value="reheader.hdr" /> | |
77 <param name="output_type" value="v" /> | |
78 <output name="output_file"> | |
79 <assert_contents> | |
80 <has_text text="##fileformat=VCFv4.2" /> | |
81 <has_text text="AAA0001" /> | |
82 <not_has_text text="XY00001" /> | |
83 </assert_contents> | |
84 </output> | |
85 </test> | |
86 <test> | |
87 <param name="input_file" ftype="vcf" value="reheader.vcf" /> | |
88 <param name="samples_src" value="history" /> | |
89 <param name="sample_file" ftype="tabular" value="reheader.samples" /> | |
90 <param name="output_type" value="v" /> | |
91 <output name="output_file"> | |
92 <assert_contents> | |
93 <not_has_text text="XY00001" /> | |
94 <has_text_matching expression="FORMAT\tAAA\tBBB"/> | |
95 </assert_contents> | |
96 </output> | |
97 </test> | |
98 <test> | |
99 <param name="input_file" ftype="vcf" value="reheader.vcf" /> | |
100 <param name="samples_src" value="history" /> | |
101 <param name="sample_file" ftype="tabular" value="reheader.samples2" /> | |
102 <param name="output_type" value="v" /> | |
103 <output name="output_file"> | |
104 <assert_contents> | |
105 <not_has_text text="XY00001" /> | |
106 <has_text_matching expression="FORMAT\tAAA\tBBB"/> | |
107 </assert_contents> | |
108 </output> | |
109 </test> | |
110 <!-- | |
111 <test> | |
112 <param name="input_file" ftype="vcf" value="reheader.vcf" /> | |
113 <param name="samples_src" value="entry" /> | |
114 <param name="sample_lines" value="AAA\nBBB" /> | |
115 <param name="output_type" value="v" /> | |
116 <output name="output_file"> | |
117 <assert_contents> | |
118 <not_has_text text="XY00001" /> | |
119 <has_text_matching expression="FORMAT\tAAA\tBBB"/> | |
120 </assert_contents> | |
121 </output> | |
122 </test> | |
123 <test> | |
124 <param name="input_file" ftype="vcf" value="reheader.vcf" /> | |
125 <param name="samples_src" value="entry" /> | |
126 <param name="sample_lines" value="XY00002 BBB\nXY00001 AAA" /> | |
127 <param name="output_type" value="v" /> | |
128 <output name="output_file"> | |
129 <assert_contents> | |
130 <not_has_text text="XY00001" /> | |
131 <has_text_matching expression="FORMAT\tAAA\tBBB"/> | |
132 </assert_contents> | |
133 </output> | |
134 </test> | |
135 --> | |
136 </tests> | |
137 <help><![CDATA[ | |
138 ===================================== | |
139 bcftools @EXECUTABLE@ | |
140 ===================================== | |
141 | |
142 Modify header of VCF/BCF files, change sample names. | |
143 | |
144 @BCFTOOLS_MANPAGE@#@EXECUTABLE@ | |
145 | |
146 @BCFTOOLS_WIKI@ | |
147 ]]> | |
148 </help> | |
149 <expand macro="citations" /> | |
150 </tool> |